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

kdeui

  • kdeui
kactioncollection.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 __kactioncollection_h__
26 #define __kactioncollection_h__
27 
28 #include <kaction.h>
29 
30 #include <tqkeysequence.h>
31 #include <tqobject.h>
32 #include <tqvaluelist.h>
33 #include <tqguardedptr.h>
34 #include <kguiitem.h>
35 #include <kshortcut.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 KToolBar;
46 
47 class KAccel;
48 class KAccelActions;
49 class KConfig;
50 class KConfigBase;
51 class KURL;
52 class KInstance;
53 class KToolBar;
54 class KActionCollection;
55 class KPopupMenu;
56 class KMainWindow;
57 class KXMLGUIClient;
58 
59 typedef TQValueList<KAction *> KActionPtrList;
60 
78 class KDEUI_EXPORT KActionCollection : public TQObject
79 {
80  friend class KAction;
81  friend class KXMLGUIClient;
82 
83  Q_OBJECT
84 
85 public:
86  KActionCollection( TQWidget *parent, const char *name = 0, KInstance *instance = 0 );
92  KActionCollection( TQWidget *watch, TQObject* parent, const char *name = 0, KInstance *instance = 0 );
93 #ifndef KDE_NO_COMPAT
94  KActionCollection( const KActionCollection &copy );
95 #endif
96  virtual ~KActionCollection();
97 
102  virtual void setWidget( TQWidget *widget );
103 
111  void setAutoConnectShortcuts( bool );
112 
119  bool isAutoConnectShortcuts();
120 
127  //void setDefaultScope( KAction::Scope );
128 
133  bool addDocCollection( KActionCollection* pDoc );
134 
136  //uint widgetCount() const;
137 
143  //bool ownsKAccel() const;
144 
146  virtual KAccel* accel() KDE_DEPRECATED;
148  virtual const KAccel* accel() const KDE_DEPRECATED;
149 
151  KAccel* kaccel();
153  const KAccel* kaccel() const;
154 
156  KAccel* builderKAccel() const;
158  //KAccel* widgetKAccel( uint i );
159  //const KAccel* widgetKAccel( uint i ) const;
160 
162  virtual uint count() const;
163  bool isEmpty() const { return (count() == 0); }
168  virtual KAction* action( int index ) const;
176  virtual KAction* action( const char* name, const char* classname = 0 ) const;
177 
182  virtual TQStringList groups() const;
187  virtual KActionPtrList actions( const TQString& group ) const;
189  virtual KActionPtrList actions() const;
190 
194  bool readShortcutSettings( const TQString& sConfigGroup = TQString::null, KConfigBase* pConfig = 0 );
198  bool writeShortcutSettings( const TQString& sConfigGroup = TQString::null, KConfigBase* pConfig = 0 ) const;
199 
200  void setInstance( KInstance *instance );
202  KInstance *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, KAction *action );
263  void disconnectHighlight( TQWidget *container, KAction *action );
264 
268  const KXMLGUIClient *parentGUIClient() const;
269 
270 signals:
271  void inserted( KAction* );
272  void removed( KAction* );
273 
282  void actionHighlighted( KAction *action );
291  void actionHighlighted( KAction *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( KAccel* kaccel );
321 
322  void _clear();
323  void _insert( KAction* );
324  void _remove( KAction* );
325  KAction* _take( KAction* );
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  KAction *findAction( TQWidget *container, int id );
335 
336 #ifndef KDE_NO_COMPAT
337 public:
338  KActionCollection( TQObject *parent, const char *name = 0, KInstance *instance = 0 );
339 #endif
340 
341 public:
352  void insert( KAction* action);
353 
360  void remove( KAction* action );
361 
369  KAction* take( KAction* action );
370 
371 #ifndef KDE_NO_COMPAT
372  KActionCollection operator+ ( const KActionCollection& ) const;
373  KActionCollection& operator= ( const KActionCollection& );
374  KActionCollection& operator+= ( const KActionCollection& );
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  KActionCollection( const char* name, const KXMLGUIClient* parent );
389  class KActionCollectionPrivate;
390  KActionCollectionPrivate *d;
391 };
392 
393 #endif

kdeui

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

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |