| 1 | // Copyright (C) 2018 The Qt Company Ltd. | 
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only | 
| 3 | |
| 4 | #ifndef THAIINPUTMETHOD_H | 
| 5 | #define THAIINPUTMETHOD_H | 
| 6 | |
| 7 | #ifdef QT_HUNSPELLINPUTMETHOD_LIB | 
| 8 | #include <QtHunspellInputMethod/private/hunspellinputmethod_p.h> | 
| 9 | #define ThaiInputMethodBase HunspellInputMethod | 
| 10 | #else | 
| 11 | #include <QtVirtualKeyboard/qvirtualkeyboardabstractinputmethod.h> | 
| 12 | #define ThaiInputMethodBase QVirtualKeyboardAbstractInputMethod | 
| 13 | #endif | 
| 14 | |
| 15 | QT_BEGIN_NAMESPACE | 
| 16 | namespace QtVirtualKeyboard { | 
| 17 | |
| 18 | class ThaiInputMethodPrivate; | 
| 19 | |
| 20 | class ThaiInputMethod : public ThaiInputMethodBase | 
| 21 | { | 
| 22 | Q_OBJECT | 
| 23 | Q_DECLARE_PRIVATE(ThaiInputMethod) | 
| 24 | QML_ELEMENT | 
| 25 | QML_ADDED_IN_VERSION(2, 0) | 
| 26 | |
| 27 | public: | 
| 28 | explicit ThaiInputMethod(QObject *parent = nullptr); | 
| 29 | |
| 30 | #ifndef QT_HUNSPELLINPUTMETHOD_LIB | 
| 31 | QList<QVirtualKeyboardInputEngine::InputMode> inputModes(const QString &locale) override; | 
| 32 | bool setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode) override; | 
| 33 | bool setTextCase(QVirtualKeyboardInputEngine::TextCase textCase) override; | 
| 34 | #endif | 
| 35 | |
| 36 | bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) override; | 
| 37 | }; | 
| 38 | |
| 39 | } // namespace QtVirtualKeyboard | 
| 40 | QT_END_NAMESPACE | 
| 41 | |
| 42 | #endif | 
| 43 | 
