kdecore Library API Documentation

KAccelAction Class Reference

List of all members.

Public Member Functions

 KAccelAction ()
 KAccelAction (const KAccelAction &)
 KAccelAction (const QString &sName, const QString &sLabel, const QString &sWhatsThis, const KShortcut &cutDef3, const KShortcut &cutDef4, const QObject *pObjSlot, const char *psMethodSlot, bool bConfigurable, bool bEnabled)
 ~KAccelAction ()
void clear ()
bool init (const QString &sName, const QString &sLabel, const QString &sWhatsThis, const KShortcut &cutDef3, const KShortcut &cutDef4, const QObject *pObjSlot, const char *psMethodSlot, bool bConfigurable, bool bEnabled)
KAccelActionoperator= (const KAccelAction &)
const QStringname () const
const QStringlabel () const
const QStringwhatsThis () const
const KShortcutshortcut () const
const KShortcutshortcutDefault () const
const KShortcutshortcutDefault3 () const
const KShortcutshortcutDefault4 () const
const QObjectobjSlotPtr () const
const char * methodSlotPtr () const
bool isConfigurable () const
bool isEnabled () const
void setName (const QString &name)
void setLabel (const QString &label)
void setWhatsThis (const QString &whatsThis)
bool setShortcut (const KShortcut &rgCuts)
void setSlot (const QObject *pObjSlot, const char *psMethodSlot)
void setConfigurable (bool configurable)
void setEnabled (bool enable)
int getID () const
void setID (int n)
bool isConnected () const
bool setKeySequence (uint i, const KKeySequence &keySeq)
void clearShortcut ()
bool contains (const KKeySequence &keySeq)
QString toString () const
QString toStringInternal () const

Static Public Member Functions

static bool useFourModifierKeys ()
static void useFourModifierKeys (bool use)

Protected Member Functions

void incConnections ()
void decConnections ()

Protected Attributes

QString m_sName
QString m_sLabel
QString m_sWhatsThis
KShortcut m_cut
KShortcut m_cutDefault3
KShortcut m_cutDefault4
const QObjectm_pObjSlot
const char * m_psMethodSlot
bool m_bConfigurable
bool m_bEnabled
int m_nIDAccel
uint m_nConnections

Friends

class KAccelActions
class KAccelBase

Detailed Description

Definition at line 72 of file kaccelaction.h.


Constructor & Destructor Documentation

KAccelAction::KAccelAction  ) 
 

Creates an empty KAccelAction.

See also:
clear()

Definition at line 46 of file kaccelaction.cpp.

References m_bConfigurable, m_bEnabled, m_nIDAccel, m_pObjSlot, and m_psMethodSlot.

KAccelAction::KAccelAction const KAccelAction  ) 
 

Copy constructor.

Definition at line 58 of file kaccelaction.cpp.

KAccelAction::KAccelAction const QString sName,
const QString sLabel,
const QString sWhatsThis,
const KShortcut cutDef3,
const KShortcut cutDef4,
const QObject pObjSlot,
const char *  psMethodSlot,
bool  bConfigurable,
bool  bEnabled
 

Creates a new KAccelAction.

Parameters:
sName the name of the accelerator
sLabel the label of the accelerator (i18n!)
sWhatsThis the What's This text (18n!)
cutDef3 the default shortcut for 3 modifier systems
cutDef4 the default shortcut for 4 modifier systems
pObjSlot the receiver of a signal when the key has been pressed
psMethodSlot the slot to connect for key presses. Receives an int, as set by setID(), as only argument
bConfigurable if true the user can configure the shortcut
bEnabled true if the accelerator should be enabled

Definition at line 65 of file kaccelaction.cpp.

References init().


Member Function Documentation

void KAccelAction::clear  ) 
 

Clears the accelerator.

Definition at line 84 of file kaccelaction.cpp.

References KShortcut::clear(), m_bConfigurable, m_bEnabled, m_cut, m_nIDAccel, m_pObjSlot, and m_psMethodSlot.

bool KAccelAction::init const QString sName,
const QString sLabel,
const QString sWhatsThis,
const KShortcut cutDef3,
const KShortcut cutDef4,
const QObject pObjSlot,
const char *  psMethodSlot,
bool  bConfigurable,
bool  bEnabled
 

Re-initialized the KAccelAction.

Parameters:
sName the name of the accelerator
sLabel the label of the accelerator (i18n!)
sWhatsThis the What's This text (18n!)
cutDef3 the default shortcut for 3 modifier systems
cutDef4 the default shortcut for 4 modifier systems
pObjSlot the receiver of a signal when the key has been pressed
psMethodSlot the slot to connect for key presses. Receives an int, as set by setID(), as only argument
bConfigurable if true the user can configure the shortcut
bEnabled true if the accelerator should be enabled
Returns:
true if successful, false otherwise

Definition at line 95 of file kaccelaction.cpp.

