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

tdeui

  • tdeui
tdeaction.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 //$Id$
25 
26 #ifndef __tdeaction_h__
27 #define __tdeaction_h__
28 
29 #include <tqkeysequence.h>
30 #include <tqobject.h>
31 #include <tqvaluelist.h>
32 #include <tqguardedptr.h>
33 #include <kguiitem.h>
34 #include <tdeshortcut.h>
35 #include <kstdaction.h>
36 #include <kicontheme.h>
37 
38 class TQMenuBar;
39 class TQPopupMenu;
40 class TQComboBox;
41 class TQPoint;
42 class TQIconSet;
43 class TQString;
44 class TDEToolBar;
45 
46 class TDEAccel;
47 class TDEAccelActions;
48 class TDEConfig;
49 class TDEConfigBase;
50 class KURL;
51 class TDEInstance;
52 class TDEToolBar;
53 class TDEActionCollection;
54 class TDEPopupMenu;
55 class TDEMainWindow;
56 
202 class TDEUI_EXPORT TDEAction : public TQObject
203 {
204  friend class TDEActionCollection;
205  TQ_OBJECT
206  TQ_PROPERTY( int containerCount READ containerCount )
207  TQ_PROPERTY( TQString plainText READ plainText )
208  TQ_PROPERTY( TQString text READ text WRITE setText )
209  TQ_PROPERTY( TQString shortcut READ shortcutText WRITE setShortcutText )
210  TQ_PROPERTY( bool enabled READ isEnabled WRITE setEnabled )
211  TQ_PROPERTY( TQString group READ group WRITE setGroup )
212  TQ_PROPERTY( TQString whatsThis READ whatsThis WRITE setWhatsThis )
213  TQ_PROPERTY( TQString toolTip READ toolTip WRITE setToolTip )
214  TQ_PROPERTY( TQString icon READ icon WRITE setIcon )
215 public:
236  TDEAction( const TQString& text, const TDEShortcut& cut,
237  const TQObject* receiver, const char* slot,
238  TDEActionCollection* parent, const char* name );
239 
259  TDEAction( const TQString& text, const TQIconSet& pix, const TDEShortcut& cut,
260  const TQObject* receiver, const char* slot,
261  TDEActionCollection* parent, const char* name );
262 
283  TDEAction( const TQString& text, const TQString& pix, const TDEShortcut& cut,
284  const TQObject* receiver, const char* slot,
285  TDEActionCollection* parent, const char* name );
286 
298  TDEAction( const KGuiItem& item, const TDEShortcut& cut,
299  const TQObject* receiver, const char* slot,
300  TDEActionCollection* parent, const char* name );
301 
305  TDEAction( const TQString& text, const TDEShortcut& cut = TDEShortcut(), TQObject* parent = 0, const char* name = 0 );
309  TDEAction( const TQString& text, const TDEShortcut& cut,
310  const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 );
314  TDEAction( const TQString& text, const TQIconSet& pix, const TDEShortcut& cut = TDEShortcut(),
315  TQObject* parent = 0, const char* name = 0 );
319  TDEAction( const TQString& text, const TQString& pix, const TDEShortcut& cut = TDEShortcut(),
320  TQObject* parent = 0, const char* name = 0 );
324  TDEAction( const TQString& text, const TQIconSet& pix, const TDEShortcut& cut,
325  const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 );
329  TDEAction( const TQString& text, const TQString& pix, const TDEShortcut& cut,
330  const TQObject* receiver, const char* slot, TQObject* parent,
331  const char* name = 0 );
335  TDEAction( TQObject* parent = 0, const char* name = 0 );
336 
340  virtual ~TDEAction();
341 
355  virtual int plug( TQWidget *widget, int index = -1 );
356 
367  virtual void plugAccel(TDEAccel *accel, bool configurable = true) TDE_DEPRECATED;
368 
381  virtual void unplug( TQWidget *w );
382 
387  virtual void unplugAccel() TDE_DEPRECATED;
388 
393  virtual bool isPlugged() const;
394 
398  bool isPlugged( const TQWidget *container ) const;
399 
404  virtual bool isPlugged( const TQWidget *container, int id ) const;
405 
410  virtual bool isPlugged( const TQWidget *container, const TQWidget *_representative ) const;
411 
412  TQWidget* container( int index ) const;
413  int itemId( int index ) const;
414  TQWidget* representative( int index ) const;
415  int containerCount() const;
417  uint tdeaccelCount() const;
418 
419  virtual bool hasIcon() const;
420 #ifndef KDE_NO_COMPAT
421  bool hasIconSet() const { return hasIcon(); }
422 #endif
423  virtual TQString plainText() const;
424 
428  virtual TQString text() const;
429 
433  virtual const TDEShortcut& shortcut() const;
437  virtual const TDEShortcut& shortcutDefault() const;
438 
439  // These two methods are for TQ_PROPERTY
440  TQString shortcutText() const;
441  void setShortcutText( const TQString& );
442 
446  virtual bool isEnabled() const;
447 
451  virtual bool isShortcutConfigurable() const;
452 
453  virtual TQString group() const;
454 
458  virtual TQString whatsThis() const;
459 
463  virtual TQString toolTip() const;
464 
472  virtual TQIconSet iconSet( TDEIcon::Group group, int size=0 ) const;
476  TQIconSet iconSet() const { return iconSet( TDEIcon::Small ); }
477 
478  virtual TQString icon() const;
479 
480  TDEActionCollection *parentCollection() const;
481 
486  static int getToolButtonID();
487 
488 
489  void unplugAll();
490 
494  enum ActivationReason { UnknownActivation, EmulatedActivation, AccelActivation, PopupMenuActivation, ToolBarActivation };
495 
496 public slots:
501  virtual void setText(const TQString &text);
502 
506  virtual bool setShortcut( const TDEShortcut& );
507 
508  virtual void setGroup( const TQString& );
509 
517  virtual void setWhatsThis( const TQString& text );
518 
533  virtual void setToolTip( const TQString& );
534 
539  virtual void setIconSet( const TQIconSet &iconSet );
540 
541  virtual void setIcon( const TQString& icon );
542 
547  virtual void setEnabled(bool enable);
548 
553  void setDisabled(bool disable) { return setEnabled(!disable); }
554 
558  virtual void setShortcutConfigurable( bool );
559 
564  virtual void activate();
565 
566 protected slots:
567  virtual void slotDestroyed();
568  virtual void slotKeycodeChanged();
569  virtual void slotActivated();
571  void slotPopupActivated(); // KDE4: make virtual
573  void slotButtonClicked( int, TQt::ButtonState state ); // KDE4: make virtual
574 
575 protected:
576  TDEToolBar* toolBar( int index ) const;
577  TQPopupMenu* popupMenu( int index ) const;
578  void removeContainer( int index );
579  int findContainer( const TQWidget* widget ) const;
580  int findContainer( int id ) const;
581  void plugMainWindowAccel( TQWidget *w );
582 
583  void addContainer( TQWidget* parent, int id );
584  void addContainer( TQWidget* parent, TQWidget* representative );
585 
586  virtual void updateShortcut( int i );
587  virtual void updateShortcut( TQPopupMenu* menu, int id );
588  virtual void updateGroup( int id );
589  virtual void updateText(int i );
590  virtual void updateEnabled(int i);
591  virtual void updateIconSet(int i);
592  virtual void updateIcon( int i);
593  virtual void updateToolTip( int id );
594  virtual void updateWhatsThis( int i );
595 
596  TDEActionCollection *m_parentCollection;
597  TQString whatsThisWithIcon() const;
602  const KGuiItem& guiItem() const;
603 
604 signals:
608  void activated();
623  void activated( TDEAction::ActivationReason reason, TQt::ButtonState state );
624  void enabled( bool );
625 
626 private:
627  void initPrivate( const TQString& text, const TDEShortcut& cut,
628  const TQObject* receiver, const char* slot );
629  TDEAccel* tdeaccelCurrent();
630  bool initShortcut( const TDEShortcut& );
631  void plugShortcut();
632  bool updateTDEAccelShortcut( TDEAccel* tdeaccel );
633  void insertTDEAccel( TDEAccel* );
635  void removeTDEAccel( TDEAccel* );
636 
637 #ifndef KDE_NO_COMPAT
638 public:
643  int accel() const TDE_DEPRECATED;
644 
645  TQString statusText() const
646  { return toolTip(); }
647 
652  void setAccel( int key ) TDE_DEPRECATED;
653 
657  void setStatusText( const TQString &text )
658  { setToolTip( text ); }
659 
663  int menuId( int i ) { return itemId( i ); }
664 #endif // !KDE_NO_COMPAT
665 
666 protected:
667  virtual void virtual_hook( int id, void* data );
668 private:
669  class TDEActionPrivate;
670  TDEActionPrivate* const d;
671 };
672 
673 #include <tdeactioncollection.h>
674 #include <tdeactionclasses.h>
675 
676 #endif
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:39
KURL
TDEAccel
TDEActionCollection
A managed set of TDEAction objects.
Definition: tdeactioncollection.h:79
TDEActionCollection::accel
virtual TDEAccel * accel() TDE_DEPRECATED
Returns the number of widgets which this collection is associated with.
Definition: tdeactioncollection.cpp:369
TDEActionCollection::tdeaccel
TDEAccel * tdeaccel()
Returns the TDEAccel object of the most recently set widget.
Definition: tdeactioncollection.cpp:282
TDEAction
Class to encapsulate user-driven action or event.
Definition: tdeaction.h:203
TDEAction::iconSet
TQIconSet iconSet() const
Remove in KDE4.
Definition: tdeaction.h:476
TDEAction::activated
void activated(TDEAction::ActivationReason reason, TQt::ButtonState state)
This signal allows to know the reason why an action was activated: whether it was due to a toolbar bu...
TDEAction::setStatusText
void setStatusText(const TQString &text)
Definition: tdeaction.h:657
TDEAction::ActivationReason
ActivationReason
Definition: tdeaction.h:494
TDEAction::menuId
int menuId(int i)
Definition: tdeaction.h:663
TDEAction::setDisabled
void setDisabled(bool disable)
Calls setEnabled( !disable ).
Definition: tdeaction.h:553
TDEAction::activated
void activated()
Emitted when this action is activated.
TDEConfigBase
TDEConfig
TDEIcon::Group
Group
TDEIcon::Small
Small
TDEInstance
TDEMainWindow
KDE top level main window
Definition: tdemainwindow.h:99
TDEPopupMenu
A menu with title items.
Definition: tdepopupmenu.h:123
TDEShortcut
TDEToolBar
Floatable toolbar with auto resize.
Definition: tdetoolbar.h:105

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.