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
qiosinputcontext.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QIOSINPUTCONTEXT_H
5#define QIOSINPUTCONTEXT_H
6
7#include <UIKit/UIKit.h>
8
9#include <QtCore/qlocale.h>
10#include <QtGui/qevent.h>
11#include <QtGui/qtransform.h>
12#include <qpa/qplatforminputcontext.h>
13
14const char kImePlatformDataInputView[] = "inputView";
15const char kImePlatformDataInputAccessoryView[] = "inputAccessoryView";
16const char kImePlatformDataHideShortcutsBar[] = "hideShortcutsBar";
17const char kImePlatformDataReturnKeyType[] = "returnKeyType";
18
22@protocol KeyboardState;
23
25
40
42{
43 ImeState() = default;
44 Qt::InputMethodQueries update(Qt::InputMethodQueries properties);
46 QObject *focusObject = nullptr;
47};
48
50{
51public:
54
55 bool isValid() const override { return true; }
56
57 void showInputPanel() override;
58 void hideInputPanel() override;
59
60 bool isInputPanelVisible() const override;
61 bool isAnimating() const override;
62 QRectF keyboardRect() const override;
63
64 void update(Qt::InputMethodQueries) override;
65 void reset() override;
66 void commit() override;
67
68 QLocale locale() const override;
69
71
72 void setFocusObject(QObject *object) override;
73 void focusWindowChanged(QWindow *focusWindow);
74
76 void scroll(int y);
77
78 void updateKeyboardState(NSNotification *notification = nullptr);
79
80 const ImeState &imeState() { return m_imeState; }
81 const KeyboardState &keyboardState() { return m_keyboardState; }
82
83 bool inputMethodAccepted() const;
84
85 static QIOSInputContext *instance();
86
87private:
88 UIView* scrollableRootView();
89
90 QIOSLocaleListener *m_localeListener;
91 QIOSKeyboardListener *m_keyboardHideGesture;
92 QIOSTextResponder *m_textResponder;
93 KeyboardState m_keyboardState;
94 ImeState m_imeState;
95};
96
98
99#endif
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
void clearCurrentFocusObject()
QRectF keyboardRect() const override
This function can be reimplemented to return virtual keyboard rectangle in currently active window co...
const KeyboardState & keyboardState()
void updateKeyboardState(NSNotification *notification=nullptr)
bool isValid() const override
Returns input context validity.
void scroll(int y)
static QIOSInputContext * instance()
QLocale locale() const override
void reset() override
Method to be called when input method needs to be reset.
const ImeState & imeState()
void commit() override
bool isAnimating() const override
This function can be reimplemented to return true whenever input method is animating shown or hidden.
void showInputPanel() override
Request to show input panel.
void focusWindowChanged(QWindow *focusWindow)
void hideInputPanel() override
Request to hide input panel.
bool isInputPanelVisible() const override
Returns input panel visibility status.
bool inputMethodAccepted() const
void update(Qt::InputMethodQueries) override
Notification on editor updates.
The QInputMethodQueryEvent class provides an event sent by the input context to input objects.
Definition qevent.h:679
\inmodule QtCore
Definition qobject.h:103
The QPlatformInputContext class abstracts the input method dependent data and composing state.
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
static const QCssKnownValue properties[NumProperties - 1]
const char kImePlatformDataInputView[]
const char kImePlatformDataReturnKeyType[]
const char kImePlatformDataInputAccessoryView[]
const char kImePlatformDataHideShortcutsBar[]
GLint y
Qt::InputMethodQueries update(Qt::InputMethodQueries properties)
QInputMethodQueryEvent currentState
ImeState()=default
QObject * focusObject
NSTimeInterval animationDuration
UIViewAnimationCurve animationCurve