.TH "KActionCollection" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KActionCollection \- A managed set of \fBKAction\fP objects.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kactioncollection.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBclear\fP ()"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBinserted\fP (\fBKAction\fP *)"
.br
.ti -1c
.RI "void \fBremoved\fP (\fBKAction\fP *)"
.br
.ti -1c
.RI "void \fBactionHighlighted\fP (\fBKAction\fP *action)"
.br
.ti -1c
.RI "void \fBactionHighlighted\fP (\fBKAction\fP *action, bool highlight)"
.br
.ti -1c
.RI "void \fBactionStatusText\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "void \fBclearStatusText\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKActionCollection\fP (\fBQWidget\fP *\fBparent\fP, const char *\fBname\fP=0, \fBKInstance\fP *instance=0)"
.br
.ti -1c
.RI "\fBKActionCollection\fP (\fBQWidget\fP *watch, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, \fBKInstance\fP *instance=0)"
.br
.ti -1c
.RI "\fBKActionCollection\fP (const \fBKActionCollection\fP &copy)"
.br
.ti -1c
.RI "virtual void \fBsetWidget\fP (\fBQWidget\fP *widget)"
.br
.ti -1c
.RI "void \fBsetAutoConnectShortcuts\fP (bool)"
.br
.ti -1c
.RI "bool \fBisAutoConnectShortcuts\fP ()"
.br
.ti -1c
.RI "bool \fBaddDocCollection\fP (\fBKActionCollection\fP *pDoc)"
.br
.ti -1c
.RI "virtual \fBKAccel\fP * \fBaccel\fP () KDE_DEPRECATED"
.br
.ti -1c
.RI "virtual const \fBKAccel\fP * \fBaccel\fP () const KDE_DEPRECATED"
.br
.ti -1c
.RI "\fBKAccel\fP * \fBkaccel\fP ()"
.br
.ti -1c
.RI "const \fBKAccel\fP * \fBkaccel\fP () const "
.br
.ti -1c
.RI "\fBKAccel\fP * \fBbuilderKAccel\fP () const "
.br
.ti -1c
.RI "virtual uint \fBcount\fP () const "
.br
.ti -1c
.RI "bool \fBisEmpty\fP () const "
.br
.ti -1c
.RI "virtual \fBKAction\fP * \fBaction\fP (int index) const "
.br
.ti -1c
.RI "virtual \fBKAction\fP * \fBaction\fP (const char *\fBname\fP, const char *classname=0) const "
.br
.ti -1c
.RI "virtual \fBQStringList\fP \fBgroups\fP () const "
.br
.ti -1c
.RI "virtual KActionPtrList \fBactions\fP (const \fBQString\fP &group) const "
.br
.ti -1c
.RI "virtual KActionPtrList \fBactions\fP () const "
.br
.ti -1c
.RI "bool \fBreadShortcutSettings\fP (const \fBQString\fP &sConfigGroup=QString::null, \fBKConfigBase\fP *pConfig=0)"
.br
.ti -1c
.RI "bool \fBwriteShortcutSettings\fP (const \fBQString\fP &sConfigGroup=QString::null, \fBKConfigBase\fP *pConfig=0) const "
.br
.ti -1c
.RI "void \fBsetInstance\fP (\fBKInstance\fP *instance)"
.br
.ti -1c
.RI "\fBKInstance\fP * \fBinstance\fP () const "
.br
.ti -1c
.RI "void \fBsetXMLFile\fP (const \fBQString\fP &)"
.br
.ti -1c
.RI "const \fBQString\fP & \fBxmlFile\fP () const "
.br
.ti -1c
.RI "void \fBsetHighlightingEnabled\fP (bool enable)"
.br
.ti -1c
.RI "bool \fBhighlightingEnabled\fP () const "
.br
.ti -1c
.RI "void \fBconnectHighlight\fP (\fBQWidget\fP *container, \fBKAction\fP *action)"
.br
.ti -1c
.RI "void \fBdisconnectHighlight\fP (\fBQWidget\fP *container, \fBKAction\fP *action)"
.br
.ti -1c
.RI "const \fBKXMLGUIClient\fP * \fBparentGUIClient\fP () const "
.br
.ti -1c
.RI "\fBKActionCollection\fP (\fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, \fBKInstance\fP *instance=0)"
.br
.ti -1c
.RI "void \fBinsert\fP (\fBKAction\fP *action)"
.br
.ti -1c
.RI "void \fBremove\fP (\fBKAction\fP *action)"
.br
.ti -1c
.RI "\fBKAction\fP * \fBtake\fP (\fBKAction\fP *action)"
.br
.ti -1c
.RI "\fBKActionCollection\fP \fBoperator+\fP (const \fBKActionCollection\fP &) const "
.br
.ti -1c
.RI "\fBKActionCollection\fP & \fBoperator=\fP (const \fBKActionCollection\fP &)"
.br
.ti -1c
.RI "\fBKActionCollection\fP & \fBoperator+=\fP (const \fBKActionCollection\fP &)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKAction\fP"
.br
.ti -1c
.RI "class \fBKXMLGUIClient\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A managed set of \fBKAction\fP objects. 

