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