.TH "KAction" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KAction \- The KAction class (and derived and super classes) provides a way to easily encapsulate a 'real' user-selected action or event in your program. Class to encapsulate user-driven action or event.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kaction.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
Inherited by \fBKActionMenu\fP, KActionSeparator, \fBKDataToolAction\fP, \fBKSelectAction\fP, \fBKToggleAction\fP, \fBKToolBarPopupAction\fP, and \fBKWidgetAction\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "virtual void \fBsetText\fP (const  \fBQString\fP &text)"
.br
.RI "\fISets the text associated with this action. \fP"
.ti -1c
.RI "virtual bool \fBsetShortcut\fP (const  KShortcut &)"
.br
.RI "\fISets the keyboard shortcut associated with this action. \fP"
.ti -1c
.RI "virtual void \fBsetGroup\fP (const  \fBQString\fP &)"
.br
.ti -1c
.RI "virtual void \fBsetWhatsThis\fP (const  \fBQString\fP &text)"
.br
.RI "\fISets the What's this text for the action. \fP"
.ti -1c
.RI "virtual void \fBsetToolTip\fP (const  \fBQString\fP &)"
.br
.RI "\fISets the tooltip text for the action. \fP"
.ti -1c
.RI "virtual void \fBsetIconSet\fP (const  \fBQIconSet\fP &iconSet)"
.br
.RI "\fISets the \fBQIconSet\fP from which the icons used to display this action will be chosen. \fP"
.ti -1c
.RI "virtual void \fBsetIcon\fP (const  \fBQString\fP &icon)"
.br
.ti -1c
.RI "virtual void \fBsetEnabled\fP (bool enable)"
.br
.RI "\fIEnables or disables this action. \fP"
.ti -1c
.RI "virtual void \fBsetShortcutConfigurable\fP (bool)"
.br
.RI "\fIIndicate whether the user may configure the action's shortcut. \fP"
.ti -1c
.RI "virtual void \fBactivate\fP ()"
.br
.RI "\fIEmulate user's interaction programmatically, by activating the action. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBactivated\fP ()"
.br
.ti -1c
.RI "void \fBenabled\fP (bool)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  KShortcut &cut, const  \fBQObject\fP *receiver, const  char *slot, \fBKActionCollection\fP *\fBparent\fP, const  char *\fBname\fP)"
.br
.RI "\fIConstructs an action with text, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. \fP"
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  \fBQIconSet\fP &pix, const  KShortcut &cut, const  \fBQObject\fP *receiver, const  char *slot, \fBKActionCollection\fP *\fBparent\fP, const  char *\fBname\fP)"
.br
.RI "\fIConstructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. \fP"
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  \fBQString\fP &pix, const  KShortcut &cut, const  \fBQObject\fP *receiver, const  char *slot, \fBKActionCollection\fP *\fBparent\fP, const  char *\fBname\fP)"
.br
.RI "\fIConstructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. \fP"
.ti -1c
.RI "\fBKAction\fP (const  KGuiItem &item, const  KShortcut &cut, const  \fBQObject\fP *receiver, const  char *slot, \fBKActionCollection\fP *\fBparent\fP, const  char *\fBname\fP)"
.br
.RI "\fIThe same as the above constructor, but with a KGuiItem providing the text and icon. \fP"
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  KShortcut &cut=KShortcut(), \fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  KShortcut &cut, const  \fBQObject\fP *receiver, const  char *slot, \fBQObject\fP *\fBparent\fP, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  \fBQIconSet\fP &pix, const  KShortcut &cut=KShortcut(), \fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  \fBQString\fP &pix, const  KShortcut &cut=KShortcut(), \fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  \fBQIconSet\fP &pix, const  KShortcut &cut, const  \fBQObject\fP *receiver, const  char *slot, \fBQObject\fP *\fBparent\fP, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKAction\fP (const  \fBQString\fP &text, const  \fBQString\fP &pix, const  KShortcut &cut, const  \fBQObject\fP *receiver, const  char *slot, \fBQObject\fP *\fBparent\fP, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKAction\fP (\fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "virtual \fB~KAction\fP ()"
.br
.RI "\fIStandard destructor. \fP"
.ti -1c
.RI "virtual int \fBplug\fP (\fBQWidget\fP *w, int index=-1)"
.br
.RI "\fI'Plug' or insert this action into a given widget. \fP"
.ti -1c
.RI "virtual void \fBplugAccel\fP (\fBKAccel\fP *accel, bool configurable=true)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP. \fP"
.ti -1c
.RI "virtual void \fBunplug\fP (\fBQWidget\fP *w)"
.br
.RI "\fI'Unplug' or remove this action from a given widget. \fP"
.ti -1c
.RI "virtual void \fBunplugAccel\fP ()"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP. \fP"
.ti -1c
.RI "virtual bool \fBisPlugged\fP () const "
.br
.RI "\fIreturns whether the action is plugged into any container widget or not. \fP"
.ti -1c
.RI "bool \fBisPlugged\fP (const  \fBQWidget\fP *container) const "
.br
.RI "\fIreturns whether the action is plugged into the given container \fP"
.ti -1c
.RI "virtual bool \fBisPlugged\fP (const  \fBQWidget\fP *container, int id) const "
.br
.RI "\fIreturns whether the action is plugged into the given container with the given, container specific, id (often menu or toolbar id ) . \fP"
.ti -1c
.RI "virtual bool \fBisPlugged\fP (const  \fBQWidget\fP *container, const  \fBQWidget\fP *_representative) const "
.br
.RI "\fIreturns whether the action is plugged into the given container with the given, container specific, representative container widget item. \fP"
.ti -1c
.RI "\fBQWidget\fP * \fBcontainer\fP (int index) const "
.br
.ti -1c
.RI "int \fBitemId\fP (int index) const "
.br
.ti -1c
.RI "\fBQWidget\fP * \fBrepresentative\fP (int index) const "
.br
.ti -1c
.RI "int \fBcontainerCount\fP () const "
.br
.ti -1c
.RI "uint \fBkaccelCount\fP () const "
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.ti -1c
.RI "virtual bool \fBhasIcon\fP () const "
.br
.ti -1c
.RI "bool \fBhasIconSet\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBplainText\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBtext\fP () const "
.br
.RI "\fIGet the text associated with this action. \fP"
.ti -1c
.RI "virtual const  KShortcut & \fBshortcut\fP () const "
.br
.RI "\fIGet the keyboard shortcut associated with this action. \fP"
.ti -1c
.RI "virtual const  KShortcut & \fBshortcutDefault\fP () const "
.br
.RI "\fIGet the default shortcut for this action. \fP"
.ti -1c
.RI "\fBQString\fP \fBshortcutText\fP () const "
.br
.ti -1c
.RI "void \fBsetShortcutText\fP (const  \fBQString\fP &)"
.br
.ti -1c
.RI "virtual bool \fBisEnabled\fP () const "
.br
.RI "\fIReturns true if this action is enabled. \fP"
.ti -1c
.RI "virtual bool \fBisShortcutConfigurable\fP () const "
.br
.RI "\fIReturns true if this action's shortcut is configurable. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBgroup\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBwhatsThis\fP () const "
.br
.RI "\fIGet the What's this text for the action. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBtoolTip\fP () const "
.br
.RI "\fIGet the tooltip text for the action. \fP"
.ti -1c
.RI "virtual \fBQIconSet\fP \fBiconSet\fP (\fBKIcon::Group\fP group, int size=0) const "
.br
.RI "\fIGet the \fBQIconSet\fP from which the icons used to display this action will be chosen. \fP"
.ti -1c
.RI "\fBQIconSet\fP \fBiconSet\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBicon\fP () const "
.br
.ti -1c
.RI "\fBKActionCollection\fP * \fBparentCollection\fP () const "
.br
.ti -1c
.RI "void \fBunplugAll\fP ()"
.br
.ti -1c
.RI "int \fBaccel\fP () const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP. \fP"
.ti -1c
.RI "\fBQString\fP \fBstatusText\fP () const "
.br
.ti -1c
.RI "void \fBsetAccel\fP (int key)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP. \fP"
.ti -1c
.RI "void \fBsetStatusText\fP (const  \fBQString\fP &text)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP. \fP"
.ti -1c
.RI "int \fBmenuId\fP (int i)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "int \fBgetToolButtonID\fP ()"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBslotDestroyed\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotKeycodeChanged\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotActivated\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKToolBar\fP * \fBtoolBar\fP (int index) const "
.br
.ti -1c
.RI "\fBQPopupMenu\fP * \fBpopupMenu\fP (int index) const "
.br
.ti -1c
.RI "void \fBremoveContainer\fP (int index)"
.br
.ti -1c
.RI "int \fBfindContainer\fP (const  \fBQWidget\fP *widget) const "
.br
.ti -1c
.RI "void \fBplugMainWindowAccel\fP (\fBQWidget\fP *w)"
.br
.ti -1c
.RI "void \fBaddContainer\fP (\fBQWidget\fP *\fBparent\fP, int id)"
.br
.ti -1c
.RI "void \fBaddContainer\fP (\fBQWidget\fP *\fBparent\fP, \fBQWidget\fP *representative)"
.br
.ti -1c
.RI "virtual void \fBupdateShortcut\fP (int i)"
.br
.ti -1c
.RI "virtual void \fBupdateShortcut\fP (\fBQPopupMenu\fP *menu, int id)"
.br
.ti -1c
.RI "virtual void \fBupdateGroup\fP (int id)"
.br
.ti -1c
.RI "virtual void \fBupdateText\fP (int i)"
.br
.ti -1c
.RI "virtual void \fBupdateEnabled\fP (int i)"
.br
.ti -1c
.RI "virtual void \fBupdateIconSet\fP (int i)"
.br
.ti -1c
.RI "virtual void \fBupdateIcon\fP (int i)"
.br
.ti -1c
.RI "virtual void \fBupdateToolTip\fP (int id)"
.br
.ti -1c
.RI "virtual void \fBupdateWhatsThis\fP (int i)"
.br
.ti -1c
.RI "\fBQString\fP \fBwhatsThisWithIcon\fP () const "
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBKActionCollection\fP * \fBm_parentCollection\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKActionCollection\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
The KAction class (and derived and super classes) provides a way to easily encapsulate a 'real' user-selected action or event in your program. Class to encapsulate user-driven action or event. 

For instance, a user may want to \fCpaste\fP the contents of the clipboard or \fCscroll\fP \fCdown\fP a document or \fCquit\fP the application. These are all \fCactions\fP -- events that the user causes to happen. The KAction class allows the developer to deal with these actions in an easy and intuitive manner.
.PP
Specifically, the KAction class encapsulated the various attributes to an event/action. For instance, an action might have an icon that goes along with it (a clipboard for a 'paste' action or scissors for a 'cut' action). The action might have some text to describe the action. It will certainly have a method or function that actually \fCexecutes\fP the action! All these attributes are contained within the KAction object.
.PP
The advantage of dealing with Actions is that you can manipulate the Action without regard to the GUI representation of it. For instance, in the 'normal' way of dealing with actions like 'cut', you would manually insert a item for Cut into a menu and a button into a toolbar. If you want to disable the cut action for a moment (maybe nothing is selected), you woud have to hunt down the pointer to the menu item and the toolbar button and disable both individually. Setting the menu item and toolbar item up uses very similar code - but has to be done twice!
.PP
With the Action concept, you simply 'plug' the Action into whatever GUI element you want. The KAction class will then take care of correctly defining the menu item (with icons, accelerators, text, etc) or toolbar button.. or whatever. From then on, if you manipulate the Action at all, the effect will propogate through all GUI representations of it. Back to the 'cut' example: if you want to disable the Cut Action, you would simply do 'cutAction->setEnabled(false)' and the menuitem and button would instantly be disabled!
.PP
This is the biggest advantage to the Action concept -- there is a one-to-one relationship between the 'real' action and \fCall\fP GUI representations of it.
.PP
KAction emits the activated() signal if the user activated the corresponding GUI element ( menu item, toolbar button, etc. )
.PP
If you are in the situation of wanting to map the activated() signal of multiple action objects to one slot, with a special argument bound to each action, then you might consider using \fBQSignalMapper\fP . A tiny example:
.PP
.PP
.nf

 \fBQSignalMapper\fP *desktopNumberMapper = new QSignalMapper( this );
 connect( desktopNumberMapper, SIGNAL( mapped( int ) ),
          this, SLOT( moveWindowToDesktop( int ) ) );
.PP
.PP
.PP
.nf
 for ( uint i = 0; i < numberOfDesktops; ++i ) {
     KAction *desktopAction = new KAction( i18n( 'Move Window To Desktop %i' ).arg( i ), ... );
     connect( desktopAction, SIGNAL( activated() ), desktopNumberMapper, SLOT( map() ) );
     desktopNumberMapper->setMapping( desktopAction, i );
 }
 
.PP
.PP
\fB General Usage:\fP
.PP
\fB The steps to using actions are roughly as follows\fP
.PP
\fB 
.IP "\(bu" 2
Decide which attributes you want to associate with a given action (icons, text, keyboard shortcut, etc) 
.IP "\(bu" 2
Create the action using KAction (or derived or super class). 
.IP "\(bu" 2
'Plug' the Action into whatever GUI element you want. Typically, this will be a menu or toolbar.
.PP
\fP
.PP
\fB\fB Detailed Example:\fP\fP
.PP
\fB\fB Here is an example of enabling a 'New [document]' action 
.PP
.nf

 KAction *newAct = new KAction(i18n('&New'), 'filenew',
                               KStdAccel::shortcut(KStdAccel::New),
                               this, SLOT(fileNew()),
                               actionCollection(), 'new');
 
.PP
 This line creates our action. It says that wherever this action is displayed, it will use '&New' as the text, the standard icon, and the standard shortcut. It further says that whenever this action is invoked, it will use the fileNew() slot to execute it.\fP\fP
.PP
\fB\fB 
.PP
.nf

 \fBQPopupMenu\fP *file = new \fBQPopupMenu\fP;
 newAct->plug(file);
 
.PP
 That just inserted the action into the File menu. The point is, it's not important in which menu it is: all manipulation of the item is done through the newAct object.\fP\fP
.PP
\fB\fB 
.PP
.nf

 newAct->plug(toolBar());
 
.PP
 And this inserted the Action into the main toolbar as a button.\fP\fP
.PP
\fB\fB That's it!\fP\fP
.PP
\fB\fB If you want to disable that action sometime later, you can do so with 
.PP
.nf

 newAct->setEnabled(false)
 
.PP
 and both the menuitem in File and the toolbar button will instantly be disabled.\fP\fP
.PP
\fB\fB Note: if you are using a 'standard' action like 'new', 'paste', 'quit', or any other action described in the \fBKDE\fP UI Standards, please use the methods in the \fBKStdAction\fP class rather than defining your own.\fP\fP
.PP
\fB\fB \fP\fP
.PP
\fB\fB\fB Usage Within the XML Framework:\fP\fP\fP
.PP
\fB\fB\fB If you are using KAction within the context of the XML menu and toolbar building framework, then there are a few tiny changes. The first is that you must insert your new action into an action collection. The action collection (a \fBKActionCollection\fP) is, logically enough, a central collection of all of the actions defined in your application. The XML UI framework code in KXMLGUI classes needs access to this collection in order to build up the GUI (it's how the builder code knows which actions are valid and which aren't).\fP\fP\fP
.PP
\fB\fB\fB Also, if you use the XML builder framework, then you do not ever have to plug your actions into containers manually. The framework does that for you.\fP\fP\fP
.PP
\fB\fB\fB 
.PP
\fBSee also:\fP
.RS 4
\fBKStdAction\fP 
.RE
.PP
\fP\fP\fP
.PP
Definition at line 191 of file kaction.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KAction::KAction (const \fBQString\fP & text, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBKActionCollection\fP * parent, const char * name)"
.PP
Constructs an action with text, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. If you do not want or have a keyboard shortcut, set the \fCcut\fP param to 0.
.PP
This is the most common KAction used when you do not have a corresponding icon (note that it won't appear in the current version of the 'Edit ToolBar' dialog, because an action needs an icon to be plugged in a toolbar...).
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIcut\fP The corresponding keyboard shortcut. 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke to execute this action. 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP
Definition at line 169 of file kaction.cpp.
.PP
References KStdAccel::cut(), and QObject::name().
.SS "KAction::KAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBKActionCollection\fP * parent, const char * name)"
.PP
Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. If you do not want or have a keyboard shortcut, set the \fCcut\fP param to 0.
.PP
This is the other common KAction used. Use it when you \fCdo\fP have a corresponding icon.
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The icon to display. 
.br
\fIcut\fP The corresponding keyboard shortcut. 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke to execute this action. 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP
Definition at line 186 of file kaction.cpp.
.PP
References KStdAccel::cut(), and KStdAccel::name().
.SS "KAction::KAction (const \fBQString\fP & text, const \fBQString\fP & pix, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBKActionCollection\fP * parent, const char * name)"
.PP
Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. The icon is loaded on demand later based on where it is plugged in.
.PP
If you do not want or have a keyboard shortcut, set the \fCcut\fP param to 0.
.PP
This is the other common KAction used. Use it when you \fCdo\fP have a corresponding icon.
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The icon to display. 
.br
\fIcut\fP The corresponding keyboard shortcut (shortcut). 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke to execute this action. 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.RE
.PP
Definition at line 177 of file kaction.cpp.
.PP
References KStdAccel::cut(), and KStdAccel::name().
.SS "KAction::KAction (const KGuiItem & item, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBKActionCollection\fP * parent, const char * name)"
.PP
The same as the above constructor, but with a KGuiItem providing the text and icon. \fBParameters:\fP
.RS 4
\fIitem\fP The KGuiItem with the label and (optional) icon. 
.RE
.PP
Definition at line 195 of file kaction.cpp.
.PP
References KStdAccel::cut(), KStdAccel::name(), setToolTip(), and setWhatsThis().
.SS "KAction::KAction (const \fBQString\fP & text, const KShortcut & cut = KShortcut(), \fBQObject\fP * parent = 0, const char * name = 0)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.SS "KAction::KAction (const \fBQString\fP & text, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = 0)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.SS "KAction::KAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const KShortcut & cut = KShortcut(), \fBQObject\fP * parent = 0, const char * name = 0)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.SS "KAction::KAction (const \fBQString\fP & text, const \fBQString\fP & pix, const KShortcut & cut = KShortcut(), \fBQObject\fP * parent = 0, const char * name = 0)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.SS "KAction::KAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = 0)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.SS "KAction::KAction (const \fBQString\fP & text, const \fBQString\fP & pix, const KShortcut & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = 0)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.SS "KAction::KAction (\fBQObject\fP * parent = 0, const char * name = 0)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.SS "KAction::~\fBKAction\fP ()\fC [virtual]\fP"
.PP
Standard destructor. Definition at line 268 of file kaction.cpp.
.PP
References QObject::name(), KActionCollection::take(), and unplugAccel().
.SH "Member Function Documentation"
.PP 
.SS "int KAction::plug (\fBQWidget\fP * w, int index = -1)\fC [virtual]\fP"
.PP
'Plug' or insert this action into a given widget. This will typically be a menu or a toolbar. From this point on, you will never need to directly manipulate the item in the menu or toolbar. You do all enabling/disabling/manipulation directly with your KAction object.
.PP
\fBParameters:\fP
.RS 4
\fIw\fP The GUI element to display this action 
.RE
.PP
Reimplemented in \fBKToggleAction\fP, \fBKSelectAction\fP, \fBKActionMenu\fP, \fBKToolBarPopupAction\fP, \fBKToggleToolBarAction\fP, and \fBKWidgetAction\fP.
.PP
Definition at line 653 of file kaction.cpp.
.PP
References QToolTip::add(), QWhatsThis::add(), QObject::connect(), KActionCollection::connectHighlight(), QObject::destroyed(), KToolBar::getButton(), iconSet(), KToolBar::insertButton(), QPopupMenu::insertItem(), KGlobal::instance(), KActionCollection::instance(), KNotifyClient::instance(), QString::isEmpty(), QObject::name(), QPopupMenu::setItemEnabled(), and QPopupMenu::setWhatsThis().
.PP
Referenced by KToolBarPopupAction::plug(), and KToggleAction::plug().
.SS "void KAction::plugAccel (\fBKAccel\fP * accel, bool configurable = true)\fC [virtual]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP. Shouldn't be used. No substitute available.
.PP
'Plug' or insert this action into a given \fBKAccel\fP.
.PP
\fBParameters:\fP
.RS 4
\fIaccel\fP The \fBKAccel\fP collection which holds this accel 
.br
\fIconfigurable\fP If the shortcut is configurable via the \fBKAccel\fP configuration dialog (this is somehow deprecated since there is now a KAction key configuration dialog). 
.RE
.PP
Definition at line 791 of file kaction.cpp.
.PP
References KAccel::actions(), QObject::connect(), QObject::destroyed(), isEnabled(), QObject::name(), and unplugAccel().
.SS "void KAction::unplug (\fBQWidget\fP * w)\fC [virtual]\fP"
.PP
'Unplug' or remove this action from a given widget. This will typically be a menu or a toolbar. This is rarely used in 'normal' application. Typically, it would be used if your application has several views or modes, each with a completely different menu structure. If you simply want to disable an action for a given period, use \fBsetEnabled\fP() instead.
.PP
\fBParameters:\fP
.RS 4
\fIw\fP Remove the action from this GUI element. 
.RE
.PP
Reimplemented in \fBKWidgetAction\fP.
.PP
Definition at line 763 of file kaction.cpp.
.PP
References KActionCollection::disconnectHighlight(), QMenuBar::removeItem(), KToolBar::removeItem(), and QPopupMenu::removeItem().
.PP
Referenced by KWidgetAction::unplug().
.SS "void KAction::unplugAccel ()\fC [virtual]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP. Complement method to \fBplugAccel()\fP. Disconnect this action from the \fBKAccel\fP. Definition at line 819 of file kaction.cpp.
.PP
References QObject::name().
.PP
Referenced by plugAccel(), and ~KAction().
.SS "bool KAction::isPlugged () const\fC [virtual]\fP"
.PP
returns whether the action is plugged into any container widget or not. \fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 314 of file kaction.cpp.
.PP
Referenced by KWidgetAction::unplug().
.SS "bool KAction::isPlugged (const \fBQWidget\fP * container) const"
.PP
returns whether the action is plugged into the given container Definition at line 319 of file kaction.cpp.
.SS "bool KAction::isPlugged (const \fBQWidget\fP * container, int id) const\fC [virtual]\fP"
.PP
returns whether the action is plugged into the given container with the given, container specific, id (often menu or toolbar id ) . Definition at line 324 of file kaction.cpp.
.SS "bool KAction::isPlugged (const \fBQWidget\fP * container, const \fBQWidget\fP * _representative) const\fC [virtual]\fP"
.PP
returns whether the action is plugged into the given container with the given, container specific, representative container widget item. Definition at line 330 of file kaction.cpp.
.SS "uint KAction::kaccelCount () const"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1079 of file kaction.cpp.
.SS "\fBQString\fP KAction::text () const\fC [virtual]\fP"
.PP
Get the text associated with this action. Definition at line 926 of file kaction.cpp.
.PP
Referenced by KActionMenu::plug(), and KSelectAction::plug().
.SS "const  KShortcut & KAction::shortcut () const\fC [virtual]\fP"
.PP
Get the keyboard shortcut associated with this action. Definition at line 577 of file kaction.cpp.
.SS "const  KShortcut & KAction::shortcutDefault () const\fC [virtual]\fP"
.PP
Get the default shortcut for this action. Definition at line 582 of file kaction.cpp.
.SS "bool KAction::isEnabled () const\fC [virtual]\fP"
.PP
Returns true if this action is enabled. Definition at line 621 of file kaction.cpp.
.PP
Referenced by KCommandHistory::addCommand(), KToolBarPopupAction::plug(), KActionMenu::plug(), KSelectAction::plug(), plugAccel(), and KCommandHistory::redo().
.SS "bool KAction::isShortcutConfigurable () const\fC [virtual]\fP"
.PP
Returns true if this action's shortcut is configurable. Definition at line 626 of file kaction.cpp.
.SS "\fBQString\fP KAction::whatsThis () const\fC [virtual]\fP"
.PP
Get the What's this text for the action. Definition at line 1035 of file kaction.cpp.
.PP
Referenced by KToolBarPopupAction::plug(), KActionMenu::plug(), and KSelectAction::plug().
.SS "\fBQString\fP KAction::toolTip () const\fC [virtual]\fP"
.PP
Get the tooltip text for the action. Definition at line 648 of file kaction.cpp.
.PP
Referenced by KSelectAction::plug().
.SS "\fBQIconSet\fP KAction::iconSet (\fBKIcon::Group\fP group, int size = 0) const\fC [virtual]\fP"
.PP
Get the \fBQIconSet\fP from which the icons used to display this action will be chosen. Definition at line 997 of file kaction.cpp.
.PP
Referenced by KActionMenu::plug(), KSelectAction::plug(), and plug().
.SS "void KAction::setText (const \fBQString\fP & text)\fC [virtual, slot]\fP"
.PP
Sets the text associated with this action. The text is used for menu and toolbar labels etc. Definition at line 884 of file kaction.cpp.
.PP
References QObject::name().
.PP
Referenced by KCommandHistory::addCommand(), KCommandHistory::clear(), KCommandHistory::redo(), and KCommandHistory::undo().
.SS "bool KAction::setShortcut (const KShortcut &)\fC [virtual, slot]\fP"
.PP
Sets the keyboard shortcut associated with this action. Definition at line 451 of file kaction.cpp.
.PP
References KStdAccel::cut(), and QObject::name().
.SS "void KAction::setWhatsThis (const \fBQString\fP & text)\fC [virtual, slot]\fP"
.PP
Sets the What's this text for the action. This text will be displayed when a widget that has been created by plugging this action into a container is clicked on in What's this mode.
.PP
The What's this text can include QML markup as well as raw text. Definition at line 1007 of file kaction.cpp.
.PP
Referenced by KAction().
.SS "void KAction::setToolTip (const \fBQString\fP &)\fC [virtual, slot]\fP"
.PP
Sets the tooltip text for the action. This will be used as a tooltip for a toolbar button, as a statusbar help-text for a menu item, and it also appears in the toolbar editor, to describe the action. Definition at line 631 of file kaction.cpp.
.PP
Referenced by KAction(), and setStatusText().
.SS "void KAction::setIconSet (const \fBQIconSet\fP & iconSet)\fC [virtual, slot]\fP"
.PP
Sets the \fBQIconSet\fP from which the icons used to display this action will be chosen. Definition at line 966 of file kaction.cpp.
.SS "void KAction::setEnabled (bool enable)\fC [virtual, slot]\fP"
.PP
Enables or disables this action. All uses of this action (eg. in menus or toolbars) will be updated to reflect the state of the action. Definition at line 844 of file kaction.cpp.
.PP
References QObject::name().
.PP
Referenced by KCommandHistory::addCommand(), KCommandHistory::clear(), KToggleToolBarAction::plug(), KCommandHistory::redo(), KSelectAction::setItems(), KCommandHistory::undo(), and KCommandHistory::updateActions().
.SS "void KAction::setShortcutConfigurable (bool)\fC [virtual, slot]\fP"
.PP
Indicate whether the user may configure the action's shortcut. Definition at line 879 of file kaction.cpp.
.SS "void KAction::activate ()\fC [virtual, slot]\fP"
.PP
Emulate user's interaction programmatically, by activating the action. The implementation simply emits activated(). Definition at line 1100 of file kaction.cpp.
.SS "int KAction::accel () const"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP. Use \fBshortcut()\fP. Get the keyboard accelerator associated with this action. Definition at line 597 of file kaction.cpp.
.SS "void KAction::setAccel (int key)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP. Use \fBsetShortcut()\fP. Sets the keyboard accelerator associated with this action. 
.SS "void KAction::setStatusText (const \fBQString\fP & text)\fC [inline]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP. Use setToolTip instead (they do the same thing now). Definition at line 588 of file kaction.h.
.PP
References setToolTip().
.SS "int KAction::menuId (int i)\fC [inline]\fP"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP. for backwards compatibility. Definition at line 594 of file kaction.h.

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