If you set the tooltips on KActions 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 \fBKMainWindow\fP subclass, where you create a statusbar, do:
.PP
.PP
.nf
 actionCollection()->setHighlightingEnabled(true);  
 connect(actionCollection(), SIGNAL( actionStatusText( const QString & ) ),
           statusBar(), SLOT( message( const QString & ) ) );
 connect(actionCollection(), SIGNAL( clearStatusText() ),
           statusBar(), SLOT( clear() ) );
.fi
.PP
 
.PP
Definition at line 78 of file kactioncollection.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KActionCollection::KActionCollection (\fBQWidget\fP * watch, \fBQObject\fP * parent, const char * name = \fC0\fP, \fBKInstance\fP * instance = \fC0\fP)"
.PP
Use this constructor if you want the collection's actions to restrict their accelerator keys to \fCwatch\fP rather than the \fCparent\fP. 
.PP
If you don't require shortcuts, you can pass a null to the \fCwatch\fP parameter. 
.PP
Definition at line 92 of file kactioncollection.cpp.
.PP
References endl(), instance(), kdDebug(), and setWidget().
.SH "Member Function Documentation"
.PP 
.SS "void KActionCollection::setWidget (\fBQWidget\fP * widget)\fC [virtual]\fP"
.PP
This sets the widget to which the keyboard shortcuts should be attached. 
.PP
You only need to call this if a null pointer was passed in the constructor. 
.PP
Definition at line 152 of file kactioncollection.cpp.
.PP
References endl(), and kdWarning().
.PP
Referenced by KActionCollection().
.SS "void KActionCollection::setAutoConnectShortcuts (bool)"
.PP
This indicates whether new actions which are created in this collection should have their keyboard shortcuts automatically connected on construction. 
.PP
Set to 'false' if you will be loading XML-based settings. This is automatically done by KParts. The default is 'true'. 
.PP
\fBSee also:\fP
.RS 4
\fBisAutoConnectShortcuts()\fP 
.RE
.PP

.PP
Definition at line 167 of file kactioncollection.cpp.
.SS "bool KActionCollection::isAutoConnectShortcuts ()"
.PP
This indicates whether new actions which are created in this collection have their keyboard shortcuts automatically connected on construction. 
.PP
\fBSee also:\fP
.RS 4
\fBsetAutoConnectShortcuts()\fP 
.RE
.PP

.PP
Definition at line 172 of file kactioncollection.cpp.
.SS "bool KActionCollection::addDocCollection (\fBKActionCollection\fP * pDoc)"
.PP
Doc/View model. 
.PP
This lets you add the action collection of a document to a view's action collection. 
.PP
Definition at line 177 of file kactioncollection.cpp.
.SS "\fBKAccel\fP * KActionCollection::accel ()\fC [virtual]\fP"
.PP
\fBDeprecated\fP
.RS 4
Deprecated because of ambiguous name. Use \fBkaccel()\fP
.RE
.PP

.PP
Definition at line 369 of file kactioncollection.cpp.
.PP
References kaccel().
.SS "const \fBKAccel\fP * KActionCollection::accel () const\fC [virtual]\fP"
.PP
\fBDeprecated\fP
.RS 4
Deprecated because of ambiguous name. Use \fBkaccel()\fP
.RE
.PP

.PP
Definition at line 370 of file kactioncollection.cpp.
.PP
References kaccel().
.SS "\fBKAccel\fP * KActionCollection::kaccel ()"
.PP
Returns the \fBKAccel\fP object of the most recently set widget. 
.PP
Definition at line 282 of file kactioncollection.cpp.
.PP
Referenced by accel().
.SS "const \fBKAccel\fP * KActionCollection::kaccel () const"
.PP
Returns the \fBKAccel\fP object of the most recently set widget. 
.PP
Const version for convenience. 
.PP
Definition at line 291 of file kactioncollection.cpp.
.SS "uint KActionCollection::count () const\fC [virtual]\fP"
.PP
Returns the number of actions in the collection. 
.PP
Definition at line 418 of file kactioncollection.cpp.
.PP
Referenced by KAction::plug().
.SS "\fBKAction\fP * KActionCollection::action (int index) const\fC [virtual]\fP"
.PP
Return the KAction* at position 'index' in the action collection. 
.PP
\fBSee also:\fP
.RS 4
\fBcount()\fP 
.RE
.PP

.PP
Definition at line 400 of file kactioncollection.cpp.
.PP
Referenced by KXMLGUIClient::action(), connectHighlight(), disconnectHighlight(), insert(), remove(), KXMLGUIClient::stateChanged(), and take().
.SS "\fBKAction\fP * KActionCollection::action (const char * name, const char * classname = \fC0\fP) const\fC [virtual]\fP"
.PP
Find an action (optionally, of a given subclass of \fBKAction\fP) in the action collection. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP Name of the \fBKAction\fP. 
.br
\fIclassname\fP Name of the \fBKAction\fP subclass. 
.RE
.PP
\fBReturns:\fP
.RS 4
A pointer to the first \fBKAction\fP in the collection which matches the parameters or null if nothing matches. 
.RE
.PP

.PP
Definition at line 373 of file kactioncollection.cpp.
.SS "\fBQStringList\fP KActionCollection::groups () const\fC [virtual]\fP"
.PP
Returns a list of all the groups of all the KActions in this action collection. 
.PP
\fBSee also:\fP
.RS 4
KAction::group() 
.PP
KAction::setGroup() 
.RE
.PP

.PP
Definition at line 423 of file kactioncollection.cpp.
.SS "KActionPtrList KActionCollection::actions (const \fBQString\fP & group) const\fC [virtual]\fP"
.PP
Returns the list of actions in a particular group managed by this action collection. 
.PP
\fBParameters:\fP
.RS 4
\fIgroup\fP The name of the group. 
.RE
.PP

