class KAccelAction

An accelerator action. More...

Internal Use Only
Definition#include <kaccelaction.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Protected Methods

Protected Members


Detailed Description

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

 KAccelAction ()

KAccelAction

Creates an empty KAccelAction.

See also: clear()

 KAccelAction ( const KAccelAction& )

KAccelAction

Copy constructor.

 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

Creates a new KAccelAction.

Parameters:
sNamethe name of the accelerator
sLabelthe label of the accelerator (i18n!)
sWhatsThisthe What's This text (18n!)
cutDef3the default shortcut for 3 modifier systems
cutDef4the default shortcut for 4 modifier systems
pObjSlotthe receiver of a signal when the key has been pressed
psMethodSlotthe slot to connect for key presses. Receives an int, as set by setID(), as only argument
bConfigurableif true the user can configure the shortcut
bEnabledtrue if the accelerator should be enabled

 ~KAccelAction ()

~KAccelAction

void  clear ()

clear

Clears the accelerator.

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 )

init

Re-initialized the KAccelAction.

Parameters:
sNamethe name of the accelerator
sLabelthe label of the accelerator (i18n!)
sWhatsThisthe What's This text (18n!)
cutDef3the default shortcut for 3 modifier systems
cutDef4the default shortcut for 4 modifier systems
pObjSlotthe receiver of a signal when the key has been pressed
psMethodSlotthe slot to connect for key presses. Receives an int, as set by setID(), as only argument
bConfigurableif true the user can configure the shortcut
bEnabledtrue if the accelerator should be enabled

Returns: true if successful, false otherwise

KAccelAction&  operator= ( const KAccelAction& )

operator=

Copies this KAccelAction.

const QString&  name ()

name

[const]

Returns the name of the accelerator action.

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

const QString&  label ()

label

[const]

Returns the label of the accelerator action.

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

const QString&  whatsThis ()

whatsThis

[const]

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

const KShortcut&  shortcut ()

shortcut

[const]

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()

const KShortcut&  shortcutDefault ()

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()

const KShortcut&  shortcutDefault3 ()

shortcutDefault3

[const]

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()

const KShortcut&  shortcutDefault4 ()

shortcutDefault4

[const]

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()

const QObject*  objSlotPtr ()

objSlotPtr

[const]

Returns the receiver of signals.

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

const char*  methodSlotPtr ()

methodSlotPtr

[const]

Returns the slot for the signal.

Returns: the slot for the signal

bool  isConfigurable ()

isConfigurable

[const]

Checks whether the user can configure the action.

Returns: true if configurable, false otherwise

bool  isEnabled ()

isEnabled

[const]

Checks whether the action is enabled.

Returns: true if enabled, false otherwise

void  setName ( const QString& name )

setName

Sets the name of the accelerator action.

Parameters:
namethe new name

void  setLabel ( const QString& label )

setLabel

Sets the user-readable label of the accelerator action.

Parameters:
labelthe new label (i18n!)

void  setWhatsThis ( const QString& whatsThis )

setWhatsThis

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

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

bool  setShortcut ( const KShortcut& rgCuts )

setShortcut

Sets the new shortcut of the accelerator action.

Parameters:
rgCutsthe shortcut to set

Returns: true if successful, false otherwise

void  setSlot ( const QObject* pObjSlot, const char* psMethodSlot )

setSlot

Sets the slot of the accelerator action.

Parameters:
pObjSlotthe receiver object of the signal
psMethodSlotthe slot for the signal

void  setConfigurable ( bool configurable )

setConfigurable

Enables or disabled configuring the action.

Parameters:
configurabletrue to enable configurability, false to disable

void  setEnabled ( bool enable )

setEnabled

Enables or disabled the action.

Parameters:
configurabletrue to enable the action, false to disable

int  getID ()

getID

[const]

Retrieves the id set using setID.

Returns: the id of the accelerator action

void  setID ( int n )

setID

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

Parameters:
nthe new id

See also: @ref, getID()

bool  isConnected ()

isConnected

[const]

Checkes whether the action is connected (emits signals).

Returns: true if connected, false otherwise

bool  setKeySequence ( uint i, const KKeySequence &keySeq )

setKeySequence

Sets a key sequence of the action's shortcut.

Parameters:
ithe position of the sequence
keySeqthe new new sequence

Returns: true if successful, false otherwise

See also: KShortcut::setSeq()

void  clearShortcut ()

clearShortcut

Clears the action's shortcut. It will not contain any sequences after calling this method.

See also: KShortcut::clear()

bool  contains ( const KKeySequence &keySeq )

contains

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

Parameters:
keySeqthe key sequence to check

Returns: true if the shortcut contains the given sequence

See also: KShortcut::contains()

QString  toString ()

toString

[const]

Returns the string representation of the action's shortcut.

Returns: the string representation of the action's shortcut.

See also: KShortcut::toString()

QString  toStringInternal ()

toStringInternal

[const]

bool  useFourModifierKeys ()

useFourModifierKeys

[static]

Returns true if four modifier keys will be used.

Returns: true if four modifier keys will be used.

void  useFourModifierKeys ( bool use )

useFourModifierKeys

[static]

Selects 3 or 4 modifier default shortcuts.

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

QString m_sName

m_sName

[protected]

QString m_sLabel

m_sLabel

[protected]

QString m_sWhatsThis

m_sWhatsThis

[protected]

KShortcut m_cut

m_cut

[protected]

KShortcut m_cutDefault3

m_cutDefault3

[protected]

KShortcut m_cutDefault4

m_cutDefault4

[protected]

const QObject* m_pObjSlot

m_pObjSlot

[protected]

const char* m_psMethodSlot

m_psMethodSlot

[protected]

bool m_bConfigurable

m_bConfigurable

[protected]

bool m_bEnabled

m_bEnabled

[protected]

int m_nIDAccel

m_nIDAccel

[protected]

uint m_nConnections

m_nConnections

[protected]

void  incConnections ()

incConnections

[protected]

void  decConnections ()

decConnections

[protected]


Generated by: caleb on tcdevel on Tue Jan 28 12:54:04 2003, using kdoc $.