• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
tdeactioncollection.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org>
3  (C) 1999 Simon Hausmann <hausmann@kde.org>
4  (C) 2000 Nicolas Hadacek <haadcek@kde.org>
5  (C) 2000 Kurt Granroth <granroth@kde.org>
6  (C) 2000 Michael Koch <koch@kde.org>
7  (C) 2001 Holger Freyther <freyther@kde.org>
8  (C) 2002 Ellis Whitehead <ellis@kde.org>
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Library General Public
12  License version 2 as published by the Free Software Foundation.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
24 
25 #ifndef __tdeactioncollection_h__
26 #define __tdeactioncollection_h__
27 
28 #include <tdeaction.h>
29 
30 #include <tqkeysequence.h>
31 #include <tqobject.h>
32 #include <tqvaluelist.h>
33 #include <tqguardedptr.h>
34 #include <kguiitem.h>
35 #include <tdeshortcut.h>
36 #include <kstdaction.h>
37 #include <kicontheme.h>
38 
39 class TQMenuBar;
40 class TQPopupMenu;
41 class TQComboBox;
42 class TQPoint;
43 class TQIconSet;
44 class TQString;
45 class TDEToolBar;
46 
47 class TDEAccel;
48 class TDEAccelActions;
49 class TDEConfig;
50 class TDEConfigBase;
51 class KURL;
52 class TDEInstance;
53 class TDEToolBar;
54 class TDEActionCollection;
55 class TDEPopupMenu;
56 class TDEMainWindow;
57 class KXMLGUIClient;
58 
59 typedef TQValueList<TDEAction *> TDEActionPtrList;
60 
78 class TDEUI_EXPORT TDEActionCollection : public TQObject
79 {
80  friend class TDEAction;
81  friend class KXMLGUIClient;
82 
83  Q_OBJECT
84 
85 public:
86  TDEActionCollection( TQWidget *parent, const char *name = 0, TDEInstance *instance = 0 );
92  TDEActionCollection( TQWidget *watch, TQObject* parent, const char *name = 0, TDEInstance *instance = 0 );
93 #ifndef KDE_NO_COMPAT
94  TDEActionCollection( const TDEActionCollection &copy );
95 #endif
96  virtual ~TDEActionCollection();
97 
102  virtual void setWidget( TQWidget *widget );
103 
111  void setAutoConnectShortcuts( bool );
112 
119  bool isAutoConnectShortcuts();
120 
127  //void setDefaultScope( TDEAction::Scope );
128 
133  bool addDocCollection( TDEActionCollection* pDoc );
134 
136  //uint widgetCount() const;
137 
143  //bool ownsTDEAccel() const;
144 
146  virtual TDEAccel* accel() KDE_DEPRECATED;
148  virtual const TDEAccel* accel() const KDE_DEPRECATED;
149 
151  TDEAccel* tdeaccel();
153  const TDEAccel* tdeaccel() const;
154 
156  TDEAccel* builderTDEAccel() const;
158  //TDEAccel* widgetTDEAccel( uint i );
159  //const TDEAccel* widgetTDEAccel( uint i ) const;
160 
162  virtual uint count() const;
163  bool isEmpty() const { return (count() == 0); }
168  virtual TDEAction* action( int index ) const;
176  virtual TDEAction* action( const char* name, const char* classname = 0 ) const;
177 
182  virtual TQStringList groups() const;
187  virtual TDEActionPtrList actions( const TQString& group ) const;
189  virtual TDEActionPtrList actions() const;
190 
194  bool readShortcutSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0 );
198  bool writeShortcutSettings( const TQString& sConfigGroup = TQString::null, TDEConfigBase* pConfig = 0 ) const;
199 
200  void setInstance( TDEInstance *instance );
202  TDEInstance *instance() const;
203 
207  void setXMLFile( const TQString& );
211  const TQString& xmlFile() const;
212 
213  //TODO FOR KDE4 make this default true
225  void setHighlightingEnabled( bool enable );
234  bool highlightingEnabled() const;
235 
249  void connectHighlight( TQWidget *container, TDEAction *action );
263  void disconnectHighlight( TQWidget *container, TDEAction *action );
264 
268  const KXMLGUIClient *parentGUIClient() const;
269 
270 signals:
271  void inserted( TDEAction* );
272  void removed( TDEAction* );
273 
282  void actionHighlighted( TDEAction *action );
291  void actionHighlighted( TDEAction *action, bool highlight );
301  void actionStatusText( const TQString &text );
307  void clearStatusText();
308 
309 private:
316  void beginXMLPlug( TQWidget *widget );
317  void endXMLPlug();
319  void prepareXMLUnplug();
320  void unplugShortcuts( TDEAccel* tdeaccel );
321 
322  void _clear();
323  void _insert( TDEAction* );
324  void _remove( TDEAction* );
325  TDEAction* _take( TDEAction* );
326 
327 private slots:
328  void slotMenuItemHighlighted( int id );
329  void slotToolBarButtonHighlighted( int id, bool highlight );
330  void slotMenuAboutToHide();
331  void slotDestroyed();
332 
333 private:
334  TDEAction *findAction( TQWidget *container, int id );
335 
336 #ifndef KDE_NO_COMPAT
337 public:
338  TDEActionCollection( TQObject *parent, const char *name = 0, TDEInstance *instance = 0 );
339 #endif
340 
341 public:
352  void insert( TDEAction* action);
353 
360  void remove( TDEAction* action );
361 
369  TDEAction* take( TDEAction* action );
370 
371 #ifndef KDE_NO_COMPAT
372  TDEActionCollection operator+ ( const TDEActionCollection& ) const;
373  TDEActionCollection& operator= ( const TDEActionCollection& );
374  TDEActionCollection& operator+= ( const TDEActionCollection& );
375 #endif // !KDE_NO_COMPAT
376 
377  // KDE4: clear() doesn't need to be a slot
378 public slots:
383  void clear();
384 
385 protected:
386  virtual void virtual_hook( int id, void* data );
387 private:
388  TDEActionCollection( const char* name, const KXMLGUIClient* parent );
389  class TDEActionCollectionPrivate;
390  TDEActionCollectionPrivate *d;
391 };
392 
393 #endif
TDEConfig
KURL
KXMLGUIClient::setXMLFile
virtual void setXMLFile(const TQString &file, bool merge=false, bool setXMLDoc=true)
Sets the name of the rc file containing the XML for the part.
Definition: kxmlguiclient.cpp:165
KXMLGUIClient::prepareXMLUnplug
void prepareXMLUnplug(TQWidget *)
Definition: kxmlguiclient.cpp:942
KXMLGUIClient
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:43
KXMLGUIClient::setInstance
virtual void setInstance(TDEInstance *instance)
Returns true if client was added to super client list.
Definition: kxmlguiclient.cpp:157
TDEActionCollection
A managed set of TDEAction objects.
Definition: tdeactioncollection.h:78
TDEAction
Class to encapsulate user-driven action or event.
Definition: tdeaction.h:202
KXMLGUIClient::action
TDEAction * action(const char *name) const
Retrieves an action of the client by name.
Definition: kxmlguiclient.cpp:93
TDEAccel
TDEConfigBase
TDEMainWindow
KDE top level main window
Definition: tdemainwindow.h:98
TDEToolBar
Floatable toolbar with auto resize.
Definition: tdetoolbar.h:104
KXMLGUIClient::endXMLPlug
void endXMLPlug()
Definition: kxmlguiclient.cpp:934
KXMLGUIClient::instance
virtual TDEInstance * instance() const
Definition: kxmlguiclient.cpp:123
KXMLGUIClient::beginXMLPlug
void beginXMLPlug(TQWidget *)
Definition: kxmlguiclient.cpp:926
TDEPopupMenu
A menu with title items.
Definition: tdepopupmenu.h:123
TDEInstance
KXMLGUIClient::xmlFile
virtual TQString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition: kxmlguiclient.cpp:133

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.