27 #ifndef __tdeactionclasses_h__
28 #define __tdeactionclasses_h__
30 #include <tdeaction.h>
32 #include <tqkeysequence.h>
34 #include <tqvaluelist.h>
35 #include <tqguardedptr.h>
37 #include <tdeshortcut.h>
38 #include <kstdaction.h>
39 #include <kicontheme.h>
50 class TDEAccelActions;
72 TQ_PROPERTY(
bool checked READ isChecked WRITE setChecked )
73 TQ_PROPERTY( TQString exclusiveGroup READ exclusiveGroup WRITE setExclusiveGroup )
97 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
107 TQObject* parent = 0,
const char* name = 0 );
117 TQObject* parent = 0,
const char* name = 0 );
129 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
141 const TQObject* receiver,
const char* slot,
142 TQObject* parent,
const char* name = 0 );
166 virtual int plug( TQWidget* widget,
int index = -1 );
171 bool isChecked()
const;
177 TQString exclusiveGroup()
const;
185 virtual void setExclusiveGroup(
const TQString& name );
198 void setCheckedState(
const KGuiItem& checkedItem );
201 virtual TQString
toolTip()
const;
207 virtual void setChecked(
bool );
210 virtual void slotActivated();
213 virtual void updateChecked(
int id );
216 void toggled(
bool );
219 virtual void virtual_hook(
int id,
void* data );
221 class TDEToggleActionPrivate;
222 TDEToggleActionPrivate *d;
257 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
267 TQObject* parent = 0,
const char* name = 0 );
277 TQObject* parent = 0,
const char* name = 0 );
289 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
301 const TQObject* receiver,
const char* slot,
302 TQObject* parent,
const char* name = 0 );
311 virtual void slotActivated();
314 virtual void virtual_hook(
int id,
void* data );
316 class TDERadioActionPrivate;
317 TDERadioActionPrivate *d;
335 TQ_PROPERTY(
int currentItem READ currentItem WRITE setCurrentItem )
336 TQ_PROPERTY( TQStringList items READ items WRITE setItems )
337 TQ_PROPERTY(
bool editable READ isEditable WRITE setEditable )
338 TQ_PROPERTY(
int comboWidth READ comboWidth WRITE setComboWidth )
339 TQ_PROPERTY( TQString currentText READ currentText )
340 TQ_PROPERTY(
bool menuAccelsEnabled READ menuAccelsEnabled WRITE setMenuAccelsEnabled )
364 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
374 TQObject* parent = 0,
const char* name = 0 );
384 TQObject* parent = 0,
const char* name = 0 );
396 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
408 const TQObject* receiver,
const char* slot,
409 TQObject* parent,
const char* name = 0 );
433 virtual int plug( TQWidget* widget,
int index = -1 );
439 virtual bool isEditable()
const;
445 virtual TQStringList items()
const;
450 virtual void changeItem(
int index,
const TQString& text );
455 virtual TQString currentText()
const;
461 virtual int currentItem()
const;
467 virtual int comboWidth()
const;
475 void setMaxComboViewCount(
int n );
480 TQPopupMenu* popupMenu()
const;
486 void setRemoveAmpersandsInCombo(
bool b ) TDE_DEPRECATED;
488 bool removeAmpersandsInCombo()
const;
496 void setMenuAccelsEnabled(
bool b );
498 bool menuAccelsEnabled()
const;
508 virtual void setCurrentItem(
int index );
514 virtual void setItems(
const TQStringList &lst );
519 virtual void clear();
525 virtual void setEditable(
bool );
532 virtual void setComboWidth(
int width );
535 virtual void changeItem(
int id,
int index,
const TQString& text );
543 TQStringList comboItems()
const;
546 virtual void slotActivated(
int id );
547 virtual void slotActivated(
const TQString &text );
548 virtual void slotActivated();
563 virtual void updateCurrentItem(
int id );
565 virtual void updateComboWidth(
int id );
567 virtual void updateItems(
int id );
569 virtual void updateClear(
int id );
572 virtual void virtual_hook(
int id,
void* data );
574 void setupMenu()
const;
575 class TDESelectActionPrivate;
576 TDESelectActionPrivate *d;
600 const char* name = 0 );
611 const char* slot, TQObject* parent,
const char* name = 0 );
621 TQObject* parent = 0,
const char* name = 0 );
631 TQObject* parent = 0,
const char* name = 0 );
643 const TQObject* receiver,
const char* slot, TQObject* parent,
644 const char* name = 0 );
656 const TQObject* receiver,
const char* slot, TQObject* parent,
657 const char* name = 0 );
684 virtual void virtual_hook(
int id,
void* data );
686 class TDEListActionPrivate;
687 TDEListActionPrivate *d;
704 TQ_PROPERTY( uint maxItems READ maxItems WRITE setMaxItems )
714 TQObject* parent,
const char* name = 0,
715 uint maxItems = 10 );
728 const TQObject* receiver,
const char* slot,
729 TQObject* parent,
const char* name = 0,
730 uint maxItems = 10 );
741 TQObject* parent,
const char* name = 0,
742 uint maxItems = 10 );
753 TQObject* parent,
const char* name = 0,
754 uint maxItems = 10 );
768 const TQObject* receiver,
const char* slot,
769 TQObject* parent,
const char* name = 0,
770 uint maxItems = 10 );
784 const TQObject* receiver,
const char* slot,
785 TQObject* parent,
const char* name = 0,
786 uint maxItems = 10 );
794 uint maxItems = 10 );
801 virtual int plug( TQWidget *widget,
int index = -1 );
806 uint maxItems()
const;
816 virtual TQStringList items()
const;
823 TQStringList completeItems()
const;
834 void setMaxItems( uint maxItems );
843 void loadEntries(
TDEConfig* config, TQString groupname=TQString::null );
852 void saveEntries(
TDEConfig* config, TQString groupname=TQString::null );
859 void addURL(
const KURL& url );
868 void addURL(
const KURL& url,
const TQString& name );
875 void removeURL(
const KURL& url );
892 void itemSelected(
const TQString&
string );
893 void menuAboutToShow();
894 void menuItemActivated(
int id );
896 virtual void slotActivated(
int);
897 virtual void slotActivated(
const TQString& );
898 virtual void slotActivated();
901 virtual void virtual_hook(
int id,
void* data );
906 class TDERecentFilesActionPrivate;
907 TDERecentFilesActionPrivate *d;
914 TQ_PROPERTY( TQString font READ font WRITE setFont )
917 const char* name = 0 );
918 TDEFontAction(
const TQString& text,
const TDEShortcut& cut,
919 const TQObject* receiver,
const char* slot, TQObject* parent,
920 const char* name = 0 );
922 TQObject* parent = 0,
const char* name = 0 );
924 TQObject* parent = 0,
const char* name = 0 );
925 TDEFontAction(
const TQString& text,
const TQIconSet& pix,
const TDEShortcut& cut,
926 const TQObject* receiver,
const char* slot, TQObject* parent,
927 const char* name = 0 );
928 TDEFontAction(
const TQString& text,
const TQString& pix,
const TDEShortcut& cut,
929 const TQObject* receiver,
const char* slot, TQObject* parent,
930 const char* name = 0 );
934 #define KFONTACTION_HAS_CRITERIA_ARG
935 TDEFontAction( uint fontListCriteria,
const TQString& text,
937 const char* name = 0 );
938 TDEFontAction( uint fontListCriteria,
const TQString& text,
const TQString& pix,
940 TQObject* parent = 0,
const char* name = 0 );
942 TDEFontAction( TQObject* parent = 0,
const char* name = 0 );
945 TQString font()
const {
946 return currentText();
949 int plug( TQWidget*widget,
int index = -1 );
952 void setFont(
const TQString &family );
955 virtual void virtual_hook(
int id,
void* data );
957 class TDEFontActionPrivate;
958 TDEFontActionPrivate *d;
965 TQ_PROPERTY(
int fontSize READ fontSize WRITE setFontSize )
968 const char* name = 0 );
969 TDEFontSizeAction(
const TQString& text,
const TDEShortcut& cut,
const TQObject* receiver,
970 const char* slot, TQObject* parent,
const char* name = 0 );
972 TQObject* parent = 0,
const char* name = 0 );
974 TQObject* parent = 0,
const char* name = 0 );
975 TDEFontSizeAction(
const TQString& text,
const TQIconSet& pix,
const TDEShortcut& cut,
976 const TQObject* receiver,
const char* slot,
977 TQObject* parent,
const char* name = 0 );
978 TDEFontSizeAction(
const TQString& text,
const TQString& pix,
const TDEShortcut& cut,
979 const TQObject* receiver,
const char* slot,
980 TQObject* parent,
const char* name = 0 );
981 TDEFontSizeAction( TQObject* parent = 0,
const char* name = 0 );
983 virtual ~TDEFontSizeAction();
985 virtual int fontSize()
const;
988 virtual void setFontSize(
int size );
991 virtual void slotActivated(
int );
992 virtual void slotActivated(
const TQString& );
993 virtual void slotActivated() { TDEAction::slotActivated(); }
996 void fontSizeChanged(
int );
1003 virtual void virtual_hook(
int id,
void* data );
1005 class TDEFontSizeActionPrivate;
1006 TDEFontSizeActionPrivate *d;
1024 TQ_PROPERTY(
bool delayed READ delayed WRITE setDelayed )
1025 TQ_PROPERTY(
bool stickyMenu READ stickyMenu WRITE setStickyMenu )
1029 const char* name = 0 );
1031 TQObject* parent = 0,
const char* name = 0 );
1033 TQObject* parent = 0,
const char* name = 0 );
1034 TDEActionMenu( TQObject* parent = 0,
const char* name = 0 );
1037 virtual void insert(
TDEAction*,
int index = -1 );
1041 void popup(
const TQPoint& global );
1047 bool delayed()
const;
1061 void setDelayed(
bool _delayed);
1067 bool stickyMenu()
const;
1076 void setStickyMenu(
bool sticky);
1078 virtual int plug( TQWidget* widget,
int index = -1 );
1081 virtual void virtual_hook(
int id,
void* data );
1083 class TDEActionMenuPrivate;
1084 TDEActionMenuPrivate *d;
1098 TQ_PROPERTY(
bool delayed READ delayed WRITE setDelayed )
1099 TQ_PROPERTY(
bool stickyMenu READ stickyMenu WRITE setStickyMenu )
1115 TQObject* parent = 0,
const char* name = 0 );
1133 const TQObject* receiver,
const char* slot,
1134 TQObject* parent = 0,
const char* name = 0 );
1152 const TQObject* receiver,
const char* slot,
1157 virtual int plug( TQWidget *widget,
int index = -1 );
1170 bool delayed()
const;
1176 void setDelayed(
bool delayed);
1181 bool stickyMenu()
const;
1191 void setStickyMenu(
bool sticky);
1196 bool m_stickyMenu:1;
1198 virtual void virtual_hook(
int id,
void* data );
1200 class TDEToolBarPopupActionPrivate;
1201 TDEToolBarPopupActionPrivate *d;
1234 virtual int plug( TQWidget * widget,
int index = -1 );
1239 virtual void setChecked(
bool );
1242 TQCString m_toolBarName;
1243 TQGuardedPtr<TDEToolBar> m_toolBar;
1245 virtual void virtual_hook(
int id,
void* data );
1247 class TDEToggleToolBarActionPrivate;
1248 TDEToggleToolBarActionPrivate *d;
1279 const TQObject* receiver,
const char* slot,
1280 TQObject* parent, TQWidget* window,
1287 void setWindow( TQWidget* window );
1289 virtual void setChecked(
bool );
1294 virtual bool eventFilter( TQObject* o, TQEvent* e );
1298 virtual void virtual_hook(
int id,
void* data );
1300 class TDEToggleFullScreenActionPrivate;
1301 TDEToggleFullScreenActionPrivate *d;
1321 const TQObject* receiver,
const char* slot,
1330 void setAutoSized(
bool );
1336 virtual int plug( TQWidget* widget,
int index = -1 );
1341 virtual void unplug( TQWidget *w );
1343 void slotToolbarDestroyed();
1345 TQGuardedPtr<TQWidget> m_widget;
1348 virtual void virtual_hook(
int id,
void* data );
1350 class KWidgetActionPrivate;
1351 KWidgetActionPrivate *d;
1354 class TDEUI_EXPORT TDEActionSeparator :
public TDEAction
1359 TDEActionSeparator( TQObject* parent = 0,
const char* name = 0 );
1360 virtual ~TDEActionSeparator();
1362 virtual int plug( TQWidget *widget,
int index = -1 );
1365 virtual void virtual_hook(
int id,
void* data );
1367 class TDEActionSeparatorPrivate;
1368 TDEActionSeparatorPrivate *d;
1402 const TQObject* receiver,
const char* slot,
1403 TQObject* parent = 0,
const char* name = 0 );
1417 void setMixedMode(
bool mode);
1419 virtual int plug( TQWidget *widget,
int index = -1 );
1422 void menuAboutToShow();
1423 void menuItemActivated(
int id);
1424 virtual void slotActivated();
1427 virtual void virtual_hook(
int id,
void* data );
1432 class TDEPasteTextActionPrivate;
1433 TDEPasteTextActionPrivate *d;
An abstract class for GUI data such as ToolTip and Icon.
A managed set of TDEAction objects.
Class to encapsulate user-driven action or event.
virtual void unplug(TQWidget *w)
"Unplug" or remove this action from a given widget.
virtual TQString toolTip() const
Get the tooltip text for the action.
virtual int plug(TQWidget *widget, int index=-1)
"Plug" or insert this action into a given widget.
Remove this class in KDE-4.0. It doesn't add anything to TDESelectAction.
KDE top level main window
An action for pasting text from the clipboard.
void urlSelected(const KURL &url)
This signal gets emited when the user selects an URL.
Action for selecting one of several items.
virtual TQString currentText() const
Returns the text of the currently selected item.
virtual bool isShortcutConfigurable() const
Returns true if this action's shortcut is configurable.
virtual void setCurrentItem(int index)
Sets the currently checked item.
void activated(const TQString &text)
This signal is emitted when an item is selected;.
virtual int currentItem() const
Returns the index of the current item.
void activated(int index)
This signal is emitted when an item is selected;.
An action for switching between to/from full screen mode.