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

tdeui

tdeaction.h
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org>
00003               (C) 1999 Simon Hausmann <hausmann@kde.org>
00004               (C) 2000 Nicolas Hadacek <haadcek@kde.org>
00005               (C) 2000 Kurt Granroth <granroth@kde.org>
00006               (C) 2000 Michael Koch <koch@kde.org>
00007               (C) 2001 Holger Freyther <freyther@kde.org>
00008               (C) 2002 Ellis Whitehead <ellis@kde.org>
00009 
00010     This library is free software; you can redistribute it and/or
00011     modify it under the terms of the GNU Library General Public
00012     License version 2 as published by the Free Software Foundation.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Library General Public License for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with this library; see the file COPYING.LIB.  If not, write to
00021     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022     Boston, MA 02110-1301, USA.
00023 */
00024 //$Id$
00025 
00026 #ifndef __tdeaction_h__
00027 #define __tdeaction_h__
00028 
00029 #include <tqkeysequence.h>
00030 #include <tqobject.h>
00031 #include <tqvaluelist.h>
00032 #include <tqguardedptr.h>
00033 #include <kguiitem.h>
00034 #include <tdeshortcut.h>
00035 #include <kstdaction.h>
00036 #include <kicontheme.h>
00037 
00038 class TQMenuBar;
00039 class TQPopupMenu;
00040 class TQComboBox;
00041 class TQPoint;
00042 class TQIconSet;
00043 class TQString;
00044 class TDEToolBar;
00045 
00046 class TDEAccel;
00047 class TDEAccelActions;
00048 class TDEConfig;
00049 class TDEConfigBase;
00050 class KURL;
00051 class TDEInstance;
00052 class TDEToolBar;
00053 class TDEActionCollection;
00054 class TDEPopupMenu;
00055 class TDEMainWindow;
00056 
00202 class TDEUI_EXPORT TDEAction : public TQObject
00203 {
00204   friend class TDEActionCollection;
00205   Q_OBJECT
00206   TQ_PROPERTY( int containerCount READ containerCount )
00207   TQ_PROPERTY( TQString plainText READ plainText )
00208   TQ_PROPERTY( TQString text READ text WRITE setText )
00209   TQ_PROPERTY( TQString shortcut READ shortcutText WRITE setShortcutText )
00210   TQ_PROPERTY( bool enabled READ isEnabled WRITE setEnabled )
00211   TQ_PROPERTY( TQString group READ group WRITE setGroup )
00212   TQ_PROPERTY( TQString whatsThis READ whatsThis WRITE setWhatsThis )
00213   TQ_PROPERTY( TQString toolTip READ toolTip WRITE setToolTip )
00214   TQ_PROPERTY( TQString icon READ icon WRITE setIcon )
00215 public:
00236     TDEAction( const TQString& text, const TDEShortcut& cut,
00237              const TQObject* receiver, const char* slot,
00238              TDEActionCollection* parent, const char* name );
00239 
00259     TDEAction( const TQString& text, const TQIconSet& pix, const TDEShortcut& cut,
00260              const TQObject* receiver, const char* slot,
00261              TDEActionCollection* parent, const char* name );
00262 
00283     TDEAction( const TQString& text, const TQString& pix, const TDEShortcut& cut,
00284              const TQObject* receiver, const char* slot,
00285              TDEActionCollection* parent, const char* name );
00286 
00298     TDEAction( const KGuiItem& item, const TDEShortcut& cut,
00299              const TQObject* receiver, const char* slot,
00300              TDEActionCollection* parent, const char* name );
00301 
00305     TDEAction( const TQString& text, const TDEShortcut& cut = TDEShortcut(), TQObject* parent = 0, const char* name = 0 );
00309     TDEAction( const TQString& text, const TDEShortcut& cut,
00310         const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 );
00314     TDEAction( const TQString& text, const TQIconSet& pix, const TDEShortcut& cut = TDEShortcut(),
00315         TQObject* parent = 0, const char* name = 0 );
00319     TDEAction( const TQString& text, const TQString& pix, const TDEShortcut& cut = TDEShortcut(),
00320         TQObject* parent = 0, const char* name = 0 );
00324     TDEAction( const TQString& text, const TQIconSet& pix, const TDEShortcut& cut,
00325         const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 );
00329     TDEAction( const TQString& text, const TQString& pix, const TDEShortcut& cut,
00330         const TQObject* receiver, const char* slot, TQObject* parent,
00331         const char* name = 0 );
00335     TDEAction( TQObject* parent = 0, const char* name = 0 );
00336 
00340     virtual ~TDEAction();
00341 
00355     virtual int plug( TQWidget *widget, int index = -1 );
00356 
00367     virtual void plugAccel(TDEAccel *accel, bool configurable = true) KDE_DEPRECATED;
00368 
00381     virtual void unplug( TQWidget *w );
00382 
00387     virtual void unplugAccel() KDE_DEPRECATED;
00388 
00393     virtual bool isPlugged() const;
00394 
00398     bool isPlugged( const TQWidget *container ) const;
00399 
00404     virtual bool isPlugged( const TQWidget *container, int id ) const;
00405 
00410     virtual bool isPlugged( const TQWidget *container, const TQWidget *_representative ) const;
00411 
00412     TQWidget* container( int index ) const;
00413     int itemId( int index ) const;
00414     TQWidget* representative( int index ) const;
00415     int containerCount() const;
00417     uint tdeaccelCount() const;
00418 
00419     virtual bool hasIcon() const;
00420 #ifndef KDE_NO_COMPAT
00421     bool hasIconSet() const { return hasIcon(); }
00422 #endif
00423     virtual TQString plainText() const;
00424 
00428     virtual TQString text() const;
00429 
00433     virtual const TDEShortcut& shortcut() const;
00437     virtual const TDEShortcut& shortcutDefault() const;
00438 
00439     // These two methods are for TQ_PROPERTY
00440     TQString shortcutText() const;
00441     void setShortcutText( const TQString& );
00442 
00446     virtual bool isEnabled() const;
00447 
00451     virtual bool isShortcutConfigurable() const;
00452 
00453     virtual TQString group() const;
00454 
00458     virtual TQString whatsThis() const;
00459 
00463     virtual TQString toolTip() const;
00464 
00472     virtual TQIconSet iconSet( TDEIcon::Group group, int size=0 ) const;
00476     TQIconSet iconSet() const { return iconSet( TDEIcon::Small ); }
00477 
00478     virtual TQString icon() const;
00479 
00480     TDEActionCollection *parentCollection() const;
00481 
00486     static int getToolButtonID();
00487 
00488 
00489     void unplugAll();
00490 
00494     enum ActivationReason { UnknownActivation, EmulatedActivation, AccelActivation, PopupMenuActivation, ToolBarActivation };
00495 
00496 public slots:
00501     virtual void setText(const TQString &text);
00502 
00506     virtual bool setShortcut( const TDEShortcut& );
00507 
00508     virtual void setGroup( const TQString& );
00509 
00517     virtual void setWhatsThis( const TQString& text );
00518 
00533     virtual void setToolTip( const TQString& );
00534 
00539     virtual void setIconSet( const TQIconSet &iconSet );
00540 
00541     virtual void setIcon( const TQString& icon );
00542 
00547     virtual void setEnabled(bool enable);
00548 
00553     void setDisabled(bool disable) { return setEnabled(!disable); }
00554 
00558     virtual void setShortcutConfigurable( bool );
00559 
00564     virtual void activate();
00565 
00566 protected slots:
00567     virtual void slotDestroyed();
00568     virtual void slotKeycodeChanged();
00569     virtual void slotActivated();
00571     void slotPopupActivated(); // KDE4: make virtual
00573     void slotButtonClicked( int, TQt::ButtonState state ); // KDE4: make virtual
00574 
00575 protected:
00576     TDEToolBar* toolBar( int index ) const;
00577     TQPopupMenu* popupMenu( int index ) const;
00578     void removeContainer( int index );
00579     int findContainer( const TQWidget* widget ) const;
00580     int findContainer( int id ) const;
00581     void plugMainWindowAccel( TQWidget *w );
00582 
00583     void addContainer( TQWidget* parent, int id );
00584     void addContainer( TQWidget* parent, TQWidget* representative );
00585 
00586     virtual void updateShortcut( int i );
00587     virtual void updateShortcut( TQPopupMenu* menu, int id );
00588     virtual void updateGroup( int id );
00589     virtual void updateText(int i );
00590     virtual void updateEnabled(int i);
00591     virtual void updateIconSet(int i);
00592     virtual void updateIcon( int i);
00593     virtual void updateToolTip( int id );
00594     virtual void updateWhatsThis( int i );
00595 
00596     TDEActionCollection *m_parentCollection;
00597     TQString whatsThisWithIcon() const;
00602     const KGuiItem& guiItem() const;
00603 
00604 signals:
00608     void activated();
00623     void activated( TDEAction::ActivationReason reason, TQt::ButtonState state );
00624     void enabled( bool );
00625 
00626 private:
00627     void initPrivate( const TQString& text, const TDEShortcut& cut,
00628                   const TQObject* receiver, const char* slot );
00629     TDEAccel* tdeaccelCurrent();
00630     bool initShortcut( const TDEShortcut& );
00631     void plugShortcut();
00632     bool updateTDEAccelShortcut( TDEAccel* tdeaccel );
00633     void insertTDEAccel( TDEAccel* );
00635     void removeTDEAccel( TDEAccel* );
00636 
00637 #ifndef KDE_NO_COMPAT
00638 public:
00643     int accel() const KDE_DEPRECATED;
00644 
00645     TQString statusText() const
00646         { return toolTip(); }
00647 
00652     void setAccel( int key ) KDE_DEPRECATED;
00653 
00657     void setStatusText( const TQString &text )
00658          { setToolTip( text ); }
00659 
00663     int menuId( int i ) { return itemId( i ); }
00664 #endif // !KDE_NO_COMPAT
00665 
00666 protected:
00667     virtual void virtual_hook( int id, void* data );
00668 private:
00669     class TDEActionPrivate;
00670     TDEActionPrivate* const d;
00671 };
00672 
00673 #include <tdeactioncollection.h>
00674 #include <tdeactionclasses.h>
00675 
00676 #endif

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.7.6.1
This website is maintained by Timothy Pearson.