KAccelAction Class Reference

List of all members.

Detailed Description

Definition at line 72 of file kaccelaction.h.


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

Constructor & Destructor Documentation

KAccelAction::KAccelAction (  ) 

Creates an empty KAccelAction.

See also:
clear()

Definition at line 46 of file kaccelaction.cpp.

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.


Member Function Documentation

void KAccelAction::clear (  ) 

Clears the accelerator.

Definition at line 84 of file kaccelaction.cpp.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

KAccelAction & KAccelAction::operator= ( const KAccelAction  ) 

Copies this KAccelAction.

Definition at line 117 of file kaccelaction.cpp.

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.

void KAccelAction::setEnabled ( bool  enable  ) 

Enables or disabled the action.

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

Definition at line 156 of file kaccelaction.cpp.

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.


Member Data Documentation

< Can this accel be configured by the user?

Definition at line 340 of file kaccelaction.h.

bool KAccelAction::m_bEnabled [protected]

< Is this accel enabled?

Definition at line 340 of file kaccelaction.h.

< Shortcut actually assigned.

Definition at line 335 of file kaccelaction.h.

< Default shortcut in 3-modifier layout

Definition at line 336 of file kaccelaction.h.

< Default shortcur in 4-modifier layout

Definition at line 336 of file kaccelaction.h.

uint KAccelAction::m_nConnections [protected]

< Number of connections to this accel.

Definition at line 343 of file kaccelaction.h.

int KAccelAction::m_nIDAccel [protected]

< Id of this accel, from the list of IDs

Definition at line 342 of file kaccelaction.h.

const QObject* KAccelAction::m_pObjSlot [protected]

< Object we will send signals to.

Definition at line 338 of file kaccelaction.h.

const char* KAccelAction::m_psMethodSlot [protected]

< Slot we send signals to, in m_pObjSlot

Definition at line 339 of file kaccelaction.h.

< Label of accel.

User-visible.

Definition at line 332 of file kaccelaction.h.

< Name of accel.

See also:
setName()

Definition at line 332 of file kaccelaction.h.

< WhatsThis help for accel.

User-visible.

Definition at line 332 of file kaccelaction.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys