1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWAYLANDTEXTINPUTINTERFACE_P_H
5#define QWAYLANDTEXTINPUTINTERFACE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qlocale.h>
19#include <QtCore/qrect.h>
20#include <QtCore/private/qglobal_p.h>
21
22struct wl_surface;
23
24QT_BEGIN_NAMESPACE
25
26namespace QtWaylandClient {
27
28class QWaylandTextInputInterface
29{
30public:
31 virtual ~QWaylandTextInputInterface() {}
32 virtual void reset() = 0;
33 virtual void commit() = 0;
34 virtual void disableSurface(::wl_surface *surface) = 0;
35 virtual void enableSurface(::wl_surface *surface) = 0;
36 virtual void updateState(Qt::InputMethodQueries queries, uint32_t flags) = 0;
37 virtual void showInputPanel() {}
38 virtual void hideInputPanel() {}
39 virtual bool isInputPanelVisible() const = 0;
40 virtual QRectF keyboardRect() const = 0;
41 virtual QLocale locale() const = 0;
42 virtual Qt::LayoutDirection inputDirection() const = 0;
43 virtual void setCursorInsidePreedit(int cursor) = 0;
44
45 // This enum should be compatible with update_state of text-input-unstable-v2.
46 // Higher versions of text-input-* protocol may not use it directly
47 // but QtWaylandClient can determine clients' states based on the values
48 enum TextInputState {
49 update_state_change = 0, // updated state because it changed
50 update_state_full = 1, // full state after enter or input_method_changed event
51 update_state_reset = 2, // full state after reset
52 update_state_enter = 3, // full state after switching focus to a different widget on client side
53 };
54};
55
56}
57
58QT_END_NAMESPACE
59
60#endif // QWAYLANDTEXTINPUTINTERFACE_P_H
61
62

source code of qtwayland/src/client/qwaylandtextinputinterface_p.h