| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef TCINPUTMETHOD_P_H |
| 5 | #define TCINPUTMETHOD_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 <QtVirtualKeyboard/private/qvirtualkeyboard_global_p.h> |
| 19 | #include <QtVirtualKeyboard/qvirtualkeyboardabstractinputmethod.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | namespace QtVirtualKeyboard { |
| 23 | |
| 24 | class TCInputMethodPrivate; |
| 25 | |
| 26 | class TCInputMethod : public QVirtualKeyboardAbstractInputMethod |
| 27 | { |
| 28 | Q_OBJECT |
| 29 | Q_DECLARE_PRIVATE(TCInputMethod) |
| 30 | Q_PROPERTY(bool simplified READ simplified WRITE setSimplified NOTIFY simplifiedChanged) |
| 31 | QML_ELEMENT |
| 32 | QML_ADDED_IN_VERSION(2, 0) |
| 33 | |
| 34 | public: |
| 35 | explicit TCInputMethod(QObject *parent = nullptr); |
| 36 | ~TCInputMethod(); |
| 37 | |
| 38 | bool simplified() const; |
| 39 | void setSimplified(bool simplified); |
| 40 | |
| 41 | QList<QVirtualKeyboardInputEngine::InputMode> inputModes(const QString &locale) override; |
| 42 | bool setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode) override; |
| 43 | bool setTextCase(QVirtualKeyboardInputEngine::TextCase textCase) override; |
| 44 | |
| 45 | bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) override; |
| 46 | |
| 47 | QList<QVirtualKeyboardSelectionListModel::Type> selectionLists() override; |
| 48 | int selectionListItemCount(QVirtualKeyboardSelectionListModel::Type type) override; |
| 49 | QVariant selectionListData(QVirtualKeyboardSelectionListModel::Type type, int index, |
| 50 | QVirtualKeyboardSelectionListModel::Role role) override; |
| 51 | void selectionListItemSelected(QVirtualKeyboardSelectionListModel::Type type, int index) override; |
| 52 | |
| 53 | void reset() override; |
| 54 | void update() override; |
| 55 | |
| 56 | signals: |
| 57 | void simplifiedChanged(); |
| 58 | |
| 59 | private: |
| 60 | QScopedPointer<TCInputMethodPrivate> d_ptr; |
| 61 | }; |
| 62 | |
| 63 | } // namespace QtVirtualKeyboard |
| 64 | QT_END_NAMESPACE |
| 65 | |
| 66 | #endif |
| 67 |
