File: standaloneinputmethodhost.cpp

package info (click to toggle)
maliit-framework 2.3.0-3.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,488 kB
  • sloc: cpp: 13,098; ansic: 2,506; xml: 299; sh: 34; makefile: 23; sed: 4
file content (188 lines) | stat: -rw-r--r-- 5,359 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/* 
 * Copyright (c) 2017 Jan Arne Petersen
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1 as published by the Free Software Foundation
 * and appearing in the file LICENSE.LGPL included in the packaging
 * of this file.
 *
 */

#include "standaloneinputmethodhost.h"

#include "minputcontextconnection.h"
#include "maliit/plugins/plugindescription.h"
#include "windowgroup.h"

namespace Maliit
{

StandaloneInputMethodHost::StandaloneInputMethodHost(MInputContextConnection *connection, WindowGroup *windowGroup)
    : MAbstractInputMethodHost()
    , mConnection(connection)
    , mWindowGroup(windowGroup)
{
}

bool StandaloneInputMethodHost::hiddenText(bool &valid)
{
    return mConnection->hiddenText(valid);
}

void StandaloneInputMethodHost::setLanguage(const QString &language)
{
    mConnection->setLanguage(language);
}

int StandaloneInputMethodHost::contentType(bool &valid)
{
    return mConnection->contentType(valid);
}

bool StandaloneInputMethodHost::correctionEnabled(bool &valid)
{
    return mConnection->correctionEnabled(valid);
}

bool StandaloneInputMethodHost::predictionEnabled(bool &valid)
{
    return mConnection->predictionEnabled(valid);
}

bool StandaloneInputMethodHost::autoCapitalizationEnabled(bool &valid)
{
    return mConnection->autoCapitalizationEnabled(valid);
}

bool StandaloneInputMethodHost::surroundingText(QString &text, int &cursorPosition)
{
    return mConnection->surroundingText(text, cursorPosition);
}

bool StandaloneInputMethodHost::hasSelection(bool &valid)
{
    return mConnection->hasSelection(valid);
}

int StandaloneInputMethodHost::inputMethodMode(bool &valid)
{
    return mConnection->inputMethodMode(valid);
}

QRect StandaloneInputMethodHost::preeditRectangle(bool &valid)
{
    return mConnection->preeditRectangle(valid);
}

QRect StandaloneInputMethodHost::cursorRectangle(bool &valid)
{
    return mConnection->cursorRectangle(valid);
}

int StandaloneInputMethodHost::anchorPosition(bool &valid)
{
    return mConnection->anchorPosition(valid);
}

QString StandaloneInputMethodHost::selection(bool &valid)
{
    return mConnection->selection(valid);
}

void StandaloneInputMethodHost::registerWindow(QWindow *window, Maliit::Position position)
{
    mWindowGroup->setupWindow(window, position);
}

void StandaloneInputMethodHost::sendPreeditString(const QString &string,
                                                  const QList<Maliit::PreeditTextFormat> &preeditFormats,
                                                  int replacementStart,
                                                  int replacementLength,
                                                  int cursorPos)
{
    mConnection->sendPreeditString(string, preeditFormats, replacementStart, replacementLength, cursorPos);
}

void
StandaloneInputMethodHost::sendCommitString(const QString &string, int replaceStart, int replaceLength, int cursorPos)
{
    mConnection->sendCommitString(string, replaceStart, replaceLength, cursorPos);
}

void StandaloneInputMethodHost::sendKeyEvent(const QKeyEvent &keyEvent, Maliit::EventRequestType requestType)
{
    mConnection->sendKeyEvent(keyEvent, requestType);
}

void StandaloneInputMethodHost::notifyImInitiatedHiding()
{
    mConnection->notifyImInitiatedHiding();
}

void StandaloneInputMethodHost::invokeAction(const QString &action, const QKeySequence &sequence)
{
    mConnection->invokeAction(action, sequence);
}

void StandaloneInputMethodHost::setRedirectKeys(bool enabled)
{
    mConnection->setRedirectKeys(enabled);
}

void StandaloneInputMethodHost::setDetectableAutoRepeat(bool enabled)
{
    mConnection->setDetectableAutoRepeat(enabled);
}

void StandaloneInputMethodHost::setGlobalCorrectionEnabled(bool enabled)
{
    mConnection->setGlobalCorrectionEnabled(enabled);
}

void StandaloneInputMethodHost::switchPlugin(Maliit::SwitchDirection direction)
{
}

void StandaloneInputMethodHost::switchPlugin(const QString &pluginName)
{
}

void StandaloneInputMethodHost::setScreenRegion(const QRegion &region, QWindow *window)
{
    mWindowGroup->setScreenRegion(region, window);
}

void StandaloneInputMethodHost::setInputMethodArea(const QRegion &region, QWindow *window)
{
    mWindowGroup->setScreenRegion(region, window);
}

void StandaloneInputMethodHost::setSelection(int start, int length)
{
    mConnection->setSelection(start, length);
}

void StandaloneInputMethodHost::setOrientationAngleLocked(bool lock)
{
}

QList<MImPluginDescription> StandaloneInputMethodHost::pluginDescriptions(Maliit::HandlerState state) const
{
    return QList<MImPluginDescription>();
}

Maliit::Plugins::AbstractPluginSetting *StandaloneInputMethodHost::registerPluginSetting(const QString &key,
                                                                                         const QString &description,
                                                                                         Maliit::SettingEntryType type,
                                                                                         const QVariantMap &attributes)
{
    return nullptr;
}

QVariant StandaloneInputMethodHost::inputMethodQuery(Qt::InputMethodQuery query, const QVariant &argument) const
{
    return mConnection->inputMethodQuery(query, argument);
}

}