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

tdeui

Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
TDEActionCollection Class Reference

#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 &copy)
 
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:

actionCollection()->setHighlightingEnabled(true);
connect(actionCollection(), TQ_SIGNAL( actionStatusText( const TQString & ) ),
statusBar(), TQ_SLOT( message( const TQString & ) ) );
connect(actionCollection(), TQ_SIGNAL( clearStatusText() ),
statusBar(), TQ_SLOT( clear() ) );
TDEActionCollection::clearStatusText
void clearStatusText()
Emitted when an action loses highlighting.
TDEActionCollection::clear
void clear()
Clears the entire actionCollection, deleting all actions.
Definition: tdeactioncollection.cpp:368
TDEActionCollection::actionStatusText
void actionStatusText(const TQString &text)
Emitted when an action is highlighted, with text being the tooltip for the action.

Definition at line 78 of file tdeactioncollection.h.

Constructor & Destructor Documentation

◆ TDEActionCollection() [1/4]

TDEActionCollection::TDEActionCollection ( TQWidget *  parent,
const char *  name = 0,
TDEInstance *  instance = 0 
)

Definition at line 79 of file tdeactioncollection.cpp.

◆ TDEActionCollection() [2/4]

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.

◆ TDEActionCollection() [3/4]

TDEActionCollection::TDEActionCollection ( const TDEActionCollection &  copy)

Definition at line 120 of file tdeactioncollection.cpp.

◆ ~TDEActionCollection()

TDEActionCollection::~TDEActionCollection ( )
virtual

Definition at line 138 of file tdeactioncollection.cpp.

◆ TDEActionCollection() [4/4]

TDEActionCollection::TDEActionCollection ( TQObject *  parent,
const char *  name = 0,
TDEInstance *  instance = 0 
)

Definition at line 106 of file tdeactioncollection.cpp.

Member Function Documentation

◆ accel() [1/2]

const TDEAccel * TDEActionCollection::accel ( ) const
virtual
Deprecated:
Deprecated because of ambiguous name. Use tdeaccel()

Definition at line 370 of file tdeactioncollection.cpp.

◆ accel() [2/2]

TDEAccel * TDEActionCollection::accel ( )
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]

TDEAction * TDEActionCollection::action ( const char *  name,
const char *  classname = 0 
) const
virtual

Find an action (optionally, of a given subclass of TDEAction) in the action collection.

Parameters
nameName of the TDEAction.
classnameName of the TDEAction subclass.
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]

TDEAction * TDEActionCollection::action ( int  index) const
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]

void TDEActionCollection::actionHighlighted ( TDEAction *  action)
signal

Emitted when action is highlighted.

This is only emitted if you have setHighlightingEnabled()

See also
connectHighlight()
disconnectHighlight()
actionHighlighted()
setHighlightingEnabled()
highlightingEnabled()

◆ actionHighlighted [2/2]

void TDEActionCollection::actionHighlighted ( TDEAction *  action,
bool  highlight 
)
signal

Emitted when action is highlighed or loses highlighting.

This is only emitted if you have setHighlightingEnabled()

See also
connectHighlight()
disconnectHighlight()
actionHighlighted()
setHighlightingEnabled()
highlightingEnabled()

◆ actions() [1/2]

TDEActionPtrList TDEActionCollection::actions ( ) const
virtual

Returns the list of actions managed by this action collection.

Definition at line 449 of file tdeactioncollection.cpp.

◆ actions() [2/2]

TDEActionPtrList TDEActionCollection::actions ( const TQString &  group) const
virtual

Returns the list of actions in a particular group managed by this action collection.

Parameters
groupThe name of the group.

Definition at line 435 of file tdeactioncollection.cpp.

◆ actionStatusText

void TDEActionCollection::actionStatusText ( const TQString &  text)
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

void TDEActionCollection::clear ( )
slot

Clears the entire actionCollection, deleting all actions.

See also
remove

Definition at line 368 of file tdeactioncollection.cpp.

◆ clearStatusText

void TDEActionCollection::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
containerA container in which the TDEAction is plugged (must inherit TQPopupMenu or TDEToolBar)
actionThe action you are interested in
See also
disconnectHighlight()
actionHighlighted()
setHighlightingEnabled()
highlightingEnabled()
actionHighlighted()

Definition at line 493 of file tdeactioncollection.cpp.

◆ count()

uint TDEActionCollection::count ( ) const
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
containerA container in which the TDEAction is plugged (must inherit TQPopupMenu or TDEToolBar)
actionThe action you are interested in
See also
connectHighlight()
actionHighlighted()
setHighlightingEnabled()
highlightingEnabled()
actionHighlighted()

Definition at line 526 of file tdeactioncollection.cpp.

◆ groups()

TQStringList TDEActionCollection::groups ( ) const
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
actionThe 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.

◆ isEmpty()

bool TDEActionCollection::isEmpty ( ) const
inline

Definition at line 163 of file tdeactioncollection.h.

◆ operator+()

TDEActionCollection TDEActionCollection::operator+ ( const TDEActionCollection &  c) const

Definition at line 634 of file tdeactioncollection.cpp.

◆ operator+=()

TDEActionCollection & TDEActionCollection::operator+= ( const TDEActionCollection &  c)

Definition at line 662 of file tdeactioncollection.cpp.

◆ operator=()

TDEActionCollection & TDEActionCollection::operator= ( const TDEActionCollection &  copy)

Definition at line 648 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
actionThe 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.

◆ setInstance()

void TDEActionCollection::setInstance ( TDEInstance *  instance)

Definition at line 460 of file tdeactioncollection.cpp.

◆ setWidget()

void TDEActionCollection::setWidget ( TQWidget *  widget)
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)
Deprecated:

Definition at line 473 of file tdeactioncollection.cpp.

◆ take()

TDEAction * TDEActionCollection::take ( TDEAction *  action)

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
actionthe 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.

◆ virtual_hook()

void TDEActionCollection::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 796 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
Deprecated:

Definition at line 478 of file tdeactioncollection.cpp.

Friends And Related Function Documentation

◆ KXMLGUIClient

friend class KXMLGUIClient
friend

Definition at line 81 of file tdeactioncollection.h.

◆ TDEAction

friend class TDEAction
friend

Definition at line 80 of file tdeactioncollection.h.


The documentation for this class was generated from the following files:
  • tdeactioncollection.h
  • tdeactioncollection.cpp

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