References endl(), kdDebug(), m_bConfigurable, m_bEnabled, m_cut, m_cutDefault3, m_cutDefault4, m_nIDAccel, m_pObjSlot, m_psMethodSlot, m_sLabel, m_sName, m_sWhatsThis, and shortcutDefault().

Referenced by KAccelAction().

KAccelAction & KAccelAction::operator= const KAccelAction  ) 
 

Copies this KAccelAction.

Definition at line 117 of file kaccelaction.cpp.

References d, m_bConfigurable, m_bEnabled, m_cut, m_cutDefault3, m_cutDefault4, m_nIDAccel, m_pObjSlot, m_psMethodSlot, m_sLabel, m_sName, and m_sWhatsThis.

const QString& KAccelAction::name  )  const [inline]
 

Returns the name of the accelerator action.

Returns:
the name of the accelerator action, can be null if not set

Definition at line 141 of file kaccelaction.h.

Referenced by KGlobalAccelPrivate::activate(), KAccelPrivate::connectKey(), KAccelBase::createPopupMenu(), KAccelPrivate::disconnectKey(), KAccel::findKey(), KGlobalAccelPrivate::grabKey(), KAccelShortcutList::name(), KAccelBase::updateConnections(), and KGlobalAccelPrivate::x11KeyPress().

const QString& KAccelAction::label  )  const [inline]
 

Returns the label of the accelerator action.

Returns:
the label of the accelerator action, can be null if not set

Definition at line 148 of file kaccelaction.h.

Referenced by KGlobalAccelPrivate::activate(), KAccelShortcutList::label(), KGlobalAccel::label(), and KShortcutMenu::updateShortcuts().

const QString& KAccelAction::whatsThis  )  const [inline]
 

Returns the What's This text of the accelerator action.

Returns:
the What's This text of the accelerator action, can be null if not set

Definition at line 155 of file kaccelaction.h.

Referenced by KAccelShortcutList::whatsThis().

const KShortcut& KAccelAction::shortcut  )  const [inline]
 

The shortcut that is actually used (may be used configured).

Returns:
the shortcut of the KAccelAction, can be null if not set
See also:
shortcutDefault()

Definition at line 162 of file kaccelaction.h.

Referenced by KAccel::changeMenuAccel(), KAccelBase::createKeyList(), KAccelBase::createPopupMenu(), KAccel::currentKey(), KAccelBase::insertConnection(), KAccelBase::setShortcut(), KAccel::setShortcut(), KAccelShortcutList::shortcut(), KGlobalAccel::shortcut(), KAccel::shortcut(), KAccelBase::updateConnections(), and KGlobalAccelPrivate::x11KeyPress().

const KShortcut & KAccelAction::shortcutDefault  )  const
 

The default shortcut for this system.

Returns:
the default shortcut on this system, can be null if not set
See also:
shortcut()

shortcutDefault3()

shortcutDefault4()

Definition at line 190 of file kaccelaction.cpp.

References m_cutDefault3, m_cutDefault4, and useFourModifierKeys().

Referenced by init(), KAccelShortcutList::shortcutDefault(), toStringInternal(), and KAccelActions::writeActions().

const KShortcut& KAccelAction::shortcutDefault3  )  const [inline]
 

The default shortcut for 3 modifier systems.

Returns:
the default shortcut for 3 modifier systems, can be null if not set
See also:
shortcutDefault()

shortcutDefault4()

useFourModifierKeys()

Definition at line 181 of file kaccelaction.h.

const KShortcut& KAccelAction::shortcutDefault4  )  const [inline]
 

The default shortcut for 4 modifier systems.

Returns:
the default shortcut for 4 modifier systems, can be null if not set
See also:
shortcutDefault()

shortcutDefault3()

useFourModifierKeys()

Definition at line 191 of file kaccelaction.h.

const QObject* KAccelAction::objSlotPtr  )  const [inline]
 

Returns the receiver of signals.

Returns:
the receiver of signals (can be 0 if not set)

Definition at line 197 of file kaccelaction.h.

Referenced by KGlobalAccelPrivate::activate(), KAccelPrivate::connectKey(), KAccelPrivate::disconnectKey(), and KGlobalAccelPrivate::x11KeyPress().

const char* KAccelAction::methodSlotPtr  )  const [inline]
 

Returns the slot for the signal.

Returns:
the slot for the signal

Definition at line 203 of file kaccelaction.h.

Referenced by KGlobalAccelPrivate::activate(), and KAccelPrivate::connectKey().

bool KAccelAction::isConfigurable  )  const [inline]
 

Checks whether the user can configure the action.

Returns:
true if configurable, false otherwise

Definition at line 209 of file kaccelaction.h.

Referenced by KAccelBase::createPopupMenu(), and KAccelShortcutList::isConfigurable().

bool KAccelAction::isEnabled  )  const [inline]
 

Checks whether the action is enabled.

Returns:
true if enabled, false otherwise

Definition at line 215 of file kaccelaction.h.

Referenced by KAccelPrivate::connectKey(), KAccelBase::createPopupMenu(), KAccelPrivate::setEnabled(), and KGlobalAccelPrivate::x11KeyPress().

