1 | /* |
2 | SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.0-or-later |
5 | */ |
6 | |
7 | #ifndef KGLOBALSHORTCUTINFO_H |
8 | #define KGLOBALSHORTCUTINFO_H |
9 | |
10 | #include <kglobalaccel_export.h> |
11 | |
12 | #include <QDBusArgument> |
13 | #include <QKeySequence> |
14 | #include <QList> |
15 | #include <QObject> |
16 | |
17 | class KGlobalShortcutInfoPrivate; |
18 | |
19 | class KGLOBALACCEL_EXPORT KGlobalShortcutInfo : public QObject |
20 | { |
21 | Q_OBJECT |
22 | |
23 | Q_CLASSINFO("D-Bus Interface" , "org.kde.kglobalaccel.KShortcutInfo" ) |
24 | |
25 | /* clang-format off */ |
26 | Q_SCRIPTABLE Q_PROPERTY(QString uniqueName READ uniqueName) |
27 | Q_SCRIPTABLE Q_PROPERTY(QString friendlyName READ friendlyName) |
28 | |
29 | Q_SCRIPTABLE Q_PROPERTY(QString componentUniqueName READ componentUniqueName) |
30 | Q_SCRIPTABLE Q_PROPERTY(QString componentFriendlyName READ componentFriendlyName) |
31 | |
32 | Q_SCRIPTABLE Q_PROPERTY(QString contextUniqueName READ contextUniqueName) |
33 | Q_SCRIPTABLE Q_PROPERTY(QString contextFriendlyName READ contextFriendlyName) |
34 | |
35 | Q_SCRIPTABLE Q_PROPERTY(QList<QKeySequence> keys READ keys) |
36 | Q_SCRIPTABLE Q_PROPERTY(QList<QKeySequence> defaultKeys READ keys) |
37 | |
38 | public: |
39 | KGlobalShortcutInfo(); |
40 | /* clang-format on */ |
41 | |
42 | KGlobalShortcutInfo(const KGlobalShortcutInfo &rhs); |
43 | |
44 | ~KGlobalShortcutInfo() override; |
45 | |
46 | KGlobalShortcutInfo &operator=(const KGlobalShortcutInfo &rhs); |
47 | |
48 | QString contextFriendlyName() const; |
49 | |
50 | QString contextUniqueName() const; |
51 | |
52 | QString componentFriendlyName() const; |
53 | |
54 | QString componentUniqueName() const; |
55 | |
56 | QList<QKeySequence> defaultKeys() const; |
57 | |
58 | QString friendlyName() const; |
59 | |
60 | QList<QKeySequence> keys() const; |
61 | |
62 | QString uniqueName() const; |
63 | |
64 | private: |
65 | friend class GlobalShortcut; |
66 | |
67 | friend KGLOBALACCEL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, KGlobalShortcutInfo &shortcut); |
68 | friend KGLOBALACCEL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, QKeySequence &sequence); |
69 | |
70 | //! Implementation details |
71 | KGlobalShortcutInfoPrivate *d; |
72 | }; |
73 | |
74 | KGLOBALACCEL_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const KGlobalShortcutInfo &shortcut); |
75 | KGLOBALACCEL_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const QKeySequence &sequence); |
76 | |
77 | KGLOBALACCEL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, KGlobalShortcutInfo &shortcut); |
78 | KGLOBALACCEL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, QKeySequence &sequence); |
79 | |
80 | Q_DECLARE_METATYPE(KGlobalShortcutInfo) |
81 | |
82 | #endif /* #ifndef KGLOBALSHORTCUTINFO_H */ |
83 | |