Changeset View
Changeset View
Standalone View
Standalone View
kcms/keyboard/daemon/keyboard_daemon.h
- This file was moved from kcms/keyboard/keyboard_daemon.h.
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | | ||||
20 | #ifndef KEYBOARD_DAEMON_H_ | 19 | #ifndef KEYBOARD_DAEMON_H_ | ||
21 | #define KEYBOARD_DAEMON_H_ | 20 | #define KEYBOARD_DAEMON_H_ | ||
22 | 21 | | |||
23 | #include <kdedmodule.h> | | |||
24 | #include <QStringList> | 22 | #include <QStringList> | ||
23 | #include <QTimer> | ||||
24 | #include <KDEDModule> | ||||
25 | 25 | | |||
26 | #include "layout_memory.h" | 26 | #include "../keyboard_dbus.h" | ||
27 | #include "keyboard_dbus.h" | | |||
28 | #include "bindings.h" | 27 | #include "bindings.h" | ||
29 | 28 | | |||
29 | #include "layout_list_models.h" | ||||
30 | #include "../fcitx/fcitxqtinputmethodproxy.h" | ||||
31 | | ||||
30 | class XInputEventNotifier; | 32 | class XInputEventNotifier; | ||
31 | class LayoutTrayIcon; | 33 | struct XkbRules; | ||
32 | class KeyboardConfig; | | |||
33 | struct Rules; | | |||
34 | 34 | | |||
35 | class Q_DECL_EXPORT KeyboardDaemon : public KDEDModule | 35 | class Q_DECL_EXPORT KeyboardDaemon : public KDEDModule { | ||
36 | { | | |||
37 | Q_OBJECT | 36 | Q_OBJECT | ||
38 | Q_CLASSINFO("D-Bus Interface", "org.kde.KeyboardLayouts") | 37 | Q_CLASSINFO("D-Bus Interface", "org.kde.KeyboardLayouts") | ||
39 | 38 | | |||
40 | KeyboardConfig keyboardConfig; | 39 | LayoutListModels* m_layoutListModels; | ||
40 | int m_currentLayoutIndex; | ||||
41 | | ||||
41 | KeyboardLayoutActionCollection *actionCollection; | 42 | KeyboardLayoutActionCollection* actionCollection; | ||
42 | XInputEventNotifier* xEventNotifier; | 43 | XInputEventNotifier* xEventNotifier; | ||
43 | LayoutTrayIcon* layoutTrayIcon; | 44 | QTimer configureKeyboardTimer; | ||
44 | LayoutMemory layoutMemory; | 45 | QTimer configureMouseTimer; | ||
45 | LayoutUnit currentLayout; | 46 | | ||
46 | const Rules* rules; | 47 | bool isXEventRegistered; | ||
48 | | ||||
49 | FcitxQtInputMethodProxy m_fcitxDBusProxy; | ||||
50 | | ||||
51 | QString updateCurrentLayout(int newLayoutIndex); | ||||
47 | 52 | | |||
48 | void registerListeners(); | 53 | void registerListeners(); | ||
49 | void registerShortcut(); | 54 | void registerShortcut(); | ||
50 | void unregisterListeners(); | 55 | void unregisterListeners(); | ||
51 | void unregisterShortcut(); | 56 | void unregisterShortcut(); | ||
52 | void setupTrayIcon(); | | |||
53 | 57 | | |||
54 | private Q_SLOTS: | 58 | private Q_SLOTS: | ||
55 | void switchToNextLayout(); | 59 | void switchToNextLayout(); | ||
56 | void configureKeyboard(); | 60 | void configureKeyboard(); | ||
57 | void configureMouse(); | 61 | void configureMouse(); | ||
58 | void layoutChanged(); | 62 | void layoutChanged(); | ||
59 | void layoutMapChanged(); | 63 | void layoutMapChanged(); | ||
60 | bool setLayout(QAction* action); | 64 | bool setLayout(QAction* action); | ||
61 | 65 | | |||
62 | public Q_SLOTS: | 66 | public Q_SLOTS: | ||
63 | Q_SCRIPTABLE bool setLayout(const QString& layout); | 67 | Q_SCRIPTABLE bool setLayout(const QString& layout); | ||
64 | Q_SCRIPTABLE QString getCurrentLayout(); | 68 | Q_SCRIPTABLE QString getCurrentLayout(); | ||
65 | Q_SCRIPTABLE QStringList getLayoutsList(); | 69 | Q_SCRIPTABLE QStringList getLayoutsList(); | ||
66 | Q_SCRIPTABLE QString getLayoutDisplayName(const QString &layout); | 70 | Q_SCRIPTABLE QString getLayoutDisplayName(const QString& layout); | ||
67 | 71 | | |||
68 | Q_SIGNALS: | 72 | Q_SIGNALS: | ||
69 | Q_SCRIPTABLE void currentLayoutChanged(QString layout); | 73 | Q_SCRIPTABLE void currentLayoutChanged(QString layout); | ||
70 | Q_SCRIPTABLE void layoutListChanged(); | 74 | Q_SCRIPTABLE void layoutListChanged(); | ||
75 | Q_SCRIPTABLE void configChanged(); | ||||
71 | 76 | | |||
72 | public: | 77 | public: | ||
73 | KeyboardDaemon(QObject *parent, const QList<QVariant>&); | 78 | KeyboardDaemon(QObject* parent, const QList<QVariant>&); | ||
74 | ~KeyboardDaemon() override; | 79 | ~KeyboardDaemon() override; | ||
75 | }; | 80 | }; | ||
76 | 81 | | |||
77 | #endif /* KEYBOARD_DAEMON_H_ */ | 82 | #endif /* KEYBOARD_DAEMON_H_ */ |