Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwasminputcontext.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWASMINPUTCONTEXT_H
5#define QWASMINPUTCONTEXT_H
6
7
8#include <qpa/qplatforminputcontext.h>
9#include <QtCore/qpointer.h>
10#include <private/qstdweb_p.h>
11#include <emscripten/bind.h>
12#include <emscripten/html5.h>
13#include <emscripten/emscripten.h>
14
16
18{
19 Q_DISABLE_COPY(QWasmInputContext)
21public:
22 explicit QWasmInputContext();
23 ~QWasmInputContext() override;
24
25 void update(Qt::InputMethodQueries) override;
26
27 void showInputPanel() override;
28 void hideInputPanel() override;
29 bool isValid() const override { return true; }
30
31 void focusWindowChanged(QWindow *focusWindow);
32 void inputStringChanged(QString &, int eventType, QWasmInputContext *context);
33 emscripten::val m_inputElement = emscripten::val::null();
34
35private:
36 emscripten::val inputHandlerElementForFocusedWindow();
37
38 bool m_inputPanelVisible = false;
39
40 QPointer<QWindow> m_focusWindow;
41 std::unique_ptr<qstdweb::EventCallback> m_blurEventHandler;
42 std::unique_ptr<qstdweb::EventCallback> m_inputEventHandler;
43 bool inputPanelIsOpen = false;
44};
45
47
48#endif // QWASMINPUTCONTEXT_H
The QPlatformInputContext class abstracts the input method dependent data and composing state.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void showInputPanel() override
Request to show input panel.
emscripten::val m_inputElement
bool isValid() const override
Returns input context validity.
void hideInputPanel() override
Request to hide input panel.
void update(Qt::InputMethodQueries) override
Notification on editor updates.
void focusWindowChanged(QWindow *focusWindow)
void inputStringChanged(QString &, int eventType, QWasmInputContext *context)
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
static void * context
#define Q_OBJECT