KAccelBase Class Reference
Inheritance diagram for KAccelBase:

Detailed Description
Definition at line 121 of file kaccelbase.h.
Public Types | |
| QT_KEYS = 0x00 | |
| NATIVE_KEYS = 0x01 | |
| KEYCODE_CHANGED | |
| enum | Init { QT_KEYS = 0x00, NATIVE_KEYS = 0x01 } |
| enum | Signal { KEYCODE_CHANGED } |
Public Member Functions | |
| KAccelBase (int fInitCode) | |
| virtual | ~KAccelBase () |
| uint | actionCount () const |
| KAccelActions & | actions () |
| bool | isEnabled () const |
| KAccelAction * | actionPtr (const QString &sAction) |
| const KAccelAction * | actionPtr (const QString &sAction) const |
| KAccelAction * | actionPtr (const KKey &key) |
| KAccelAction * | actionPtr (const KKeyServer::Key &key) |
| const QString & | configGroup () const |
| void | setConfigGroup (const QString &group) |
| void | setConfigGlobal (bool global) |
| virtual void | setEnabled (bool bEnabled)=0 |
| bool | getAutoUpdate () |
| bool | setAutoUpdate (bool bAuto) |
| KAccelAction * | insert (const QString &sName, const QString &sDesc) |
| KAccelAction * | insert (const QString &sAction, const QString &sDesc, const QString &sHelp, const KShortcut &rgCutDefaults3, const KShortcut &rgCutDefaults4, const QObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true) |
| bool | remove (const QString &sAction) |
| bool | setActionSlot (const QString &sAction, const QObject *pObjSlot, const char *psMethodSlot) |
| bool | updateConnections () |
| bool | setShortcut (const QString &sAction, const KShortcut &cut) |
| bool | setActionEnabled (const QString &sAction, bool bEnable) |
| void | readSettings (KConfigBase *pConfig=0) |
| void | writeSettings (KConfigBase *pConfig=0) const |
| QPopupMenu * | createPopupMenu (QWidget *pParent, const KKeySequence &) |
Protected Types | |
|
typedef QMap< KKeyServer::Key, ActionInfo > | KKeyToActionMap |
Protected Member Functions | |
| void | slotRemoveAction (KAccelAction *) |
| void | createKeyList (QValueVector< struct X > &rgKeys) |
| bool | insertConnection (KAccelAction *) |
| bool | removeConnection (KAccelAction *) |
| virtual bool | emitSignal (Signal signal)=0 |
| virtual bool | connectKey (KAccelAction &action, const KKeyServer::Key &key)=0 |
| virtual bool | connectKey (const KKeyServer::Key &key)=0 |
| virtual bool | disconnectKey (KAccelAction &, const KKeyServer::Key &)=0 |
| virtual bool | disconnectKey (const KKeyServer::Key &)=0 |
| virtual bool | isEnabledInternal () const |
Protected Attributes | |
| KAccelActions | m_rgActions |
| KKeyToActionMap | m_mapKeyToAction |
| QValueList< KAccelAction * > | m_rgActionsNonUnique |
| bool | m_bNativeKeys |
| bool | m_bEnabled |
| bool | m_bConfigIsGlobal |
| QString | m_sConfigGroup |
| bool | m_bAutoUpdate |
| KAccelAction * | mtemp_pActionRemoving |
Friends | |
| class | KAccelActions |
Classes | |
| struct | ActionInfo |
Member Enumeration Documentation
| enum KAccelBase::Init |
Initialization mode of the KAccelBase, used in constructor.
Definition at line 125 of file kaccelbase.h.
| enum KAccelBase::Signal |
Constructor & Destructor Documentation
| KAccelBase::KAccelBase | ( | int | fInitCode | ) |
Constructor.
fInitCode should be a bitwise OR of values from the Init enum.
Definition at line 46 of file kaccelbase.cpp.
Member Function Documentation
| uint KAccelBase::actionCount | ( | ) | const |
| KAccelAction * KAccelBase::actionPtr | ( | const KKeyServer::Key & | key | ) |
Basically the same as above, except a KKeyServer::Key already has a key mapping defined (either NATIVE_KEYS or not).
Definition at line 78 of file kaccelbase.cpp.
| KAccelAction * KAccelBase::actionPtr | ( | const KKey & | key | ) |
Returns a pointer to the KAccelAction associated with the key key.
This function takes into account the key mapping defined in the constructor.
May return 0 if no (or more than one) action is associated with the key.
Definition at line 86 of file kaccelbase.cpp.
| const KAccelAction * KAccelBase::actionPtr | ( | const QString & | sAction | ) | const |
| KAccelAction * KAccelBase::actionPtr | ( | const QString & | sAction | ) |
| KAccelActions & KAccelBase::actions | ( | ) |
| const QString& KAccelBase::configGroup | ( | ) | const [inline] |
Returns the name of the configuration group these accelerators are stored in.
The default is "Shortcuts".
Definition at line 163 of file kaccelbase.h.
| virtual bool KAccelBase::connectKey | ( | const KKeyServer::Key & | key | ) | [protected, pure virtual] |
Defines a key which activates the accelerator.
- Parameters:
-
key key which causes the action to be executed
Implemented in KAccelPrivate, KGlobalAccelPrivate, KGlobalAccelPrivate, and KGlobalAccelPrivate.
| virtual bool KAccelBase::connectKey | ( | KAccelAction & | action, | |
| const KKeyServer::Key & | key | |||
| ) | [protected, pure virtual] |
Defines a key which activates the accelerator and executes the action.
- Parameters:
-
action action to be executed when key is pressed key key which causes the action to be executed
Implemented in KAccelPrivate, KGlobalAccelPrivate, KGlobalAccelPrivate, and KGlobalAccelPrivate.
| void KAccelBase::createKeyList | ( | QValueVector< struct X > & | rgKeys | ) | [protected] |
Constructs a list of keys to be connected, sorted highest priority first.
- Parameters:
-
rgKeys constructed list of keys
| virtual bool KAccelBase::disconnectKey | ( | const KKeyServer::Key & | ) | [protected, pure virtual] |
Removes the key from accelerator.
Implemented in KAccelPrivate, KGlobalAccelPrivate, KGlobalAccelPrivate, and KGlobalAccelPrivate.
| virtual bool KAccelBase::disconnectKey | ( | KAccelAction & | , | |
| const KKeyServer::Key & | ||||
| ) | [protected, pure virtual] |
Removes the key from accelerator so it no longer executes the action.
Implemented in KAccelPrivate, KGlobalAccelPrivate, KGlobalAccelPrivate, and KGlobalAccelPrivate.
| virtual bool KAccelBase::emitSignal | ( | Signal | signal | ) | [protected, pure virtual] |
| bool KAccelBase::getAutoUpdate | ( | ) | [inline] |
Returns whether autoupdate is enabled for these accelerators.
Definition at line 175 of file kaccelbase.h.
| bool KAccelBase::isEnabled | ( | ) | const |
Returns whether this accelerator handler is enabled or not.
Definition at line 65 of file kaccelbase.cpp.
| void KAccelBase::readSettings | ( | KConfigBase * | pConfig = 0 |
) |
Read all key associations from config, or (if config is zero) from the application's configuration file KGlobal::config().
The group in which the configuration is stored can be set with setConfigGroup().
Definition at line 567 of file kaccelbase.cpp.
| bool KAccelBase::setAutoUpdate | ( | bool | bAuto | ) |
Enables (or disables) autoupdate for these accelerators.
- Returns:
- the value of autoupdate before the call.
Definition at line 119 of file kaccelbase.cpp.
| void KAccelBase::setConfigGroup | ( | const QString & | group | ) |
Set the group (in the configuration file) for storing accelerators.
Definition at line 93 of file kaccelbase.cpp.
| virtual void KAccelBase::setEnabled | ( | bool | bEnabled | ) | [pure virtual] |
Enables or disables the accelerator.
- Parameters:
-
bEnabled determines whether the accelerator should be enabled or disabled.
Implemented in KAccelPrivate, and KGlobalAccelPrivate.
| void KAccelBase::writeSettings | ( | KConfigBase * | pConfig = 0 |
) | const |
Write the current configurable associations to config, or (if config is zero) to the application's configuration file.
Definition at line 574 of file kaccelbase.cpp.
The documentation for this class was generated from the following files:

