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

KDEUI

KGlobalAccel Class Reference

Configurable global shortcut support. More...

#include <kglobalaccel.h>

Inheritance diagram for KGlobalAccel:

Inheritance graph
[legend]

List of all members.


Public Types

enum  actionIdFields { ComponentUnique = 0, ActionUnique = 1, ComponentFriendly = 2, ActionFriendly = 3 }

Public Member Functions

KDE_DEPRECATED QList< QStringList > allActionsForComponent (const QStringList &actionId)
KDE_DEPRECATED QList< QStringList > allMainComponents ()
KDE_DEPRECATED bool isEnabled () const
KDE_DEPRECATED void overrideMainComponentData (const KComponentData &componentData)
KDE_DEPRECATED void setEnabled (bool enabled)

Static Public Member Functions

static void activateGlobalShortcutContext (const QString &contextUnique, const QString &contextFriendly, const KComponentData &component=KGlobal::mainComponent())
static KDE_DEPRECATED QStringList findActionNameSystemwide (const QKeySequence &seq)
static QList< KGlobalShortcutInfo > getGlobalShortcutsByKey (const QKeySequence &seq)
static bool isGlobalShortcutAvailable (const QKeySequence &seq, const QString &component=QString())
static KDE_DEPRECATED bool promptStealShortcutSystemwide (QWidget *parent, const QStringList &actionIdentifier, const QKeySequence &seq)
static bool promptStealShortcutSystemwide (QWidget *parent, const QList< KGlobalShortcutInfo > &shortcuts, const QKeySequence &seq)
static KGlobalAccel * self ()
static void stealShortcutSystemwide (const QKeySequence &seq)

Detailed Description

Configurable global shortcut support.

KGlobalAccel allows you to have global accelerators that are independent of the focused window. Unlike regular shortcuts, the application's window does not need focus for them to be activated.

See also:
KKeyChooser

KKeyDialog

Definition at line 45 of file kglobalaccel.h.


Member Enumeration Documentation

enum KGlobalAccel::actionIdFields

Index for actionId QStringLists.

Enumerator:
ComponentUnique  Components Unique Name (ID).
ActionUnique  Actions Unique Name(ID).
ComponentFriendly  Components Friendly Translated Name.
ActionFriendly  Actions Friendly Translated Name.

Definition at line 54 of file kglobalaccel.h.


Member Function Documentation

void KGlobalAccel::activateGlobalShortcutContext ( const QString &  contextUnique,
const QString &  contextFriendly,
const KComponentData &  component = KGlobal::mainComponent() 
) [static]

Set global shortcut context.

A global shortcut context allows an application to have different sets of global shortcuts and to switch between them. This is used by plasma to switch the active global shortcuts when switching between activities.

Parameters:
component the name of the component. KComponentData::componentName
context the name of the context.
Since:
4.2

Definition at line 94 of file kglobalaccel.cpp.

QList< QStringList > KGlobalAccel::allActionsForComponent ( const QStringList &  actionId  ) 

See also:
getGlobalShortcutsByComponent
Deprecated:

Definition at line 384 of file kglobalaccel.cpp.

QList< QStringList > KGlobalAccel::allMainComponents (  ) 

Return the unique and common names of all main components that have global shortcuts.

The action strings of the returned actionId stringlists will be empty.

Deprecated:

Definition at line 378 of file kglobalaccel.cpp.

QStringList KGlobalAccel::findActionNameSystemwide ( const QKeySequence &  seq  )  [static]

See also:
getGlobalShortcutsByKey
Deprecated:

Definition at line 391 of file kglobalaccel.cpp.

QList< KGlobalShortcutInfo > KGlobalAccel::getGlobalShortcutsByKey ( const QKeySequence &  seq  )  [static]

Returns a list of global shortcuts registered for the shortcut .

If the list contains more that one entry it means the component that registered the shortcuts uses global shortcut contexts. All returned shortcuts belong to the same component.

Since:
4.2

Definition at line 397 of file kglobalaccel.cpp.

bool KGlobalAccel::isEnabled (  )  const

No effect.

Deprecated:

Definition at line 104 of file kglobalaccel.cpp.

bool KGlobalAccel::isGlobalShortcutAvailable ( const QKeySequence &  seq,
const QString &  component = QString() 
) [static]

Check if the shortcut is available for the component.

The component is only of interest if the current application uses global shortcut contexts. In that case a global shortcut by component in an inactive global shortcut contexts does not block the seq for us.

Since:
4.2

Definition at line 403 of file kglobalaccel.cpp.

void KGlobalAccel::overrideMainComponentData ( const KComponentData &  componentData  ) 

Set the KComponentData for which to manipulate shortcuts.

This is for exceptional situations, when you want to modify the shortcuts of another application as if they were yours. You cannot have your own working global shortcuts in a module/application using this special functionality. All global shortcuts of KActions will essentially be proxies. Be sure to set the default global shortcuts of the proxy KActions to the same as those on the receiving end. An example use case is the KControl Module for the window manager KWin, which has no own facility for users to change its global shortcuts.

Parameters:
componentData a KComponentData about the application for which you want to manipulate shortcuts.
Deprecated:

Definition at line 116 of file kglobalaccel.cpp.

bool KGlobalAccel::promptStealShortcutSystemwide ( QWidget *  parent,
const QStringList &  actionIdentifier,
const QKeySequence &  seq 
) [static]

See also:
promptStealShortcutSystemwide below
Deprecated:

Definition at line 410 of file kglobalaccel.cpp.

bool KGlobalAccel::promptStealShortcutSystemwide ( QWidget *  parent,
const QList< KGlobalShortcutInfo > &  shortcuts,
const QKeySequence &  seq 
) [static]

Show a messagebox to inform the user that a global shorcut is already occupied, and ask to take it away from its current action(s).

This is GUI only, so nothing will be actually changed.

See also:
stealShortcutSystemwide()
Since:
4.2

Definition at line 429 of file kglobalaccel.cpp.

KGlobalAccel * KGlobalAccel::self (  )  [static]

Returns (and creates if necessary) the singleton instance.

Definition at line 123 of file kglobalaccel.cpp.

void KGlobalAccel::setEnabled ( bool  enabled  ) 

No effect.

Deprecated:

Definition at line 110 of file kglobalaccel.cpp.

void KGlobalAccel::stealShortcutSystemwide ( const QKeySequence &  seq  )  [static]

Take away the given shortcut from the named action it belongs to.

This applies to all actions with global shortcuts in any KDE application.

See also:
promptStealShortcutSystemwide()

Definition at line 468 of file kglobalaccel.cpp.


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

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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