class KGlobalAccel

Configurable global shortcut support. More...

Definition#include <kglobalaccel.h>
InheritsQObject (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Protected Methods


Detailed Description

KGlobalAccel allows you to have global accelerators that are independent of the focused window. Unlike KAccel it does not matter which window is currently active.

See also: KAccel, KAccelShortcutList, KKeyChooser, KKeyDialog

 KGlobalAccel ( QObject* pParent, const char* psName = 0 )

KGlobalAccel

Creates a new KGlobalAccel object with the given pParent and psName.

Parameters:
pParentthe parent of the QObject
psNamethe name of the QObject

 ~KGlobalAccel ()

~KGlobalAccel

[virtual]

bool  isEnabled ()

isEnabled

Checks whether the accelerators are enabled.

Returns: true if the KGlobalAccel is enabled

void  setEnabled ( bool bEnabled )

setEnabled

Checks whether the accelerators are enabled.

Returns: true if the KGlobalAccel is enabled

KAccelAction*  insert ( const QString& sAction, const QString& sLabel, const QString& sWhatsThis, const KShortcut& cutDef3, const KShortcut& cutDef4, const QObject* pObjSlot, const char* psMethodSlot, bool bConfigurable = true, bool bEnabled = true )

insert

Create an accelerator action.

Usage:


 insert( "Do Something", i18n("Do Something"),
   i18n("This action allows you to do something really great with this program to "
        "the currently open document."),
   ALT+CTRL+Key_Q, KKey::QtWIN+CTRL+Key_Q, this, SLOT(slotDoSomething()) );

Parameters:
sActionThe internal name of the action.
sLabelAn i18n'ized short description of the action displayed when using KKeyChooser to reconfigure the shortcuts.
sWhatsThisAn extended description of the action.
cutDef3The default 3 modifier scheme shortcut.
cutDef4The default 4 modifier scheme shortcut.
pObjSlotPointer to the slot object.
psMethodSlotPointer to the slot method.
bConfigurableAllow the user to change this shortcut if set to 'true'.
bEnabledThe action will be activated by the shortcut if set to 'true'.

bool  remove ( const QString& sAction )

remove

Removes the accelerator action identified by the name. Remember to also call updateConnections().

Parameters:
sActionthe name of the action to remove

KAccelAction*  insert ( const QString& sName, const QString& sLabel )

insert

Use this to insert a label into the action list. This will be displayed when the user configures shortcuts.

Parameters:
sNameof the of the action to insert
sLabela user-readable (i18n!) name for the action

Returns: the KAccelAction of the action

bool  updateConnections ()

updateConnections

Updates the connections of the accelerations after changing them.

Returns: true if successful, false otherwise

const KShortcut&  shortcut ( const QString& sAction )

shortcut

[const]

Set the shortcut to be associated with the action named by sAction.

Parameters:
sActionthe name of the action

Returns: the shortcut. If the action does not exist a null shortcut will be returned.

bool  setShortcut ( const QString& sAction, const KShortcut &shortcut )

setShortcut

Set the shortcut to be associated with the action named by sAction.

Parameters:
sActionthe name of the action
shortcutthe shortcut for the action

Returns: true if successful, false otherwise

bool  setSlot ( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot )

setSlot

Set the slot to be called when the shortcut of the action named by sAction is pressed.

Parameters:
sActionthe name of the action
pObjSlotthe receiver of the signal
psMethodSlotthe slot to receive the signal

Returns: true if successful, false otherwise

bool  setEnabled ( const QString& sAction, bool bEnabled )

setEnabled

Enable or disable the action named by sAction.

Parameters:
sActionthe name of the action
bEnabledtrue to enable, false to disable

Returns: true if successful, false otherwise

const QString&  configGroup ()

configGroup

[const]

Returns the configuration group that is used to save the accelerators.

Returns: the configuration group

See also: KConfig

void  setConfigGroup ( const QString &cg )

setConfigGroup

Sets the configuration group that is used to save the accelerators.

Parameters:
cgthe configuration group

See also: KConfig

bool  readSettings ( KConfigBase* pConfig = 0 )

readSettings

Read all shortcuts from pConfig, or (if pConfig is zero) from the application's configuration file KGlobal::config().

Parameters:
pConfigthe configuration file to read from, or 0 for the application configuration file

Returns: true if successful, false otherwise

bool  writeSettings ( KConfigBase* pConfig = 0 )

writeSettings

[const]

Write the current shortcuts to pConfig, or (if pConfig is zero) to the application's configuration file.

Parameters:
pConfigthe configuration file to read from, or 0 for the application configuration file

Returns: true if successful, false otherwise

bool  writeSettings ( KConfigBase* pConfig, bool bGlobal )

writeSettings

[const]

Write the current shortcuts to pConfig, or (if pConfig is zero) to the application's configuration file. Alternatively, if bGlobal is true, then write to kdeglobals.

Parameters:
pConfigthe configuration file to read from, or 0 for the application configuration file
bGlobalif true write the configuration to the kde global settings

Returns: true if successful, false otherwise

bool  useFourModifierKeys ()

useFourModifierKeys

[static]

KAccelActions::useFourModifierKeys().

void  virtual_hook ( int id, void* data )

virtual_hook

[protected virtual]


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