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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • shortcuts
kglobalaccel.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org>
3  Copyright (C) 2006 Hamish Rodda <rodda@kde.org>
4  Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef _KGLOBALACCEL_H_
23 #define _KGLOBALACCEL_H_
24 
25 #include "kdeui_export.h"
26 #include "kaction.h"
27 #include "kglobalshortcutinfo.h"
28 
29 #include <QtCore/QObject>
30 
31 class QWidget;
32 class KShortcut;
33 class KComponentData;
34 class OrgKdeKglobalaccelComponentInterface;
35 
46 class KDEUI_EXPORT KGlobalAccel : public QObject
47 {
48  Q_OBJECT
49 
50 public:
51 
55  enum actionIdFields
56  {
57  ComponentUnique = 0,
58  ActionUnique = 1,
59  ComponentFriendly = 2,
60  ActionFriendly = 3
61  };
62 
66  static KGlobalAccel *self();
67 
74  static void stealShortcutSystemwide(const QKeySequence &seq);
75 
89  static void activateGlobalShortcutContext(
90  const QString &contextUnique,
91  const QString &contextFriendly,
92  const KComponentData &component = KGlobal::mainComponent());
93 
116  static bool cleanComponent(const QString &componentUnique);
117 
118 
125  static bool isComponentActive(const QString &componentName);
126 
136  static QList<KGlobalShortcutInfo> getGlobalShortcutsByKey(const QKeySequence &seq);
137 
146  static bool isGlobalShortcutAvailable(
147  const QKeySequence &seq,
148  const QString &component = QString());
149 
159  static bool promptStealShortcutSystemwide(
160  QWidget *parent,
161  const QList<KGlobalShortcutInfo> &shortcuts,
162  const QKeySequence &seq);
163 
169 #ifndef KDE_NO_DEPRECATED
170  KDE_DEPRECATED bool isEnabled() const;
171 #endif
172 
178 #ifndef KDE_NO_DEPRECATED
179  KDE_DEPRECATED void setEnabled(bool enabled);
180 #endif
181 
198 #ifndef KDE_NO_DEPRECATED
199  KDE_DEPRECATED void overrideMainComponentData(const KComponentData &componentData);
200 #endif
201 
208 #ifndef KDE_NO_DEPRECATED
209  KDE_DEPRECATED QList<QStringList> allMainComponents();
210 #endif
211 
217 #ifndef KDE_NO_DEPRECATED
218  KDE_DEPRECATED QList<QStringList> allActionsForComponent(const QStringList &actionId);
219 #endif
220 
226 #ifndef KDE_NO_DEPRECATED
227  KDE_DEPRECATED static QStringList findActionNameSystemwide(const QKeySequence &seq);
228 #endif
229 
235 #ifndef KDE_NO_DEPRECATED
236  KDE_DEPRECATED static bool promptStealShortcutSystemwide(QWidget *parent, const QStringList &actionIdentifier, const QKeySequence &seq);
237 #endif
238 
239 private:
240 
241  friend class KAction;
242 
244  KGlobalAccel();
245 
247  ~KGlobalAccel();
248 
250  OrgKdeKglobalaccelComponentInterface* getComponent(const QString &componentUnique);
251 
252  class KGlobalAccelPrivate *const d;
253 
254  Q_PRIVATE_SLOT(d, void _k_invokeAction(const QString &, const QString &, qlonglong))
255  Q_PRIVATE_SLOT(d, void _k_shortcutGotChanged(const QStringList&, const QList<int>&))
256  Q_PRIVATE_SLOT(d, void _k_serviceOwnerChanged(const QString&, const QString&, const QString&))
257 };
258 
259 #endif // _KGLOBALACCEL_H_
QWidget
KShortcut
Represents a keyboard shortcut.
Definition: kshortcut.h:57
kglobalshortcutinfo.h
QObject
KGlobalAccel::actionIdFields
actionIdFields
Index for actionId QStringLists.
Definition: kglobalaccel.h:55
QString
QList
QStringList
kaction.h
QKeySequence
KAction
Class to encapsulate user-driven action or event.
Definition: kaction.h:216
KGlobal::mainComponent
const KComponentData & mainComponent()
kdeui_export.h
KGlobalAccel
Configurable global shortcut support.
Definition: kglobalaccel.h:46
KComponentData
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal