• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDECore

KAccelAction Class Reference

An accelerator action. More...

#include <kaccelaction.h>

List of all members.


Public Member Functions

void clear ()
void clearShortcut ()
bool contains (const KKeySequence &keySeq)
int getID () const
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)
bool isConfigurable () const
bool isConnected () const
bool isEnabled () const
 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 (const KAccelAction &)
 KAccelAction ()
const QString & label () const
const char * methodSlotPtr () const
const QString & name () const
const QObject * objSlotPtr () const
KAccelAction & operator= (const KAccelAction &)
void setConfigurable (bool configurable)
void setEnabled (bool enable)
void setID (int n)
bool setKeySequence (uint i, const KKeySequence &keySeq)
void setLabel (const QString &label)
void setName (const QString &name)
bool setShortcut (const KShortcut &rgCuts)
void setSlot (const QObject *pObjSlot, const char *psMethodSlot)
void setWhatsThis (const QString &whatsThis)
const KShortcut & shortcut () const
const KShortcut & shortcutDefault () const
const KShortcut & shortcutDefault3 () const
const KShortcut & shortcutDefault4 () const
QString toString () const
QString toStringInternal () const
const QString & whatsThis () const
 ~KAccelAction ()

Static Public Member Functions

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

Protected Member Functions

void decConnections ()
void incConnections ()

Protected Attributes

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

Detailed Description

An accelerator action.

For internal use only.

A KAccelAction prepresents an action that can be executed using an accelerator key. Each KAccelAction has a name, a label, a "What's this" string and a KShortcut. The user can configure and enable/disable them using KKeyDialog.

    1) KAccelAction = "Run Command"
        Default3 = "Alt+F2"
        Default4 = "Meta+Enter;Alt+F2"
        1) KShortcut = "Meta+Enter"
            1) KKeySequence = "Meta+Enter"
                1) KKey = "Meta+Enter"
                    1) Meta+Enter
                    2) Meta+Keypad_Enter
        2) KShortcut = "Alt+F2"
            1) KKeySequence = "Alt+F2"
                1) Alt+F2
    2) KAccelAction = "Something"
        Default3 = ""
        Default4 = ""
        1) KShortcut = "Meta+X,Asterisk"
            1) KKeySequence = "Meta+X,Asterisk"
                1) KKey = "Meta+X"
                    1) Meta+X
                2) KKey = "Asterisk"
                    1) Shift+8 (English layout)
                    2) Keypad_Asterisk
See also:
KAccel

KGlobalAccel

KKeyChooser

KKeyDialog

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.

KAccelAction::KAccelAction ( const KAccelAction &  action  ) 

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.

KAccelAction::~KAccelAction (  ) 

Definition at line 78 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.

void KAccelAction::decConnections (  )  [protected]

For internal use only.

Decrement the number of connections to this accel (bouded by zero).

Definition at line 196 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.

void KAccelAction::incConnections (  )  [protected]

For internal use only.

Increment the number of connections to this accel.

Definition at line 194 of file kaccelaction.cpp.

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 &  action  ) 

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.

QString KAccelAction::toStringInternal (  )  const

For internal use only.

Definition at line 162 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

bool KAccelAction::m_bConfigurable [protected]

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

KShortcut KAccelAction::m_cut [protected]

< Shortcut actually assigned.

Definition at line 335 of file kaccelaction.h.

KShortcut KAccelAction::m_cutDefault3 [protected]

< Default shortcut in 3-modifier layout

Definition at line 336 of file kaccelaction.h.

KShortcut KAccelAction::m_cutDefault4 [protected]

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

QString KAccelAction::m_sLabel [protected]

< Label of accel.

User-visible.

Definition at line 332 of file kaccelaction.h.

QString KAccelAction::m_sName [protected]

< Name of accel.

See also:
setName()

Definition at line 332 of file kaccelaction.h.

QString KAccelAction::m_sWhatsThis [protected]

< 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:
  • kaccelaction.h
  • kaccelaction.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal