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
qqnxinputcontext_imf.h
Go to the documentation of this file.
1// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
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 QQNXINPUTCONTEXT_H
5#define QQNXINPUTCONTEXT_H
6
7#include <qpa/qplatforminputcontext.h>
9
10#include <QtCore/QLocale>
11#include <QtCore/QMetaType>
12#include <QtCore/QList>
13#include <qpa/qplatformintegration.h>
14
15#include "imf/imf_client.h"
16#include "imf/input_control.h"
17
19
21class QQnxIntegration;
22class QQnxImfRequest;
23
25{
27public:
28 explicit QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard);
30
31 // Indices for selecting and setting highlight colors.
37
38 bool isValid() const override;
39
40 bool filterEvent(const QEvent *event) override;
41 QRectF keyboardRect() const override;
42 void reset() override;
43 void commit() override;
44 void update(Qt::InputMethodQueries) override;
45 bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap, int sequenceId) override;
46
47
48 void showInputPanel() override;
49 void hideInputPanel() override;
50 bool isInputPanelVisible() const override;
51
52 QLocale locale() const override;
53 void setFocusObject(QObject *object) override;
54
55 static void setHighlightColor(int index, const QColor &color);
56
57 static bool checkSpelling(const QString &text, void *context, void (*spellCheckDone)(void *context, const QString &text, const QList<int> &indices));
58
59private Q_SLOTS:
60 void keyboardVisibilityChanged(bool visible);
61 void keyboardLocaleChanged(const QLocale &locale);
62 void processImfEvent(QQnxImfRequest *event);
63
64private:
65 // IMF Event dispatchers
66 bool dispatchFocusGainEvent(int inputHints);
67 void dispatchFocusLossEvent();
68 bool dispatchRequestSoftwareInputPanel();
69 bool dispatchCloseSoftwareInputPanel();
70 int handleSpellCheck(spell_check_event_t *event);
71 int32_t processEvent(event_t *event);
72
73 void closeSession();
74 bool openSession();
75 bool hasSession();
76 void updateCursorPosition();
77 void endComposition();
78 void finishComposingText();
79 bool hasSelectedText();
80 void updateComposition(spannable_string_t *text, int32_t new_cursor_position);
81
82 // IMF Event handlers - these events will come in from QCoreApplication.
83 int32_t onCommitText(spannable_string_t *text, int32_t new_cursor_position);
84 int32_t onDeleteSurroundingText(int32_t left_length, int32_t right_length);
85 int32_t onGetCursorCapsMode(int32_t req_modes);
86 int32_t onFinishComposingText();
87 int32_t onGetCursorPosition();
88 spannable_string_t *onGetTextAfterCursor(int32_t n, int32_t flags);
89 spannable_string_t *onGetTextBeforeCursor(int32_t n, int32_t flags);
90 int32_t onSendEvent(event_t *event);
91 int32_t onSetComposingRegion(int32_t start, int32_t end);
92 int32_t onSetComposingText(spannable_string_t *text, int32_t new_cursor_position);
93 int32_t onIsTextSelected(int32_t* pIsSelected);
94 int32_t onIsAllTextSelected(int32_t* pIsSelected);
95 int32_t onForceUpdate();
96
97 int m_caretPosition;
98 bool m_isComposing;
99 QString m_composingText;
100 bool m_isUpdatingText;
101 bool m_inputPanelVisible;
102 QLocale m_inputPanelLocale;
103 // The object that had focus when the last highlight color was set.
104 QObject *m_focusObject;
105 // Indexed by HighlightIndex
106 QColor m_highlightColor[3];
107 QQnxIntegration *m_integration;
108 QQnxAbstractVirtualKeyboard &m_virtualKeyboard;
109};
110
112
113#endif // QQNXINPUTCONTEXT_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtCore
Definition qobject.h:103
The QPlatformInputContext class abstracts the input method dependent data and composing state.
bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap, int sequenceId) override
void update(Qt::InputMethodQueries) override
Notification on editor updates.
QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVirtualKeyboard &keyboard)
bool isInputPanelVisible() const override
Returns input panel visibility status.
void reset() override
Method to be called when input method needs to be reset.
void hideInputPanel() override
Request to hide input panel.
static bool checkSpelling(const QString &text, void *context, void(*spellCheckDone)(void *context, const QString &text, const QList< int > &indices))
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
QLocale locale() const override
bool isValid() const override
Returns input context validity.
bool filterEvent(const QEvent *event) override
This function can be reimplemented to filter input events.
QRectF keyboardRect() const override
This function can be reimplemented to return virtual keyboard rectangle in currently active window co...
void showInputPanel() override
Request to show input panel.
static void setHighlightColor(int index, const QColor &color)
\inmodule QtCore\reentrant
Definition qrect.h:484
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
Combined button and popup list for selecting options.
static void * context
GLuint index
[2]
GLuint GLuint end
GLuint color
[2]
GLbitfield flags
GLuint start
GLfloat n
GLsizei GLenum const void * indices
struct _cl_event * event
GLenum cap
#define Q_OBJECT
#define Q_SLOTS