• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
TDEGlobalAccel Class Reference

#include <tdeglobalaccel.h>

Inherits TQObject.

Public Member Functions

 TDEGlobalAccel (TQObject *pParent, const char *psName=0)
 
bool isEnabled ()
 
void setEnabled (bool bEnabled)
 
TDEAccelAction * insert (const TQString &sAction, const TQString &sLabel, const TQString &sWhatsThis, const TDEShortcut &cutDef3, const TDEShortcut &cutDef4, const TQObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true)
 
bool remove (const TQString &sAction)
 
TDEAccelAction * insert (const TQString &sName, const TQString &sLabel)
 
bool updateConnections ()
 
const TDEShortcut & shortcut (const TQString &sAction) const
 
bool setShortcut (const TQString &sAction, const TDEShortcut &shortcut)
 
bool setSlot (const TQString &sAction, const TQObject *pObjSlot, const char *psMethodSlot)
 
bool setActionEnabled (const TQString &sAction, bool bEnable)
 
TQString label (const TQString &sAction) const
 
const TQString & configGroup () const
 
void setConfigGroup (const TQString &cg)
 
bool readSettings (TDEConfigBase *pConfig=0)
 
bool writeSettings (TDEConfigBase *pConfig=0) const
 
bool writeSettings (TDEConfigBase *pConfig, bool bGlobal) const
 
void disableBlocking (bool disable)
 
void suspend (bool s)
 

Static Public Member Functions

static bool useFourModifierKeys ()
 
static void blockShortcuts (bool block)
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Friends

class TDEGlobalAccelPrivate
 
class TDEAccelShortcutList
 

Detailed Description

TDEGlobalAccel allows you to have global accelerators that are independent of the focused window.

Unlike TDEAccel it does not matter which window is currently active.

See also
TDEAccel
TDEAccelShortcutList
KKeyChooser
KKeyDialog

Configurable global shortcut support

Definition at line 45 of file tdeglobalaccel.h.

Constructor & Destructor Documentation

◆ TDEGlobalAccel()

TDEGlobalAccel::TDEGlobalAccel ( TQObject *  pParent,
const char *  psName = 0 
)

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

Parameters
pParentthe parent of the TQObject
psNamethe name of the TQObject

Definition at line 39 of file tdeglobalaccel.cpp.

◆ ~TDEGlobalAccel()

TDEGlobalAccel::~TDEGlobalAccel ( )
virtual

Definition at line 46 of file tdeglobalaccel.cpp.

Member Function Documentation

◆ blockShortcuts()

void TDEGlobalAccel::blockShortcuts ( bool  block)
static

Definition at line 71 of file tdeglobalaccel.cpp.

◆ configGroup()

const TQString & TDEGlobalAccel::configGroup ( ) const

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

Returns
the configuration group
See also
TDEConfig

Definition at line 116 of file tdeglobalaccel.cpp.

◆ disableBlocking()

void TDEGlobalAccel::disableBlocking ( bool  disable)

Definition at line 74 of file tdeglobalaccel.cpp.

◆ insert() [1/2]

TDEAccelAction * TDEGlobalAccel::insert ( const TQString &  sAction,
const TQString &  sLabel,
const TQString &  sWhatsThis,
const TDEShortcut &  cutDef3,
const TDEShortcut &  cutDef4,
const TQObject *  pObjSlot,
const char *  psMethodSlot,
bool  bConfigurable = true,
bool  bEnabled = true 
)

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, TQ_SLOT(slotDoSomething()) );
TDEGlobalAccel::insert
TDEAccelAction * insert(const TQString &sAction, const TQString &sLabel, const TQString &sWhatsThis, const TDEShortcut &cutDef3, const TDEShortcut &cutDef4, const TQObject *pObjSlot, const char *psMethodSlot, bool bConfigurable=true, bool bEnabled=true)
Create an accelerator action.
Definition: tdeglobalaccel.cpp:77
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'.

Definition at line 77 of file tdeglobalaccel.cpp.

◆ insert() [2/2]

TDEAccelAction * TDEGlobalAccel::insert ( const TQString &  sName,
const TQString &  sLabel 
)

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 TDEAccelAction of the action

