Changeset View
Changeset View
Standalone View
Standalone View
keyboard_layout.h
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 40 | public: | |||
---|---|---|---|---|---|
47 | 47 | | |||
48 | void init(); | 48 | void init(); | ||
49 | 49 | | |||
50 | void checkLayoutChange(); | 50 | void checkLayoutChange(); | ||
51 | void resetLayout(); | 51 | void resetLayout(); | ||
52 | 52 | | |||
53 | void keyEvent(KeyEvent *event) override; | 53 | void keyEvent(KeyEvent *event) override; | ||
54 | 54 | | |||
55 | Q_SIGNALS: | ||||
56 | void layoutChanged(); | ||||
57 | void layoutsReconfigured(); | ||||
58 | | ||||
55 | private Q_SLOTS: | 59 | private Q_SLOTS: | ||
56 | void reconfigure(); | 60 | void reconfigure(); | ||
57 | 61 | | |||
58 | private: | 62 | private: | ||
63 | void initDBusInterface(); | ||||
59 | void notifyLayoutChange(); | 64 | void notifyLayoutChange(); | ||
60 | void initNotifierItem(); | 65 | void initNotifierItem(); | ||
61 | void switchToNextLayout(); | 66 | void switchToNextLayout(); | ||
62 | void switchToPreviousLayout(); | 67 | void switchToPreviousLayout(); | ||
63 | void switchToLayout(xkb_layout_index_t index); | 68 | void switchToLayout(xkb_layout_index_t index); | ||
64 | void updateNotifier(); | 69 | void updateNotifier(); | ||
65 | void reinitNotifierMenu(); | 70 | void reinitNotifierMenu(); | ||
66 | void loadShortcuts(); | 71 | void loadShortcuts(); | ||
67 | Xkb *m_xkb; | 72 | Xkb *m_xkb; | ||
68 | xkb_layout_index_t m_layout = 0; | 73 | xkb_layout_index_t m_layout = 0; | ||
69 | KStatusNotifierItem *m_notifierItem; | 74 | KStatusNotifierItem *m_notifierItem; | ||
70 | KSharedConfigPtr m_config; | 75 | KSharedConfigPtr m_config; | ||
71 | QVector<QAction*> m_layoutShortcuts; | 76 | QVector<QAction*> m_layoutShortcuts; | ||
72 | }; | 77 | }; | ||
73 | 78 | | |||
79 | class KeyboardLayoutDBusInterface : public QObject | ||||
80 | { | ||||
81 | Q_OBJECT | ||||
82 | Q_CLASSINFO("D-Bus Interface", "org.kde.KeyboardLayouts") | ||||
83 | | ||||
84 | public: | ||||
85 | explicit KeyboardLayoutDBusInterface(Xkb *xkb, QObject *parent); | ||||
86 | ~KeyboardLayoutDBusInterface() override; | ||||
87 | | ||||
88 | public Q_SLOTS: | ||||
89 | bool setLayout(const QString &layout); | ||||
90 | QString getCurrentLayout(); | ||||
91 | QStringList getLayoutsList(); | ||||
92 | QString getLayoutDisplayName(const QString &layout); | ||||
93 | | ||||
94 | Q_SIGNALS: | ||||
95 | void currentLayoutChanged(QString layout); | ||||
96 | void layoutListChanged(); | ||||
97 | | ||||
98 | private: | ||||
99 | Xkb *m_xkb; | ||||
100 | }; | ||||
101 | | ||||
74 | } | 102 | } | ||
75 | 103 | | |||
76 | #endif | 104 | #endif |