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

source code of kglobalaccel/src/kglobalshortcutinfo.h