Changeset View
Changeset View
Standalone View
Standalone View
src/server/inputmethodinterface.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2019 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | #ifndef WAYLAND_SERVER_INPUTMETHOD_INTERFACE_H | ||||
21 | #define WAYLAND_SERVER_INPUTMETHOD_INTERFACE_H | ||||
22 | | ||||
23 | #include <KWayland/Server/kwaylandserver_export.h> | ||||
24 | #include <QVector> | ||||
25 | | ||||
26 | #include "resource.h" | ||||
27 | | ||||
28 | namespace KWayland | ||||
29 | { | ||||
30 | namespace Server | ||||
31 | { | ||||
32 | | ||||
33 | class KWAYLANDSERVER_EXPORT InputMethodInterface : public QObject | ||||
34 | { | ||||
35 | Q_OBJECT | ||||
36 | public: | ||||
37 | InputMethodInterface(); | ||||
38 | virtual ~InputMethodInterface(); | ||||
39 | | ||||
40 | private: | ||||
41 | friend class InputMethodInterface; | ||||
42 | class Private; | ||||
43 | QScopedPointer<Private> d; | ||||
44 | }; | ||||
45 | | ||||
46 | class KWAYLANDSERVER_EXPORT InputMethodContextInterface : public QObject | ||||
47 | { | ||||
48 | Q_OBJECT | ||||
49 | public: | ||||
50 | InputMethodContextInterface(); | ||||
51 | virtual ~InputMethodContextInterface(); | ||||
52 | | ||||
53 | void updateSurroundingText(); | ||||
54 | | ||||
55 | Q_SIGNALS: | ||||
56 | void commitString(wl_resource* resource, uint serial, const QString &text); | ||||
57 | void preeditString(wl_resource* resource, uint32_t serial, const QString &text, const QString &commit); | ||||
58 | void preeditStyling(wl_resource* resource, uint32_t index, uint32_t length, uint32_t style); | ||||
59 | void preeditCursor(wl_resource* resource, int32_t index); | ||||
60 | void deleteSurroundingText(wl_resource* resource, int32_t index, uint32_t length); | ||||
61 | void cursorPosition(wl_resource* resource, int32_t index, int32_t anchor); | ||||
62 | // void modifiersMap(wl_resource* resource, int mods); | ||||
63 | void keysym(wl_resource* resource, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); | ||||
64 | void grabKeyboard(wl_resource* resource, uint32_t keyboard); | ||||
65 | void key(wl_resource* resource, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); | ||||
66 | void modifiers(wl_resource* resource, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); | ||||
67 | void language(wl_resource* resource, uint32_t serial, const QString &language); | ||||
68 | void textDirection(wl_resource* resource, uint32_t serial, uint32_t direction); | ||||
69 | | ||||
70 | private: | ||||
71 | friend class InputMethodContextInterface; | ||||
72 | class Private; | ||||
73 | QScopedPointer<Private> d; | ||||
74 | }; | ||||
75 | | ||||
76 | class KWAYLANDSERVER_EXPORT InputPanelInterface : public QObject | ||||
77 | { | ||||
78 | Q_OBJECT | ||||
79 | public: | ||||
80 | InputPanelInterface(); | ||||
81 | virtual ~InputPanelInterface(); | ||||
82 | | ||||
83 | private: | ||||
84 | friend class InputPanelInterface; | ||||
85 | class Private; | ||||
86 | QScopedPointer<Private> d; | ||||
87 | }; | ||||
88 | | ||||
89 | class KWAYLANDSERVER_EXPORT InputPanelSurfaceInterface : public QObject | ||||
90 | { | ||||
91 | Q_OBJECT | ||||
92 | public: | ||||
93 | InputPanelSurfaceInterface(); | ||||
94 | virtual ~InputPanelSurfaceInterface(); | ||||
95 | | ||||
96 | private: | ||||
97 | friend class InputPanelSurfaceInterface; | ||||
98 | class Private; | ||||
99 | QScopedPointer<Private> d; | ||||
100 | }; | ||||
101 | | ||||
102 | } | ||||
103 | } | ||||
104 | | ||||
105 | Q_DECLARE_METATYPE(KWayland::Server::InputMethodInterface*) | ||||
106 | | ||||
107 | #endif |