.PP
Definition at line 435 of file kactioncollection.cpp.
.SS "KActionPtrList KActionCollection::actions () const\fC [virtual]\fP"
.PP
Returns the list of actions managed by this action collection. 
.PP
Definition at line 449 of file kactioncollection.cpp.
.SS "bool KActionCollection::readShortcutSettings (const \fBQString\fP & sConfigGroup = \fCQString::null\fP, \fBKConfigBase\fP * pConfig = \fC0\fP)"
.PP
Used for reading shortcut configuration from a non-XML rc file. 
.PP
Definition at line 408 of file kactioncollection.cpp.
.SS "bool KActionCollection::writeShortcutSettings (const \fBQString\fP & sConfigGroup = \fCQString::null\fP, \fBKConfigBase\fP * pConfig = \fC0\fP) const"
.PP
Used for writing shortcut configuration to a non-XML rc file. 
.PP
Definition at line 413 of file kactioncollection.cpp.
.SS "\fBKInstance\fP * KActionCollection::instance () const"
.PP
The instance with which this class is associated. 
.PP
Definition at line 468 of file kactioncollection.cpp.
.PP
Referenced by KActionCollection(), KPasteTextAction::plug(), KToolBarPopupAction::plug(), KActionMenu::plug(), KRecentFilesAction::plug(), and KAction::plug().
.SS "void KActionCollection::setXMLFile (const \fBQString\fP &)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.PP
Definition at line 473 of file kactioncollection.cpp.
.PP
Referenced by KXMLGUIClient::setXMLFile().
.SS "const \fBQString\fP & KActionCollection::xmlFile () const"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.PP
Definition at line 478 of file kactioncollection.cpp.
.SS "void KActionCollection::setHighlightingEnabled (bool enable)"
.PP
Enable highlighting notification for specific KActions. 
.PP
This is false by default, so, by default, the highlighting signals will not be emitted.
.PP
\fBSee also:\fP
.RS 4
\fBconnectHighlight()\fP 
.PP
\fBdisconnectHighlight()\fP 
.PP
\fBactionHighlighted()\fP 
.PP
\fBactionHighlighted()\fP 
.PP
\fBhighlightingEnabled()\fP 
.RE
.PP

.PP
Definition at line 483 of file kactioncollection.cpp.
.SS "bool KActionCollection::highlightingEnabled () const"
.PP
Return whether highlighting notifications are enabled. 
.PP
\fBSee also:\fP
.RS 4
\fBconnectHighlight()\fP 
.PP
\fBdisconnectHighlight()\fP 
.PP
\fBactionHighlighted()\fP 
.PP
\fBsetHighlightingEnabled()\fP 
.PP
\fBactionHighlighted()\fP 
.RE
.PP

.PP
Definition at line 488 of file kactioncollection.cpp.
.SS "void KActionCollection::connectHighlight (\fBQWidget\fP * container, \fBKAction\fP * action)"
.PP
Call this function if you want to receive a signal whenever a \fBKAction\fP is highlighted in a menu or a toolbar. 
.PP
This is only needed if you do not add this action to this container. You will generally not need to call this function.
.PP
\fBParameters:\fP
.RS 4
\fIcontainer\fP A container in which the \fBKAction\fP is plugged (must inherit \fBQPopupMenu\fP or \fBKToolBar\fP) 
.br
\fIaction\fP The action you are interested in 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBdisconnectHighlight()\fP 
.PP
\fBactionHighlighted()\fP 
.PP
\fBsetHighlightingEnabled()\fP 
.PP
\fBhighlightingEnabled()\fP 
.PP
\fBactionHighlighted()\fP 
.RE
.PP

.PP
Definition at line 493 of file kactioncollection.cpp.
.PP
References action(), QPtrList::append(), QObject::connect(), QObject::destroyed(), and QPtrList::insert().
.PP
Referenced by KActionMenu::plug(), and KAction::plug().
.SS "void KActionCollection::disconnectHighlight (\fBQWidget\fP * container, \fBKAction\fP * action)"
.PP
Disconnect highlight notifications for a particular pair of contianer and action. 
.PP
This is only needed if you do not add this action to this container. You will generally not need to call this function.
.PP
\fBParameters:\fP
.RS 4
\fIcontainer\fP A container in which the \fBKAction\fP is plugged (must inherit \fBQPopupMenu\fP or \fBKToolBar\fP) 
.br
\fIaction\fP The action you are interested in 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBconnectHighlight()\fP 
.PP
\fBactionHighlighted()\fP 
.PP
\fBsetHighlightingEnabled()\fP 
.PP
\fBhighlightingEnabled()\fP 
.PP
\fBactionHighlighted()\fP 
.RE
.PP

