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
20QT_BEGIN_NAMESPACE
21namespace QtVirtualKeyboard {
22
23class PinyinInputMethodPrivate;
24
25class PinyinInputMethod : public QVirtualKeyboardAbstractInputMethod
26{
27 Q_OBJECT
28 Q_DECLARE_PRIVATE(PinyinInputMethod)
29 QML_ELEMENT
30
31public:
32 explicit PinyinInputMethod(QObject *parent = nullptr);
33 ~PinyinInputMethod();
34
35 QList<QVirtualKeyboardInputEngine::InputMode> inputModes(const QString &locale) override;
36 bool setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode) override;
37 bool setTextCase(QVirtualKeyboardInputEngine::TextCase textCase) override;
38
39 bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) override;
40
41 QList<QVirtualKeyboardSelectionListModel::Type> selectionLists() override;
42 int selectionListItemCount(QVirtualKeyboardSelectionListModel::Type type) override;
43 QVariant selectionListData(QVirtualKeyboardSelectionListModel::Type type, int index,
44 QVirtualKeyboardSelectionListModel::Role role) override;
45 void selectionListItemSelected(QVirtualKeyboardSelectionListModel::Type type, int index) override;
46
47 void reset() override;
48 void update() override;
49
50private:
51 QScopedPointer<PinyinInputMethodPrivate> d_ptr;
52};
53
54} // namespace QtVirtualKeyboard
55QT_END_NAMESPACE
56
57#endif // PINYININPUTMETHOD_P_H
58

source code of qtvirtualkeyboard/src/plugins/pinyin/pinyininputmethod_p.h