#include <tdeactioncollection.h>
Inherits TQObject.
Public Slots | |
void | clear () |
Signals | |
void | inserted (TDEAction *) |
void | removed (TDEAction *) |
void | actionHighlighted (TDEAction *action) |
void | actionHighlighted (TDEAction *action, bool highlight) |
void | actionStatusText (const TQString &text) |
void | clearStatusText () |
Public Member Functions | |
TDEActionCollection (TQWidget *parent, const char *name=0, TDEInstance *instance=0) | |
TDEActionCollection (TQWidget *watch, TQObject *parent, const char *name=0, TDEInstance *instance=0) | |
TDEActionCollection (const TDEActionCollection ©) | |
virtual void | setWidget (TQWidget *widget) |
void | setAutoConnectShortcuts (bool) |
bool | isAutoConnectShortcuts () |
bool | addDocCollection (TDEActionCollection *pDoc) |
virtual TDEAccel * | accel () TDE_DEPRECATED |
virtual const TDEAccel * | accel () const TDE_DEPRECATED |
TDEAccel * | tdeaccel () |
const TDEAccel * | tdeaccel () const |
TDEAccel * | builderTDEAccel () const |
virtual uint | count () const |
bool | isEmpty () const |
virtual TDEAction * | action (int index) const |
virtual TDEAction * | action (const char *name, const char *classname=0) const |
virtual TQStringList | groups () const |
virtual TDEActionPtrList | actions (const TQString &group) const |
virtual TDEActionPtrList | actions () const |
bool | readShortcutSettings (const TQString &sConfigGroup=TQString::null, TDEConfigBase *pConfig=0) |
bool | writeShortcutSettings (const TQString &sConfigGroup=TQString::null, TDEConfigBase *pConfig=0) const |
void | setInstance (TDEInstance *instance) |
TDEInstance * | instance () const |
void | setXMLFile (const TQString &) |
const TQString & | xmlFile () const |
void | setHighlightingEnabled (bool enable) |
bool | highlightingEnabled () const |
void | connectHighlight (TQWidget *container, TDEAction *action) |
void | disconnectHighlight (TQWidget *container, TDEAction *action) |
const KXMLGUIClient * | parentGUIClient () const |
TDEActionCollection (TQObject *parent, const char *name=0, TDEInstance *instance=0) | |
void | insert (TDEAction *action) |
void | remove (TDEAction *action) |
TDEAction * | take (TDEAction *action) |
TDEActionCollection | operator+ (const TDEActionCollection &) const |
TDEActionCollection & | operator= (const TDEActionCollection &) |
TDEActionCollection & | operator+= (const TDEActionCollection &) |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Friends | |
class | TDEAction |
class | KXMLGUIClient |
Detailed Description
A managed set of TDEAction objects.
If you set the tooltips on TDEActions and want the tooltip to show in statusbar (recommended) then you will need to connect a couple of the actionclass signals to the toolbar. The easiest way of doing this is in your TDEMainWindow subclass, where you create a statusbar, do:
Definition at line 78 of file tdeactioncollection.h.
Constructor & Destructor Documentation
◆ TDEActionCollection()
TDEActionCollection::TDEActionCollection | ( | TQWidget * | watch, |
TQObject * | parent, | ||
const char * | name = 0 , |
||
TDEInstance * | instance = 0 |
||
) |
Use this constructor if you want the collection's actions to restrict their accelerator keys to watch
rather than the parent
.
If you don't require shortcuts, you can pass a null to the watch
parameter.
Definition at line 92 of file tdeactioncollection.cpp.
Member Function Documentation
◆ accel() [1/2]
|
virtual |
- Deprecated:
- Deprecated because of ambiguous name.
Use tdeaccel()
Definition at line 370 of file tdeactioncollection.cpp.
◆ accel() [2/2]
|
virtual |
Returns the number of widgets which this collection is associated with.
Returns true if the collection has its own TDEAccel object. This will be the case if it was constructed with a valid widget ptr or if setWidget() was called.
- Deprecated:
- Deprecated because of ambiguous name.
Use tdeaccel()
Definition at line 369 of file tdeactioncollection.cpp.
◆ action() [1/2]
|
virtual |
Find an action (optionally, of a given subclass of TDEAction) in the action collection.
- Returns
- A pointer to the first TDEAction in the collection which matches the parameters or null if nothing matches.
Definition at line 373 of file tdeactioncollection.cpp.
◆ action() [2/2]
|
virtual |
Return the TDEAction* at position "index" in the action collection.
- See also
- count()
Definition at line 400 of file tdeactioncollection.cpp.
◆ actionHighlighted [1/2]
|
signal |
Emitted when action
is highlighted.
This is only emitted if you have setHighlightingEnabled()
◆ actionHighlighted [2/2]
|
signal |
Emitted when action
is highlighed or loses highlighting.
This is only emitted if you have setHighlightingEnabled()
◆ actions() [1/2]
|
virtual |
Returns the list of actions managed by this action collection.
Definition at line 449 of file tdeactioncollection.cpp.
◆ actions() [2/2]
|
virtual |
Returns the list of actions in a particular group managed by this action collection.
- Parameters
-
group The name of the group.
Definition at line 435 of file tdeactioncollection.cpp.
◆ actionStatusText
|
signal |
Emitted when an action is highlighted, with text being the tooltip for the action.
This is only emitted if you have setHighlightingEnabled()
This is useful to connect to KStatusBar::message(). See this class overview for more information.
- See also
- setHighlightingEnabled()
◆ addDocCollection()
bool TDEActionCollection::addDocCollection | ( | TDEActionCollection * | pDoc | ) |
This sets the default shortcut scope for new actions created in this collection.
The default is ScopeUnspecified. Ideally the default would have been ScopeWidget, but that would cause some backwards compatibility problems. Doc/View model. This lets you add the action collection of a document to a view's action collection.
Definition at line 177 of file tdeactioncollection.cpp.
◆ builderTDEAccel()
TDEAccel * TDEActionCollection::builderTDEAccel | ( | ) | const |
, for TDEAction::tdeaccelCurrent()
Definition at line 371 of file tdeactioncollection.cpp.
◆ clear
|
slot |
Clears the entire actionCollection, deleting all actions.
- See also
- remove
Definition at line 368 of file tdeactioncollection.cpp.
◆ clearStatusText
|
signal |
Emitted when an action loses highlighting.
This is only emitted if you have setHighlightingEnabled()
- See also
- setHighlightingEnabled()
◆ connectHighlight()
void TDEActionCollection::connectHighlight | ( | TQWidget * | container, |
TDEAction * | action | ||
) |
Call this function if you want to receive a signal whenever a TDEAction is highlighted in a menu or a toolbar.
This is only needed if you do not add this action to this container. You will generally not need to call this function.
- Parameters
-
container A container in which the TDEAction is plugged (must inherit TQPopupMenu or TDEToolBar) action The action you are interested in
- See also
- disconnectHighlight()
- actionHighlighted()
- setHighlightingEnabled()
- highlightingEnabled()
- actionHighlighted()
Definition at line 493 of file tdeactioncollection.cpp.
◆ count()
|
virtual |
Returns the TDEAccel object associated with widget #.
Returns the number of actions in the collection
Definition at line 418 of file tdeactioncollection.cpp.
◆ disconnectHighlight()
void TDEActionCollection::disconnectHighlight | ( | TQWidget * | container, |
TDEAction * | action | ||
) |
Disconnect highlight notifications for a particular pair of contianer and action.
This is only needed if you do not add this action to this container. You will generally not need to call this function.
- Parameters
-
container A container in which the TDEAction is plugged (must inherit TQPopupMenu or TDEToolBar) action The action you are interested in
- See also
- connectHighlight()
- actionHighlighted()
- setHighlightingEnabled()
- highlightingEnabled()
- actionHighlighted()
Definition at line 526 of file tdeactioncollection.cpp.
◆ groups()
|
virtual |
Returns a list of all the groups of all the TDEActions in this action collection.
- See also
- TDEAction::group()
- TDEAction::setGroup()
Definition at line 423 of file tdeactioncollection.cpp.
◆ highlightingEnabled()
bool TDEActionCollection::highlightingEnabled | ( | ) | const |
Return whether highlighting notifications are enabled.
- See also
- connectHighlight()
- disconnectHighlight()
- actionHighlighted()
- setHighlightingEnabled()
- actionHighlighted()
Definition at line 488 of file tdeactioncollection.cpp.
◆ insert()
void TDEActionCollection::insert | ( | TDEAction * | action | ) |
Add an action to the collection.
Generally you don't have to call this. The action inserts itself automatically into its parent collection. This can be useful however for a short-lived collection (e.g. for a popupmenu, where the signals from the collection are needed too). (don't forget that in the simple case, a list of actions should be a simple TDEActionPtrList). If you manually insert actions into a 2nd collection, don't forget to take them out again before destroying the collection.
- Parameters
-
action The TDEAction to add.
Definition at line 365 of file tdeactioncollection.cpp.
◆ instance()
TDEInstance * TDEActionCollection::instance | ( | ) | const |
The instance with which this class is associated.
Definition at line 468 of file tdeactioncollection.cpp.
◆ isAutoConnectShortcuts()
bool TDEActionCollection::isAutoConnectShortcuts | ( | ) |
This indicates whether new actions which are created in this collection have their keyboard shortcuts automatically connected on construction.
- See also
- setAutoConnectShortcuts()
Definition at line 172 of file tdeactioncollection.cpp.
◆ parentGUIClient()
const KXMLGUIClient * TDEActionCollection::parentGUIClient | ( | ) | const |
The parent KXMLGUIClient, return 0L if not available.
Definition at line 627 of file tdeactioncollection.cpp.
◆ readShortcutSettings()
bool TDEActionCollection::readShortcutSettings | ( | const TQString & | sConfigGroup = TQString::null , |
TDEConfigBase * | pConfig = 0 |
||
) |
Used for reading shortcut configuration from a non-XML rc file.
Definition at line 408 of file tdeactioncollection.cpp.
◆ remove()
void TDEActionCollection::remove | ( | TDEAction * | action | ) |
Removes an action from the collection and deletes it.
Since the TDEAction destructor removes the action from the collection, you generally don't have to call this.
- Parameters
-
action The TDEAction to remove.
Definition at line 366 of file tdeactioncollection.cpp.
◆ setAutoConnectShortcuts()
void TDEActionCollection::setAutoConnectShortcuts | ( | bool | b | ) |
This indicates whether new actions which are created in this collection should have their keyboard shortcuts automatically connected on construction.
Set to 'false' if you will be loading XML-based settings. This is automatically done by KParts. The default is 'true'.
- See also
- isAutoConnectShortcuts()
Definition at line 167 of file tdeactioncollection.cpp.
◆ setHighlightingEnabled()
void TDEActionCollection::setHighlightingEnabled | ( | bool | enable | ) |
Enable highlighting notification for specific TDEActions.
This is false by default, so, by default, the highlighting signals will not be emitted.
- See also
- connectHighlight()
- disconnectHighlight()
- actionHighlighted()
- actionHighlighted()
- highlightingEnabled()
Definition at line 483 of file tdeactioncollection.cpp.
◆ setWidget()
|
virtual |
This sets the widget to which the keyboard shortcuts should be attached.
You only need to call this if a null pointer was passed in the constructor.
Definition at line 152 of file tdeactioncollection.cpp.
◆ setXMLFile()
void TDEActionCollection::setXMLFile | ( | const TQString & | sXMLFile | ) |
Definition at line 473 of file tdeactioncollection.cpp.
◆ take()
Removes an action from the collection.
Since the TDEAction destructor removes the action from the collection, you generally don't have to call this.
- Returns
- NULL if not found else returns action.
- Parameters
-
action the TDEAction to remove.
Definition at line 367 of file tdeactioncollection.cpp.
◆ tdeaccel() [1/2]
TDEAccel * TDEActionCollection::tdeaccel | ( | ) |
Returns the TDEAccel object of the most recently set widget.
Definition at line 282 of file tdeactioncollection.cpp.
◆ tdeaccel() [2/2]
const TDEAccel * TDEActionCollection::tdeaccel | ( | ) | const |
Returns the TDEAccel object of the most recently set widget.
Const version for convenience.
Definition at line 291 of file tdeactioncollection.cpp.
◆ writeShortcutSettings()
bool TDEActionCollection::writeShortcutSettings | ( | const TQString & | sConfigGroup = TQString::null , |
TDEConfigBase * | pConfig = 0 |
||
) | const |
Used for writing shortcut configuration to a non-XML rc file.
Definition at line 413 of file tdeactioncollection.cpp.
◆ xmlFile()
const TQString & TDEActionCollection::xmlFile | ( | ) | const |
Definition at line 478 of file tdeactioncollection.cpp.
The documentation for this class was generated from the following files: