26 #ifndef __tdeaction_h__
27 #define __tdeaction_h__
29 #include <tqkeysequence.h>
31 #include <tqvaluelist.h>
32 #include <tqguardedptr.h>
34 #include <tdeshortcut.h>
35 #include <kstdaction.h>
36 #include <kicontheme.h>
47 class TDEAccelActions;
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 )
237 const TQObject* receiver,
const char* slot,
260 const TQObject* receiver,
const char* slot,
284 const TQObject* receiver,
const char* slot,
299 const TQObject* receiver,
const char* slot,
310 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
315 TQObject* parent = 0,
const char* name = 0 );
320 TQObject* parent = 0,
const char* name = 0 );
325 const TQObject* receiver,
const char* slot, TQObject* parent,
const char* name = 0 );
330 const TQObject* receiver,
const char* slot, TQObject* parent,
331 const char* name = 0 );
335 TDEAction( TQObject* parent = 0,
const char* name = 0 );
355 virtual int plug( TQWidget *widget,
int index = -1 );
367 virtual void plugAccel(
TDEAccel *
accel,
bool configurable =
true) TDE_DEPRECATED;
381 virtual void unplug( TQWidget *w );
387 virtual void unplugAccel() TDE_DEPRECATED;
393 virtual bool isPlugged()
const;
398 bool isPlugged(
const TQWidget *container )
const;
404 virtual bool isPlugged(
const TQWidget *container,
int id )
const;
410 virtual bool isPlugged(
const TQWidget *container,
const TQWidget *_representative )
const;
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;
419 virtual bool hasIcon()
const;
420 #ifndef KDE_NO_COMPAT
421 bool hasIconSet()
const {
return hasIcon(); }
423 virtual TQString plainText()
const;
428 virtual TQString text()
const;
437 virtual const TDEShortcut& shortcutDefault()
const;
440 TQString shortcutText()
const;
441 void setShortcutText(
const TQString& );
446 virtual bool isEnabled()
const;
451 virtual bool isShortcutConfigurable()
const;
453 virtual TQString group()
const;
458 virtual TQString whatsThis()
const;
463 virtual TQString toolTip()
const;
472 virtual TQIconSet iconSet(
TDEIcon::Group group,
int size=0 )
const;
478 virtual TQString icon()
const;
486 static int getToolButtonID();
494 enum ActivationReason { UnknownActivation, EmulatedActivation, AccelActivation, PopupMenuActivation, ToolBarActivation };
501 virtual void setText(
const TQString &text);
508 virtual void setGroup(
const TQString& );
517 virtual void setWhatsThis(
const TQString& text );
533 virtual void setToolTip(
const TQString& );
539 virtual void setIconSet(
const TQIconSet &iconSet );
541 virtual void setIcon(
const TQString& icon );
547 virtual void setEnabled(
bool enable);
558 virtual void setShortcutConfigurable(
bool );
564 virtual void activate();
567 virtual void slotDestroyed();
568 virtual void slotKeycodeChanged();
569 virtual void slotActivated();
571 void slotPopupActivated();
573 void slotButtonClicked(
int, TQt::ButtonState state );
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 );
583 void addContainer( TQWidget* parent,
int id );
584 void addContainer( TQWidget* parent, TQWidget* representative );
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 );
597 TQString whatsThisWithIcon()
const;
624 void enabled(
bool );
627 void initPrivate(
const TQString& text,
const TDEShortcut& cut,
628 const TQObject* receiver,
const char* slot );
637 #ifndef KDE_NO_COMPAT
643 int accel() const TDE_DEPRECATED;
645 TQString statusText()
const
646 {
return toolTip(); }
652 void setAccel(
int key ) TDE_DEPRECATED;
658 { setToolTip( text ); }
663 int menuId(
int i ) {
return itemId( i ); }
667 virtual void virtual_hook(
int id,
void* data );
669 class TDEActionPrivate;
670 TDEActionPrivate*
const d;
673 #include <tdeactioncollection.h>
674 #include <tdeactionclasses.h>
An abstract class for GUI data such as ToolTip and Icon.
A managed set of TDEAction objects.
virtual TDEAccel * accel() TDE_DEPRECATED
Returns the number of widgets which this collection is associated with.
TDEAccel * tdeaccel()
Returns the TDEAccel object of the most recently set widget.
Class to encapsulate user-driven action or event.
TQIconSet iconSet() const
Remove in KDE4.
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...
void setStatusText(const TQString &text)
void setDisabled(bool disable)
Calls setEnabled( !disable ).
void activated()
Emitted when this action is activated.
KDE top level main window