kactionclasses.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 (C) 2003 Andras Mantia <amantia@kde.org> 00010 00011 This library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU Library General Public 00013 License version 2 as published by the Free Software Foundation. 00014 00015 This library is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 Library General Public License for more details. 00019 00020 You should have received a copy of the GNU Library General Public License 00021 along with this library; see the file COPYING.LIB. If not, write to 00022 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00023 Boston, MA 02110-1301, USA. 00024 */ 00025 //$Id$ 00026 00027 #ifndef __kactionclasses_h__ 00028 #define __kactionclasses_h__ 00029 00030 #include <kaction.h> 00031 00032 #include <tqkeysequence.h> 00033 #include <tqobject.h> 00034 #include <tqvaluelist.h> 00035 #include <tqguardedptr.h> 00036 #include <kguiitem.h> 00037 #include <kshortcut.h> 00038 #include <kstdaction.h> 00039 #include <kicontheme.h> 00040 00041 class TQMenuBar; 00042 class TQPopupMenu; 00043 class TQComboBox; 00044 class TQPoint; 00045 class TQIconSet; 00046 class TQString; 00047 class KToolBar; 00048 00049 class KAccel; 00050 class KAccelActions; 00051 class KConfig; 00052 class KConfigBase; 00053 class KURL; 00054 class KInstance; 00055 class KToolBar; 00056 class KActionCollection; 00057 class KPopupMenu; 00058 class KMainWindow; 00059 00068 class KDEUI_EXPORT KToggleAction : public KAction 00069 { 00070 Q_OBJECT 00071 TQ_OBJECT 00072 Q_PROPERTY( bool checked READ isChecked WRITE setChecked ) 00073 Q_PROPERTY( TQString exclusiveGroup READ exclusiveGroup WRITE setExclusiveGroup ) 00074 public: 00075 00086 KToggleAction( const TQString& text, const KShortcut& cut = KShortcut(), TQObject* parent = 0, const char* name = 0 ); 00087 00096 KToggleAction( const TQString& text, const KShortcut& cut, 00097 const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 ); 00098 00106 KToggleAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut = KShortcut(), 00107 TQObject* parent = 0, const char* name = 0 ); 00108 00116 KToggleAction( const TQString& text, const TQString& pix, const KShortcut& cut = KShortcut(), 00117 TQObject* parent = 0, const char* name = 0 ); 00118 00128 KToggleAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00129 const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 ); 00130 00140 KToggleAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00141 const TQObject* receiver, const char* slot, 00142 TQObject* parent, const char* name = 0 ); 00143 00148 KToggleAction( TQObject* parent = 0, const char* name = 0 ); 00149 00153 virtual ~KToggleAction(); 00154 00166 virtual int plug( TQWidget* widget, int index = -1 ); 00167 00171 bool isChecked() const; 00172 00177 TQString exclusiveGroup() const; 00178 00185 virtual void setExclusiveGroup( const TQString& name ); 00186 00198 void setCheckedState( const KGuiItem& checkedItem ); 00199 00201 virtual TQString toolTip() const; 00202 00203 public slots: 00207 virtual void setChecked( bool ); 00208 00209 protected slots: 00210 virtual void slotActivated(); 00211 00212 protected: 00213 virtual void updateChecked( int id ); 00214 00215 signals: 00216 void toggled( bool ); 00217 00218 protected: 00219 virtual void virtual_hook( int id, void* data ); 00220 private: 00221 class KToggleActionPrivate; 00222 KToggleActionPrivate *d; 00223 }; 00224 00231 class KDEUI_EXPORT KRadioAction : public KToggleAction 00232 { 00233 Q_OBJECT 00234 TQ_OBJECT 00235 public: 00246 KRadioAction( const TQString& text, const KShortcut& cut = KShortcut(), TQObject* parent = 0, const char* name = 0 ); 00247 00256 KRadioAction( const TQString& text, const KShortcut& cut, 00257 const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 ); 00258 00266 KRadioAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut = KShortcut(), 00267 TQObject* parent = 0, const char* name = 0 ); 00268 00276 KRadioAction( const TQString& text, const TQString& pix, const KShortcut& cut = KShortcut(), 00277 TQObject* parent = 0, const char* name = 0 ); 00278 00288 KRadioAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00289 const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 ); 00290 00300 KRadioAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00301 const TQObject* receiver, const char* slot, 00302 TQObject* parent, const char* name = 0 ); 00303 00308 KRadioAction( TQObject* parent = 0, const char* name = 0 ); 00309 00310 protected: 00311 virtual void slotActivated(); 00312 00313 protected: 00314 virtual void virtual_hook( int id, void* data ); 00315 private: 00316 class KRadioActionPrivate; 00317 KRadioActionPrivate *d; 00318 }; 00319 00331 class KDEUI_EXPORT KSelectAction : public KAction 00332 { 00333 Q_OBJECT 00334 TQ_OBJECT 00335 Q_PROPERTY( int currentItem READ currentItem WRITE setCurrentItem ) 00336 Q_PROPERTY( TQStringList items READ items WRITE setItems ) 00337 Q_PROPERTY( bool editable READ isEditable WRITE setEditable ) 00338 Q_PROPERTY( int comboWidth READ comboWidth WRITE setComboWidth ) 00339 Q_PROPERTY( TQString currentText READ currentText ) 00340 Q_PROPERTY( bool menuAccelsEnabled READ menuAccelsEnabled WRITE setMenuAccelsEnabled ) 00341 public: 00342 00353 KSelectAction( const TQString& text, const KShortcut& cut = KShortcut(), TQObject* parent = 0, const char* name = 0 ); 00354 00363 KSelectAction( const TQString& text, const KShortcut& cut, 00364 const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 ); 00365 00373 KSelectAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut = KShortcut(), 00374 TQObject* parent = 0, const char* name = 0 ); 00375 00383 KSelectAction( const TQString& text, const TQString& pix, const KShortcut& cut = KShortcut(), 00384 TQObject* parent = 0, const char* name = 0 ); 00385 00395 KSelectAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00396 const TQObject* receiver, const char* slot, TQObject* parent, const char* name = 0 ); 00397 00407 KSelectAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00408 const TQObject* receiver, const char* slot, 00409 TQObject* parent, const char* name = 0 ); 00410 00415 KSelectAction( TQObject* parent = 0, const char* name = 0 ); 00416 00420 virtual ~KSelectAction(); 00421 00433 virtual int plug( TQWidget* widget, int index = -1 ); 00434 00439 virtual bool isEditable() const; 00440 00445 virtual TQStringList items() const; 00446 00450 virtual void changeItem( int index, const TQString& text ); 00451 00455 virtual TQString currentText() const; 00456 00461 virtual int currentItem() const; 00462 00467 virtual int comboWidth() const; 00468 00475 void setMaxComboViewCount( int n ); 00476 00480 TQPopupMenu* popupMenu() const; 00481 00486 void setRemoveAmpersandsInCombo( bool b ) KDE_DEPRECATED; 00488 bool removeAmpersandsInCombo() const; 00489 00496 void setMenuAccelsEnabled( bool b ); 00498 bool menuAccelsEnabled() const; 00499 00500 virtual bool isShortcutConfigurable() const { return false; } 00501 00502 public slots: 00508 virtual void setCurrentItem( int index ); 00509 00514 virtual void setItems( const TQStringList &lst ); 00515 00519 virtual void clear(); 00520 00525 virtual void setEditable( bool ); 00526 00532 virtual void setComboWidth( int width ); 00533 00534 protected: 00535 virtual void changeItem( int id, int index, const TQString& text ); 00536 00543 TQStringList comboItems() const; 00544 00545 protected slots: 00546 virtual void slotActivated( int id ); 00547 virtual void slotActivated( const TQString &text ); 00548 virtual void slotActivated(); 00549 00550 signals: 00555 void activated( int index ); 00560 void activated( const TQString& text ); 00561 00562 protected: 00563 virtual void updateCurrentItem( int id ); 00564 00565 virtual void updateComboWidth( int id ); 00566 00567 virtual void updateItems( int id ); 00568 00569 virtual void updateClear( int id ); 00570 00571 protected: 00572 virtual void virtual_hook( int id, void* data ); 00573 private: 00574 void setupMenu() const; 00575 class KSelectActionPrivate; 00576 KSelectActionPrivate *d; 00577 00578 }; 00579 00581 00584 class KDEUI_EXPORT_DEPRECATED KListAction : public KSelectAction 00585 { 00586 Q_OBJECT 00587 TQ_OBJECT 00588 public: 00599 KListAction( const TQString& text, const KShortcut& cut = KShortcut(), TQObject* parent = 0, 00600 const char* name = 0 ); 00601 00610 KListAction( const TQString& text, const KShortcut& cut, const TQObject* receiver, 00611 const char* slot, TQObject* parent, const char* name = 0 ); 00612 00620 KListAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut = KShortcut(), 00621 TQObject* parent = 0, const char* name = 0 ); 00622 00630 KListAction( const TQString& text, const TQString& pix, const KShortcut& cut = KShortcut(), 00631 TQObject* parent = 0, const char* name = 0 ); 00632 00642 KListAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00643 const TQObject* receiver, const char* slot, TQObject* parent, 00644 const char* name = 0 ); 00645 00655 KListAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00656 const TQObject* receiver, const char* slot, TQObject* parent, 00657 const char* name = 0 ); 00658 00663 KListAction( TQObject* parent = 0, const char* name = 0 ); 00664 00668 virtual ~KListAction(); 00669 00670 00671 virtual TQString currentText() const; 00672 virtual int currentItem() const; 00673 00674 00675 public slots: 00681 virtual void setCurrentItem( int index ); 00682 00683 protected: 00684 virtual void virtual_hook( int id, void* data ); 00685 private: 00686 class KListActionPrivate; 00687 KListActionPrivate *d; 00688 }; 00689 00700 class KDEUI_EXPORT KRecentFilesAction : public KListAction // TODO public KSelectAction 00701 { 00702 Q_OBJECT 00703 TQ_OBJECT 00704 Q_PROPERTY( uint maxItems READ maxItems WRITE setMaxItems ) 00705 public: 00713 KRecentFilesAction( const TQString& text, const KShortcut& cut, 00714 TQObject* parent, const char* name = 0, 00715 uint maxItems = 10 ); 00716 00727 KRecentFilesAction( const TQString& text, const KShortcut& cut, 00728 const TQObject* receiver, const char* slot, 00729 TQObject* parent, const char* name = 0, 00730 uint maxItems = 10 ); 00731 00740 KRecentFilesAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00741 TQObject* parent, const char* name = 0, 00742 uint maxItems = 10 ); 00743 00752 KRecentFilesAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00753 TQObject* parent, const char* name = 0, 00754 uint maxItems = 10 ); 00755 00767 KRecentFilesAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00768 const TQObject* receiver, const char* slot, 00769 TQObject* parent, const char* name = 0, 00770 uint maxItems = 10 ); 00771 00783 KRecentFilesAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00784 const TQObject* receiver, const char* slot, 00785 TQObject* parent, const char* name = 0, 00786 uint maxItems = 10 ); 00787 00793 KRecentFilesAction( TQObject* parent = 0, const char* name = 0, 00794 uint maxItems = 10 ); 00795 00799 virtual ~KRecentFilesAction(); 00800 00801 virtual int plug( TQWidget *widget, int index = -1 ); 00802 00806 uint maxItems() const; 00807 00808 //KDE4: remove completeItems() and rename items() to urls(), to get the list of URLs added to 00809 // the action. 00816 virtual TQStringList items() const; 00817 00823 TQStringList completeItems() const; 00824 00825 public slots: 00834 void setMaxItems( uint maxItems ); 00835 00843 void loadEntries( KConfig* config, TQString groupname=TQString::null ); 00844 00852 void saveEntries( KConfig* config, TQString groupname=TQString::null ); 00853 00859 void addURL( const KURL& url ); 00860 00868 void addURL( const KURL& url, const TQString& name ); //KDE4: Combine the above two methods 00869 00875 void removeURL( const KURL& url ); 00876 00880 void clearURLList(); 00881 00882 signals: 00883 00889 void urlSelected( const KURL& url ); 00890 00891 protected slots: 00892 void itemSelected( const TQString& string ); 00893 void menuAboutToShow(); 00894 void menuItemActivated( int id ); 00895 void slotClicked(); 00896 virtual void slotActivated(int); 00897 virtual void slotActivated(const TQString& ); 00898 virtual void slotActivated(); 00899 00900 protected: 00901 virtual void virtual_hook( int id, void* data ); 00902 00903 private: 00904 void init(); 00905 00906 class KRecentFilesActionPrivate; 00907 KRecentFilesActionPrivate *d; 00908 }; 00909 00910 class KDEUI_EXPORT KFontAction : public KSelectAction 00911 { 00912 Q_OBJECT 00913 TQ_OBJECT 00914 Q_PROPERTY( TQString font READ font WRITE setFont ) 00915 public: 00916 KFontAction( const TQString& text, const KShortcut& cut = KShortcut(), TQObject* parent = 0, 00917 const char* name = 0 ); 00918 KFontAction( const TQString& text, const KShortcut& cut, 00919 const TQObject* receiver, const char* slot, TQObject* parent, 00920 const char* name = 0 ); 00921 KFontAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut = KShortcut(), 00922 TQObject* parent = 0, const char* name = 0 ); 00923 KFontAction( const TQString& text, const TQString& pix, const KShortcut& cut = KShortcut(), 00924 TQObject* parent = 0, const char* name = 0 ); 00925 KFontAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00926 const TQObject* receiver, const char* slot, TQObject* parent, 00927 const char* name = 0 ); 00928 KFontAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00929 const TQObject* receiver, const char* slot, TQObject* parent, 00930 const char* name = 0 ); 00931 00932 // The ctors with fontListCriteria were added after 3.3-beta1. 00933 // This define is used in koffice. Remove when koffice has a dependency on kdelibs-3.3 or more. 00934 #define KFONTACTION_HAS_CRITERIA_ARG 00935 KFontAction( uint fontListCriteria, const TQString& text, 00936 const KShortcut& cut = KShortcut(), TQObject* parent = 0, 00937 const char* name = 0 ); 00938 KFontAction( uint fontListCriteria, const TQString& text, const TQString& pix, 00939 const KShortcut& cut = KShortcut(), 00940 TQObject* parent = 0, const char* name = 0 ); 00941 00942 KFontAction( TQObject* parent = 0, const char* name = 0 ); 00943 ~KFontAction(); 00944 00945 TQString font() const { 00946 return currentText(); 00947 } 00948 00949 int plug( TQWidget*widget, int index = -1 ); 00950 00951 public slots: 00952 void setFont( const TQString &family ); 00953 00954 protected: 00955 virtual void virtual_hook( int id, void* data ); 00956 private: 00957 class KFontActionPrivate; 00958 KFontActionPrivate *d; 00959 }; 00960 00961 class KDEUI_EXPORT KFontSizeAction : public KSelectAction 00962 { 00963 Q_OBJECT 00964 TQ_OBJECT 00965 Q_PROPERTY( int fontSize READ fontSize WRITE setFontSize ) 00966 public: 00967 KFontSizeAction( const TQString& text, const KShortcut& cut = KShortcut(), TQObject* parent = 0, 00968 const char* name = 0 ); 00969 KFontSizeAction( const TQString& text, const KShortcut& cut, const TQObject* receiver, 00970 const char* slot, TQObject* parent, const char* name = 0 ); 00971 KFontSizeAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut = KShortcut(), 00972 TQObject* parent = 0, const char* name = 0 ); 00973 KFontSizeAction( const TQString& text, const TQString& pix, const KShortcut& cut = KShortcut(), 00974 TQObject* parent = 0, const char* name = 0 ); 00975 KFontSizeAction( const TQString& text, const TQIconSet& pix, const KShortcut& cut, 00976 const TQObject* receiver, const char* slot, 00977 TQObject* parent, const char* name = 0 ); 00978 KFontSizeAction( const TQString& text, const TQString& pix, const KShortcut& cut, 00979 const TQObject* receiver, const char* slot, 00980 TQObject* parent, const char* name = 0 ); 00981 KFontSizeAction( TQObject* parent = 0, const char* name = 0 ); 00982 00983 virtual ~KFontSizeAction(); 00984 00985 virtual int fontSize() const; 00986 00987 public slots: 00988 virtual void setFontSize( int size ); 00989 00990 protected slots: 00991 virtual void slotActivated( int ); 00992 virtual void slotActivated( const TQString& ); 00993 virtual void slotActivated() { KAction::slotActivated(); } 00994 00995 signals: 00996 void fontSizeChanged( int ); 00997 00998 private: 00999 void init(); 01000 01001 01002 protected: 01003 virtual void virtual_hook( int id, void* data ); 01004 private: 01005 class KFontSizeActionPrivate; 01006 KFontSizeActionPrivate *d; 01007 }; 01008 01009 01020 class KDEUI_EXPORT KActionMenu : public KAction 01021 { 01022 Q_OBJECT 01023 TQ_OBJECT 01024 Q_PROPERTY( bool delayed READ delayed WRITE setDelayed ) 01025 Q_PROPERTY( bool stickyMenu READ stickyMenu WRITE setStickyMenu ) 01026 01027 public: 01028 KActionMenu( const TQString& text, TQObject* parent = 0, 01029 const char* name = 0 ); 01030 KActionMenu( const TQString& text, const TQIconSet& icon, 01031 TQObject* parent = 0, const char* name = 0 ); 01032 KActionMenu( const TQString& text, const TQString& icon, 01033 TQObject* parent = 0, const char* name = 0 ); 01034 KActionMenu( TQObject* parent = 0, const char* name = 0 ); 01035 virtual ~KActionMenu(); 01036 01037 virtual void insert( KAction*, int index = -1 ); 01038 virtual void remove( KAction* ); 01039 01040 KPopupMenu* popupMenu() const; 01041 void popup( const TQPoint& global ); 01042 01047 bool delayed() const; 01061 void setDelayed(bool _delayed); 01062 01067 bool stickyMenu() const; 01076 void setStickyMenu(bool sticky); 01077 01078 virtual int plug( TQWidget* widget, int index = -1 ); 01079 01080 protected: 01081 virtual void virtual_hook( int id, void* data ); 01082 private: 01083 class KActionMenuPrivate; 01084 KActionMenuPrivate *d; 01085 }; 01086 01094 class KDEUI_EXPORT KToolBarPopupAction : public KAction 01095 { 01096 Q_OBJECT 01097 TQ_OBJECT 01098 Q_PROPERTY( bool delayed READ delayed WRITE setDelayed ) 01099 Q_PROPERTY( bool stickyMenu READ stickyMenu WRITE setStickyMenu ) 01100 01101 public: 01102 //Not all constructors - because we need an icon, since this action only makes 01103 // sense when being plugged at least in a toolbar. 01114 KToolBarPopupAction( const TQString& text, const TQString& icon, const KShortcut& cut = KShortcut(), 01115 TQObject* parent = 0, const char* name = 0 ); 01116 01132 KToolBarPopupAction( const TQString& text, const TQString& icon, const KShortcut& cut, 01133 const TQObject* receiver, const char* slot, 01134 TQObject* parent = 0, const char* name = 0 ); 01135 01151 KToolBarPopupAction( const KGuiItem& item, const KShortcut& cut, 01152 const TQObject* receiver, const char* slot, 01153 KActionCollection* parent, const char* name ); 01154 01155 virtual ~KToolBarPopupAction(); 01156 01157 virtual int plug( TQWidget *widget, int index = -1 ); 01158 01164 KPopupMenu *popupMenu() const; 01165 01170 bool delayed() const; 01176 void setDelayed(bool delayed); 01181 bool stickyMenu() const; 01191 void setStickyMenu(bool sticky); 01192 01193 private: 01194 KPopupMenu *m_popup; 01195 bool m_delayed:1; 01196 bool m_stickyMenu:1; 01197 protected: 01198 virtual void virtual_hook( int id, void* data ); 01199 private: 01200 class KToolBarPopupActionPrivate; 01201 KToolBarPopupActionPrivate *d; 01202 }; 01203 01217 class KDEUI_EXPORT KToggleToolBarAction : public KToggleAction 01218 { 01219 Q_OBJECT 01220 TQ_OBJECT 01221 public: 01228 KToggleToolBarAction( const char* toolBarName, const TQString& text, 01229 KActionCollection* parent, const char* name ); 01230 KToggleToolBarAction( KToolBar *toolBar, const TQString &text, 01231 KActionCollection *parent, const char *name ); 01232 virtual ~KToggleToolBarAction(); 01233 01234 virtual int plug( TQWidget * widget, int index = -1 ); 01235 01236 KToolBar *toolBar() { return m_toolBar; } 01237 01238 public slots: 01239 virtual void setChecked( bool ); 01240 01241 private: 01242 TQCString m_toolBarName; 01243 TQGuardedPtr<KToolBar> m_toolBar; 01244 protected: 01245 virtual void virtual_hook( int id, void* data ); 01246 private: 01247 class KToggleToolBarActionPrivate; 01248 KToggleToolBarActionPrivate *d; 01249 }; 01250 01264 class KDEUI_EXPORT KToggleFullScreenAction : public KToggleAction 01265 { 01266 Q_OBJECT 01267 TQ_OBJECT 01268 public: 01278 KToggleFullScreenAction( const KShortcut &cut, 01279 const TQObject* receiver, const char* slot, 01280 TQObject* parent, TQWidget* window, 01281 const char* name ); 01282 virtual ~KToggleFullScreenAction(); 01283 01287 void setWindow( TQWidget* window ); 01288 public slots: 01289 virtual void setChecked( bool ); 01290 protected: 01294 virtual bool eventFilter( TQObject* o, TQEvent* e ); 01295 private: 01296 TQWidget* window; 01297 protected: 01298 virtual void virtual_hook( int id, void* data ); 01299 private: 01300 class KToggleFullScreenActionPrivate; 01301 KToggleFullScreenActionPrivate *d; 01302 }; 01303 01304 01309 class KDEUI_EXPORT KWidgetAction : public KAction 01310 { 01311 Q_OBJECT 01312 TQ_OBJECT 01313 public: 01319 KWidgetAction( TQWidget* widget, const TQString& text, 01320 const KShortcut& cut, 01321 const TQObject* receiver, const char* slot, 01322 KActionCollection* parent, const char* name ); 01323 virtual ~KWidgetAction(); 01324 01328 TQWidget* widget() { return m_widget; } 01329 01330 void setAutoSized( bool ); 01331 01336 virtual int plug( TQWidget* widget, int index = -1 ); 01341 virtual void unplug( TQWidget *w ); 01342 protected slots: 01343 void slotToolbarDestroyed(); 01344 private: 01345 TQGuardedPtr<TQWidget> m_widget; 01346 bool m_autoSized; 01347 protected: 01348 virtual void virtual_hook( int id, void* data ); 01349 private: 01350 class KWidgetActionPrivate; 01351 KWidgetActionPrivate *d; 01352 }; 01353 01354 class KDEUI_EXPORT KActionSeparator : public KAction 01355 { 01356 Q_OBJECT 01357 TQ_OBJECT 01358 public: 01359 KActionSeparator( TQObject* parent = 0, const char* name = 0 ); 01360 virtual ~KActionSeparator(); 01361 01362 virtual int plug( TQWidget *widget, int index = -1 ); 01363 01364 protected: 01365 virtual void virtual_hook( int id, void* data ); 01366 private: 01367 class KActionSeparatorPrivate; 01368 KActionSeparatorPrivate *d; 01369 }; 01370 01381 class KDEUI_EXPORT KPasteTextAction: public KAction 01382 { 01383 Q_OBJECT 01384 TQ_OBJECT 01385 public: 01401 KPasteTextAction( const TQString& text, const TQString& icon, const KShortcut& cut, 01402 const TQObject* receiver, const char* slot, 01403 TQObject* parent = 0, const char* name = 0 ); 01404 01405 virtual ~KPasteTextAction(); 01406 01417 void setMixedMode(bool mode); 01418 01419 virtual int plug( TQWidget *widget, int index = -1 ); 01420 01421 protected slots: 01422 void menuAboutToShow(); 01423 void menuItemActivated( int id); 01424 virtual void slotActivated(); 01425 01426 protected: 01427 virtual void virtual_hook( int id, void* data ); 01428 01429 private: 01430 KPopupMenu *m_popup; 01431 bool m_mixedMode; 01432 class KPasteTextActionPrivate; 01433 KPasteTextActionPrivate *d; 01434 }; 01435 01436 #endif