.PP
Definition at line 526 of file kactioncollection.cpp.
.PP
References action(), QPtrList::isEmpty(), QPtrList::remove(), and QPtrList::removeRef().
.PP
Referenced by KAction::unplug().
.SS "const \fBKXMLGUIClient\fP * KActionCollection::parentGUIClient () const"
.PP
The parent \fBKXMLGUIClient\fP, return 0L if not available. 
.PP
Definition at line 627 of file kactioncollection.cpp.
.SS "void KActionCollection::actionHighlighted (\fBKAction\fP * action)\fC [signal]\fP"
.PP
Emitted when 'action' is highlighted. 
.PP
This is only emitted if you have \fBsetHighlightingEnabled()\fP 
.PP
\fBSee also:\fP
.RS 4
\fBconnectHighlight()\fP 
.PP
\fBdisconnectHighlight()\fP 
.PP
\fBactionHighlighted()\fP 
.PP
\fBsetHighlightingEnabled()\fP 
.PP
\fBhighlightingEnabled()\fP 
.RE
.PP

.SS "void KActionCollection::actionHighlighted (\fBKAction\fP * action, bool highlight)\fC [signal]\fP"
.PP
Emitted when 'action' is highlighed or loses highlighting. 
.PP
This is only emitted if you have \fBsetHighlightingEnabled()\fP 
.PP
\fBSee also:\fP
.RS 4
\fBconnectHighlight()\fP 
.PP
\fBdisconnectHighlight()\fP 
.PP
\fBactionHighlighted()\fP 
.PP
\fBsetHighlightingEnabled()\fP 
.PP
\fBhighlightingEnabled()\fP 
.RE
.PP

.SS "void KActionCollection::actionStatusText (const \fBQString\fP & text)\fC [signal]\fP"
.PP
Emitted when an action is highlighted, with text being the tooltip for the action. 
.PP
This is only emitted if you have \fBsetHighlightingEnabled()\fP
.PP
This is useful to connect to \fBKStatusBar::message()\fP. See this class overview for more information.
.PP
\fBSee also:\fP
.RS 4
\fBsetHighlightingEnabled()\fP 
.RE
.PP

.SS "void KActionCollection::clearStatusText ()\fC [signal]\fP"
.PP
Emitted when an action loses highlighting. 
.PP
This is only emitted if you have \fBsetHighlightingEnabled()\fP
.PP
\fBSee also:\fP
.RS 4
\fBsetHighlightingEnabled()\fP 
.RE
.PP

.SS "void KActionCollection::insert (\fBKAction\fP * action)"
.PP
Add an action to the collection. 
.PP
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 KActionPtrList). If you manually insert actions into a 2nd collection, don't forget to take them out again before destroying the collection. 
.PP
\fBParameters:\fP
.RS 4
\fIaction\fP The \fBKAction\fP to add. 
.RE
.PP

.PP
Definition at line 365 of file kactioncollection.cpp.
.PP
References action().
.SS "void KActionCollection::remove (\fBKAction\fP * action)"
.PP
Removes an action from the collection and deletes it. 
.PP
Since the \fBKAction\fP destructor removes the action from the collection, you generally don't have to call this. 
.PP
\fBParameters:\fP
.RS 4
\fIaction\fP The \fBKAction\fP to remove. 
.RE
.PP

.PP
Definition at line 366 of file kactioncollection.cpp.
.PP
References action().
.SS "\fBKAction\fP * KActionCollection::take (\fBKAction\fP * action)"
.PP
Removes an action from the collection. 
.PP
Since the \fBKAction\fP destructor removes the action from the collection, you generally don't have to call this. 
.PP
\fBReturns:\fP
.RS 4
NULL if not found else returns action. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIaction\fP the \fBKAction\fP to remove. 
.RE
.PP

.PP
Definition at line 367 of file kactioncollection.cpp.
.PP
References action().
.PP
Referenced by KAction::~KAction().
.SS "void KActionCollection::clear ()\fC [slot]\fP"
.PP
Clears the entire actionCollection, deleting all actions. 
.PP
\fBSee also:\fP
.RS 4
\fBremove\fP 
.RE
.PP

.PP
Definition at line 368 of file kactioncollection.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
