KConfig

kstandardshortcutwatcher.h
1 /*
2  SPDX-FileCopyrightText: 2022 David Redondo <kde@david-redondo.de>
3 
4  SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #ifndef KSTANDARDSHORTCUTWATCHER_H
8 #define KSTANDARDSHORTCUTWATCHER_H
9 
10 #include "kstandardshortcut.h"
11 
12 #include <QObject>
13 
14 #include <memory>
15 
16 #include <kconfiggui_export.h>
17 
18 namespace KStandardShortcut
19 {
20 class StandardShortcutWatcherPrivate;
21 
22 /**
23  * Watches for changes made to standard shortcuts and notifies about those changes.
24  * @see KStandardShortcut::shortcutWatcher
25  * @since 5.91
26  */
27 class KCONFIGGUI_EXPORT StandardShortcutWatcher : public QObject
28 {
29  Q_OBJECT
30 public:
32 Q_SIGNALS:
33  /**
34  * The standardshortcut @p id was changed to @p shortcut
35  */
36  void shortcutChanged(KStandardShortcut::StandardShortcut id, const QList<QKeySequence> &shortcut);
37 
38 private:
39  KCONFIGGUI_NO_EXPORT explicit StandardShortcutWatcher(QObject *parent = nullptr);
40 
41  friend KCONFIGGUI_EXPORT StandardShortcutWatcher *shortcutWatcher();
42  std::unique_ptr<StandardShortcutWatcherPrivate> d;
43 };
44 
45 /**
46  * Returns the global KStandardShortcutWatcher instance of this program.
47  * In addition to the notifying about changes it also keeps the information returned by the
48  * functions in @p KStandardShortcut up to date.
49  * The object is created by the first call to this function.
50  * @since 5.91
51  */
52 KCONFIGGUI_EXPORT StandardShortcutWatcher *shortcutWatcher();
53 }
54 
55 #endif
const QList< QKeySequence > & shortcut(StandardShortcut id)
Returns the keybinding for accel.
StandardShortcut
Defines the identifier of all standard accelerators.
StandardShortcutWatcher * shortcutWatcher()
Returns the global KStandardShortcutWatcher instance of this program.
Watches for changes made to standard shortcuts and notifies about those changes.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 04:07:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.