| 1 | /**************************************************************************** |
|---|---|
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:GPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU |
| 19 | ** General Public License version 3 or (at your option) any later version |
| 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
| 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
| 22 | ** included in the packaging of this file. Please review the following |
| 23 | ** information to ensure the GNU General Public License requirements will |
| 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
| 25 | ** |
| 26 | ** $QT_END_LICENSE$ |
| 27 | ** |
| 28 | ****************************************************************************/ |
| 29 | |
| 30 | #include <QtVirtualKeyboard/private/plaininputmethod_p.h> |
| 31 | #include <QtVirtualKeyboard/qvirtualkeyboardinputengine.h> |
| 32 | #include <QtVirtualKeyboard/qvirtualkeyboardinputcontext.h> |
| 33 | |
| 34 | QT_BEGIN_NAMESPACE |
| 35 | namespace QtVirtualKeyboard { |
| 36 | |
| 37 | /*! |
| 38 | \class QtVirtualKeyboard::PlainInputMethod |
| 39 | \internal |
| 40 | */ |
| 41 | |
| 42 | PlainInputMethod::PlainInputMethod(QObject *parent) : |
| 43 | QVirtualKeyboardAbstractInputMethod(parent) |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | PlainInputMethod::~PlainInputMethod() |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | QList<QVirtualKeyboardInputEngine::InputMode> PlainInputMethod::inputModes(const QString &locale) |
| 52 | { |
| 53 | QList<QVirtualKeyboardInputEngine::InputMode> result; |
| 54 | switch (QLocale(locale).script()) { |
| 55 | case QLocale::GreekScript: |
| 56 | result.append(t: QVirtualKeyboardInputEngine::InputMode::Greek); |
| 57 | break; |
| 58 | case QLocale::CyrillicScript: |
| 59 | result.append(t: QVirtualKeyboardInputEngine::InputMode::Cyrillic); |
| 60 | break; |
| 61 | case QLocale::ArabicScript: |
| 62 | result.append(t: QVirtualKeyboardInputEngine::InputMode::Arabic); |
| 63 | break; |
| 64 | case QLocale::HebrewScript: |
| 65 | result.append(t: QVirtualKeyboardInputEngine::InputMode::Hebrew); |
| 66 | break; |
| 67 | default: |
| 68 | break; |
| 69 | } |
| 70 | result.append(t: QVirtualKeyboardInputEngine::InputMode::Latin); |
| 71 | result.append(t: QVirtualKeyboardInputEngine::InputMode::Numeric); |
| 72 | return result; |
| 73 | } |
| 74 | |
| 75 | bool PlainInputMethod::setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode) |
| 76 | { |
| 77 | Q_UNUSED(locale) |
| 78 | Q_UNUSED(inputMode) |
| 79 | return true; |
| 80 | } |
| 81 | |
| 82 | bool PlainInputMethod::setTextCase(QVirtualKeyboardInputEngine::TextCase textCase) |
| 83 | { |
| 84 | Q_UNUSED(textCase) |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | bool PlainInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) |
| 89 | { |
| 90 | Q_UNUSED(key) |
| 91 | Q_UNUSED(text) |
| 92 | Q_UNUSED(modifiers) |
| 93 | bool accept = false; |
| 94 | return accept; |
| 95 | } |
| 96 | |
| 97 | void PlainInputMethod::reset() |
| 98 | { |
| 99 | } |
| 100 | |
| 101 | void PlainInputMethod::update() |
| 102 | { |
| 103 | } |
| 104 | |
| 105 | } // namespace QtVirtualKeyboard |
| 106 | QT_END_NAMESPACE |
| 107 |