void KAccelAction::setName const QString name  ) 
 

Sets the name of the accelerator action.

Parameters:
name the new name

Definition at line 135 of file kaccelaction.cpp.

References m_sName.

void KAccelAction::setLabel const QString label  ) 
 

Sets the user-readable label of the accelerator action.

Parameters:
label the new label (i18n!)

Definition at line 137 of file kaccelaction.cpp.

References m_sLabel.

void KAccelAction::setWhatsThis const QString whatsThis  ) 
 

Sets the What's This text for the accelerator action.

Parameters:
whatsThis the new What's This text (i18n!)

Definition at line 139 of file kaccelaction.cpp.

References m_sWhatsThis.

bool KAccelAction::setShortcut const KShortcut rgCuts  ) 
 

Sets the new shortcut of the accelerator action.

Parameters:
rgCuts the shortcut to set
Returns:
true if successful, false otherwise

Definition at line 142 of file kaccelaction.cpp.

References m_cut.

Referenced by KAccel::insert(), KAccel::insertStdItem(), KAccelShortcutList::setShortcut(), and KAccelBase::setShortcut().

void KAccelAction::setSlot const QObject pObjSlot,
const char *  psMethodSlot
 

Sets the slot of the accelerator action.

Parameters:
pObjSlot the receiver object of the signal
psMethodSlot the slot for the signal

Definition at line 148 of file kaccelaction.cpp.

References m_pObjSlot, and m_psMethodSlot.

void KAccelAction::setConfigurable bool  configurable  ) 
 

Enables or disabled configuring the action.

Parameters:
configurable true to enable configurability, false to disable

Definition at line 154 of file kaccelaction.cpp.

References m_bConfigurable.

void KAccelAction::setEnabled bool  enable  ) 
 

Enables or disabled the action.

Parameters:
configurable true to enable the action, false to disable

Definition at line 156 of file kaccelaction.cpp.

References m_bEnabled.

Referenced by KAccelPrivate::setEnabled().

int KAccelAction::getID  )  const [inline]
 

Retrieves the id set using setID.

Returns:
the id of the accelerator action

Definition at line 265 of file kaccelaction.h.

Referenced by KAccelPrivate::removeAction().

void KAccelAction::setID int  n  )  [inline]
 

Allows you to set an id that will be used as the action signal's argument.

Parameters:
n the new id
See also:
getID()

Definition at line 274 of file kaccelaction.h.

bool KAccelAction::isConnected  )  const
 

Checkes whether the action is connected (emits signals).

Returns:
true if connected, false otherwise

Definition at line 192 of file kaccelaction.cpp.

Referenced by KAccelBase::setActionEnabled(), and KAccelBase::setActionSlot().

bool KAccelAction::setKeySequence uint  i,
const KKeySequence keySeq
 

Sets a key sequence of the action's shortcut.

Parameters:
i the position of the sequence
keySeq the new new sequence
Returns:
true if successful, false otherwise
See also:
KShortcut::setSeq()

Definition at line 165 of file kaccelaction.cpp.

References KShortcut::append(), KShortcut::count(), m_cut, and KShortcut::setSeq().

void KAccelAction::clearShortcut  ) 
 

Clears the action's shortcut.

It will not contain any sequences after calling this method.

See also:
KShortcut::clear()

Definition at line 175 of file kaccelaction.cpp.

References KShortcut::clear(), and m_cut.

bool KAccelAction::contains const KKeySequence keySeq  ) 
 

Checks whether the action's shortcut contains the given key sequence.

Parameters:
keySeq the key sequence to check
Returns:
true if the shortcut contains the given sequence
See also:
KShortcut::contains()

Definition at line 180 of file kaccelaction.cpp.

References KShortcut::contains(), KShortcut::count(), m_cut, and KShortcut::seq().

Referenced by KAccelActions::actionPtr().

QString KAccelAction::toString  )  const
 

Returns the string representation of the action's shortcut.

Returns:
the string representation of the action's shortcut.
See also:
KShortcut::toString()

Definition at line 159 of file kaccelaction.cpp.

References m_cut, and KShortcut::toString().

bool KAccelAction::useFourModifierKeys  )  [static]
 

Returns true if four modifier keys will be used.

Returns:
true if four modifier keys will be used.

Definition at line 202 of file kaccelaction.cpp.

References KGlobal::config(), KKeyNative::keyboardHasWinKey(), and KConfigBase::readBoolEntry().

Referenced by KStdAccel::shortcutDefault(), shortcutDefault(), and KGlobalAccel::useFourModifierKeys().

void KAccelAction::useFourModifierKeys bool  use  )  [static]
 

Selects 3 or 4 modifier default shortcuts.

Parameters:
use true to use 4 modifier shortcuts, false to use 3 modifier shortcuts

Definition at line 213 of file kaccelaction.cpp.

References KGlobal::config(), endl(), kdDebug(), KKeyNative::keyboardHasWinKey(), and KConfigBase::writeEntry().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdecore Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 8 06:22:12 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003