[dali_2.3.23] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / input-method-context.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/devel-api/adaptor-framework/input-method-context.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/input/common/input-method-context-impl.h>
23
24 #include <dali/internal/adaptor/common/adaptor-impl.h>
25
26 namespace Dali
27 {
28 InputMethodContext::InputMethodContext() = default;
29
30 InputMethodContext::~InputMethodContext() = default;
31
32 InputMethodContext InputMethodContext::New()
33 {
34   return InputMethodContext::New(Actor());
35 }
36
37 InputMethodContext InputMethodContext::New(Actor actor)
38 {
39   Internal::Adaptor::InputMethodContextPtr inputMethodContext = Internal::Adaptor::InputMethodContext::New(actor);
40
41   if(inputMethodContext)
42   {
43     inputMethodContext->Initialize();
44   }
45
46   return InputMethodContext(inputMethodContext.Get());
47 }
48
49 InputMethodContext::InputMethodContext(const InputMethodContext& inputMethodContext)
50 : BaseHandle(inputMethodContext)
51 {
52 }
53
54 InputMethodContext& InputMethodContext::operator=(const InputMethodContext& inputMethodContext)
55 {
56   if(*this != inputMethodContext)
57   {
58     BaseHandle::operator=(inputMethodContext);
59   }
60   return *this;
61 }
62
63 InputMethodContext InputMethodContext::DownCast(BaseHandle handle)
64 {
65   return InputMethodContext(dynamic_cast<Internal::Adaptor::InputMethodContext*>(handle.GetObjectPtr()));
66 }
67
68 void InputMethodContext::Finalize()
69 {
70   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Finalize();
71 }
72
73 void InputMethodContext::Activate()
74 {
75   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Activate();
76 }
77
78 void InputMethodContext::Deactivate()
79 {
80   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Deactivate();
81 }
82
83 bool InputMethodContext::RestoreAfterFocusLost() const
84 {
85   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost();
86 }
87
88 void InputMethodContext::SetRestoreAfterFocusLost(bool toggle)
89 {
90   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost(toggle);
91 }
92
93 void InputMethodContext::Reset()
94 {
95   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Reset();
96 }
97
98 void InputMethodContext::NotifyCursorPosition()
99 {
100   Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition();
101 }
102
103 void InputMethodContext::SetCursorPosition(unsigned int SetCursorPosition)
104 {
105   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition(SetCursorPosition);
106 }
107
108 unsigned int InputMethodContext::GetCursorPosition() const
109 {
110   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition();
111 }
112
113 void InputMethodContext::SetSurroundingText(const std::string& text)
114 {
115   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText(text);
116 }
117
118 const std::string& InputMethodContext::GetSurroundingText() const
119 {
120   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText();
121 }
122
123 void InputMethodContext::NotifyTextInputMultiLine(bool multiLine)
124 {
125   Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyTextInputMultiLine(multiLine);
126 }
127
128 InputMethodContext::TextDirection InputMethodContext::GetTextDirection()
129 {
130   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetTextDirection();
131 }
132
133 Rect<int> InputMethodContext::GetInputMethodArea()
134 {
135   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputMethodArea();
136 }
137
138 void InputMethodContext::ApplyOptions(const InputMethodOptions& options)
139 {
140   Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions(options);
141 }
142
143 void InputMethodContext::SetInputPanelData(const std::string& data)
144 {
145   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelData(data);
146 }
147
148 void InputMethodContext::GetInputPanelData(std::string& data)
149 {
150   Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelData(data);
151 }
152
153 Dali::InputMethodContext::State InputMethodContext::GetInputPanelState()
154 {
155   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelState();
156 }
157
158 void InputMethodContext::SetReturnKeyState(bool visible)
159 {
160   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetReturnKeyState(visible);
161 }
162
163 void InputMethodContext::AutoEnableInputPanel(bool enabled)
164 {
165   Internal::Adaptor::InputMethodContext::GetImplementation(*this).AutoEnableInputPanel(enabled);
166 }
167
168 void InputMethodContext::ShowInputPanel()
169 {
170   Internal::Adaptor::InputMethodContext::GetImplementation(*this).ShowInputPanel();
171 }
172
173 void InputMethodContext::HideInputPanel()
174 {
175   Internal::Adaptor::InputMethodContext::GetImplementation(*this).HideInputPanel();
176 }
177
178 Dali::InputMethodContext::KeyboardType InputMethodContext::GetKeyboardType()
179 {
180   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetKeyboardType();
181 }
182
183 std::string InputMethodContext::GetInputPanelLocale()
184 {
185   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLocale();
186 }
187
188 void InputMethodContext::SetContentMIMETypes(const std::string& mimeTypes)
189 {
190   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetContentMIMETypes(mimeTypes);
191 }
192
193 bool InputMethodContext::FilterEventKey(const Dali::KeyEvent& keyEvent)
194 {
195   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey(keyEvent);
196 }
197
198 void InputMethodContext::AllowTextPrediction(bool prediction)
199 {
200   Internal::Adaptor::InputMethodContext::GetImplementation(*this).AllowTextPrediction(prediction);
201 }
202
203 bool InputMethodContext::IsTextPredictionAllowed() const
204 {
205   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).IsTextPredictionAllowed();
206 }
207
208 void InputMethodContext::SetInputPanelLanguage(Dali::InputMethodContext::InputPanelLanguage language)
209 {
210   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelLanguage(language);
211 }
212
213 Dali::InputMethodContext::InputPanelLanguage InputMethodContext::GetInputPanelLanguage() const
214 {
215   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLanguage();
216 }
217
218 void InputMethodContext::SetInputPanelPosition(unsigned int x, unsigned int y)
219 {
220   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPosition(x, y);
221 }
222
223 void InputMethodContext::GetPreeditStyle(PreEditAttributeDataContainer& attrs) const
224 {
225   Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle(attrs);
226 }
227
228 // Signals
229 InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
230 {
231   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
232 }
233
234 InputMethodContext::KeyboardEventSignalType& InputMethodContext::EventReceivedSignal()
235 {
236   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).EventReceivedSignal();
237 }
238
239 InputMethodContext::StatusSignalType& InputMethodContext::StatusChangedSignal()
240 {
241   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).StatusChangedSignal();
242 }
243
244 InputMethodContext::KeyboardResizedSignalType& InputMethodContext::ResizedSignal()
245 {
246   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ResizedSignal();
247 }
248
249 InputMethodContext::LanguageChangedSignalType& InputMethodContext::LanguageChangedSignal()
250 {
251   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).LanguageChangedSignal();
252 }
253
254 InputMethodContext::KeyboardTypeSignalType& InputMethodContext::KeyboardTypeChangedSignal()
255 {
256   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).KeyboardTypeChangedSignal();
257 }
258
259 InputMethodContext::ContentReceivedSignalType& InputMethodContext::ContentReceivedSignal()
260 {
261   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ContentReceivedSignal();
262 }
263
264 InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext* impl)
265 : BaseHandle(impl)
266 {
267 }
268 } // namespace Dali