Changeset View
Changeset View
Standalone View
Standalone View
keyboard_layout_switching.h
Show All 15 Lines | |||||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_KEYBOARD_LAYOUT_SWITCHING_H | 20 | #ifndef KWIN_KEYBOARD_LAYOUT_SWITCHING_H | ||
21 | #define KWIN_KEYBOARD_LAYOUT_SWITCHING_H | 21 | #define KWIN_KEYBOARD_LAYOUT_SWITCHING_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QHash> | ||||
24 | #include <QMap> | 25 | #include <QMap> | ||
25 | 26 | | |||
26 | namespace KWin | 27 | namespace KWin | ||
27 | { | 28 | { | ||
28 | 29 | | |||
30 | class AbstractClient; | ||||
29 | class KeyboardLayout; | 31 | class KeyboardLayout; | ||
30 | class Xkb; | 32 | class Xkb; | ||
31 | class VirtualDesktop; | 33 | class VirtualDesktop; | ||
32 | 34 | | |||
33 | namespace KeyboardLayoutSwitching | 35 | namespace KeyboardLayoutSwitching | ||
34 | { | 36 | { | ||
35 | 37 | | |||
36 | class Policy : public QObject | 38 | class Policy : public QObject | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 88 | protected: | |||
87 | void clearCache() override; | 89 | void clearCache() override; | ||
88 | void layoutChanged() override; | 90 | void layoutChanged() override; | ||
89 | 91 | | |||
90 | private: | 92 | private: | ||
91 | void desktopChanged(); | 93 | void desktopChanged(); | ||
92 | QMap<VirtualDesktop *, quint32> m_layouts; | 94 | QMap<VirtualDesktop *, quint32> m_layouts; | ||
93 | }; | 95 | }; | ||
94 | 96 | | |||
97 | class WindowPolicy : public Policy | ||||
98 | { | ||||
99 | Q_OBJECT | ||||
100 | public: | ||||
101 | explicit WindowPolicy(Xkb *xkb, KeyboardLayout *layout); | ||||
102 | ~WindowPolicy() override; | ||||
103 | | ||||
104 | QString name() const override { | ||||
105 | return QStringLiteral("Window"); | ||||
106 | } | ||||
107 | | ||||
108 | protected: | ||||
109 | void clearCache() override; | ||||
110 | void layoutChanged() override; | ||||
111 | | ||||
112 | private: | ||||
113 | QHash<AbstractClient*, quint32> m_layouts; | ||||
114 | }; | ||||
115 | | ||||
95 | } | 116 | } | ||
96 | } | 117 | } | ||
97 | 118 | | |||
98 | #endif | 119 | #endif |