Definition at line 88 of file tdeglobalaccel.cpp.

◆ isEnabled()

bool TDEGlobalAccel::isEnabled ( )

Checks whether the accelerators are enabled.

Returns
true if the TDEGlobalAccel is enabled

Definition at line 62 of file tdeglobalaccel.cpp.

◆ label()

TQString TDEGlobalAccel::label ( const TQString &  sAction) const

Return the label (i18n'ized short description) associated with the action named by sAction.

Parameters
sActionthe name of the action
Returns
the label
Since
3.3

Definition at line 106 of file tdeglobalaccel.cpp.

◆ readSettings()

bool TDEGlobalAccel::readSettings ( TDEConfigBase *  pConfig = 0)

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

Parameters
pConfigthe configuration file to read from, or 0 for the application configuration file
Returns
true if successful, false otherwise

Definition at line 122 of file tdeglobalaccel.cpp.

◆ remove()

bool TDEGlobalAccel::remove ( const TQString &  sAction)

Removes the accelerator action identified by the name.

Remember to also call updateConnections().

Parameters
sActionthe name of the action to remove
Since
3.1

Definition at line 93 of file tdeglobalaccel.cpp.

◆ setActionEnabled()

bool TDEGlobalAccel::setActionEnabled ( const TQString &  sAction,
bool  bEnable 
)

Enables or disables action sAction.

Since
3.4

Definition at line 111 of file tdeglobalaccel.cpp.

◆ setConfigGroup()

void TDEGlobalAccel::setConfigGroup ( const TQString &  cg)

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

Parameters
cgthe configuration group
See also
TDEConfig

Definition at line 119 of file tdeglobalaccel.cpp.

◆ setEnabled()

void TDEGlobalAccel::setEnabled ( bool  bEnabled)

Enables or disables the TDEGlobalAccel.

Parameters
bEnabledtrue if the TDEGlobalAccel should be enabled, false if it should be disabled.

Definition at line 65 of file tdeglobalaccel.cpp.

◆ setShortcut()

bool TDEGlobalAccel::setShortcut ( const TQString &  sAction,
const TDEShortcut &  shortcut 
)

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

Definition at line 102 of file tdeglobalaccel.cpp.

◆ setSlot()

bool TDEGlobalAccel::setSlot ( const TQString &  sAction,
const TQObject *  pObjSlot,
const char *  psMethodSlot 
)

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

Definition at line 104 of file tdeglobalaccel.cpp.

◆ shortcut()

const TDEShortcut & TDEGlobalAccel::shortcut ( const TQString &  sAction) const

Return the shortcut 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.

Definition at line 96 of file tdeglobalaccel.cpp.

◆ suspend()

void TDEGlobalAccel::suspend ( bool  s)

Definition at line 68 of file tdeglobalaccel.cpp.

◆ updateConnections()

bool TDEGlobalAccel::updateConnections ( )

Updates the connections of the accelerations after changing them.

Returns
true if successful, false otherwise

Definition at line 90 of file tdeglobalaccel.cpp.

◆ useFourModifierKeys()

bool TDEGlobalAccel::useFourModifierKeys ( )
static

Definition at line 133 of file tdeglobalaccel.cpp.

◆ virtual_hook()

void TDEGlobalAccel::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 136 of file tdeglobalaccel.cpp.

◆ writeSettings() [1/2]

bool TDEGlobalAccel::writeSettings ( TDEConfigBase *  pConfig,
bool  bGlobal 
) 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

Definition at line 126 of file tdeglobalaccel.cpp.

◆ writeSettings() [2/2]

bool TDEGlobalAccel::writeSettings ( TDEConfigBase *  pConfig = 0) 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
Since
3.1

Definition at line 124 of file tdeglobalaccel.cpp.

Friends And Related Function Documentation

◆ TDEAccelShortcutList

friend class TDEAccelShortcutList
friend

Definition at line 231 of file tdeglobalaccel.h.

◆ TDEGlobalAccelPrivate

friend class TDEGlobalAccelPrivate
friend

Definition at line 230 of file tdeglobalaccel.h.


The documentation for this class was generated from the following files:
  • tdeglobalaccel.h
  • tdeglobalaccel.cpp

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.