KWin
Loading...
Searching...
No Matches
textinput_v3.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2018 Roman Glig <subdiff@gmail.com>
3 SPDX-FileCopyrightText: 2020 Bhushan Shah <bshah@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7#pragma once
8
9#include <QObject>
10
11#include "textinput.h"
12
13struct wl_resource;
14namespace KWin
15{
16class ClientConnection;
17class Display;
18class SeatInterface;
19class SurfaceInterface;
20class TextInputV3Interface;
21class TextInputV3InterfacePrivate;
22class TextInputManagerV3InterfacePrivate;
23
32class KWIN_EXPORT TextInputManagerV3Interface : public QObject
33{
34 Q_OBJECT
35public:
36 explicit TextInputManagerV3Interface(Display *display, QObject *parent = nullptr);
38
39private:
40 std::unique_ptr<TextInputManagerV3InterfacePrivate> d;
41};
42
54class KWIN_EXPORT TextInputV3Interface : public QObject
55{
56 Q_OBJECT
57public:
59
63 QRect cursorRectangle() const;
64
68 TextInputContentPurpose contentPurpose() const;
69
73 TextInputContentHints contentHints() const;
74
81 QString surroundingText() const;
87 qint32 surroundingTextCursorPosition() const;
96 qint32 surroundingTextSelectionAnchor() const;
97
103 QPointer<SurfaceInterface> surface() const;
104
110 bool isEnabled() const;
111
121 void deleteSurroundingText(quint32 beforeLength, quint32 afterLength);
122
130 void sendPreEditString(const QString &text, quint32 cursorBegin, quint32 cursorEnd);
131
144 void commitString(const QString &text);
145
150 void done();
151
155 bool clientSupportsTextInput(ClientConnection *client) const;
156
157Q_SIGNALS:
158
162 void cursorRectangleChanged(const QRect &rect);
169
178
185
189 void stateCommitted(quint32 serial);
190
197
198private:
200 friend class SeatInterface;
203 explicit TextInputV3Interface(SeatInterface *seat);
204
205 std::unique_ptr<TextInputV3InterfacePrivate> d;
206};
207
208}
209
Convenient Class which represents a wl_client.
Class holding the Wayland server display loop.
Definition display.h:34
Represents a Seat on the Wayland Display.
Definition seat.h:134
Represent the Global for the interface.
Represents a generic Resource for a text input object.A TextInputV3Interface gets created by the Text...
void stateCommitted(quint32 serial)
void cursorRectangleChanged(const QRect &rect)
Q_DECLARE_METATYPE(KWin::SwitchEvent::State)
TextInputContentPurpose
Definition textinput.h:72
struct _XDisplay Display