1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include <QtVirtualKeyboard/private/plaininputmethod_p.h>
5#include <QtVirtualKeyboard/qvirtualkeyboardinputengine.h>
6#include <QtVirtualKeyboard/qvirtualkeyboardinputcontext.h>
7
8QT_BEGIN_NAMESPACE
9namespace QtVirtualKeyboard {
10
11/*!
12 \class QtVirtualKeyboard::PlainInputMethod
13 \internal
14*/
15
16PlainInputMethod::PlainInputMethod(QObject *parent) :
17 QVirtualKeyboardAbstractInputMethod(parent)
18{
19}
20
21PlainInputMethod::~PlainInputMethod()
22{
23}
24
25QList<QVirtualKeyboardInputEngine::InputMode> PlainInputMethod::inputModes(const QString &locale)
26{
27 QList<QVirtualKeyboardInputEngine::InputMode> result;
28 switch (QLocale(locale).script()) {
29 case QLocale::GreekScript:
30 result.append(t: QVirtualKeyboardInputEngine::InputMode::Greek);
31 break;
32 case QLocale::CyrillicScript:
33 result.append(t: QVirtualKeyboardInputEngine::InputMode::Cyrillic);
34 break;
35 case QLocale::ArabicScript:
36 result.append(t: QVirtualKeyboardInputEngine::InputMode::Arabic);
37 break;
38 case QLocale::HebrewScript:
39 result.append(t: QVirtualKeyboardInputEngine::InputMode::Hebrew);
40 break;
41 default:
42 break;
43 }
44 result.append(t: QVirtualKeyboardInputEngine::InputMode::Latin);
45 result.append(t: QVirtualKeyboardInputEngine::InputMode::Numeric);
46 return result;
47}
48
49bool PlainInputMethod::setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode)
50{
51 Q_UNUSED(locale);
52 Q_UNUSED(inputMode);
53 return true;
54}
55
56bool PlainInputMethod::setTextCase(QVirtualKeyboardInputEngine::TextCase textCase)
57{
58 Q_UNUSED(textCase);
59 return true;
60}
61
62bool PlainInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers)
63{
64 Q_UNUSED(key);
65 Q_UNUSED(text);
66 Q_UNUSED(modifiers);
67 bool accept = false;
68 return accept;
69}
70
71void PlainInputMethod::reset()
72{
73}
74
75void PlainInputMethod::update()
76{
77}
78
79} // namespace QtVirtualKeyboard
80QT_END_NAMESPACE
81

source code of qtvirtualkeyboard/src/virtualkeyboard/plaininputmethod.cpp