2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/devel-api/adaptor-framework/input-method-context.h>
22 #include <dali/internal/input/common/input-method-context-impl.h>
24 #include <dali/internal/adaptor/common/adaptor-impl.h>
28 InputMethodContext::InputMethodContext() = default;
30 InputMethodContext::~InputMethodContext() = default;
32 InputMethodContext InputMethodContext::New()
34 return InputMethodContext::New(Actor());
37 InputMethodContext InputMethodContext::New(Actor actor)
39 Internal::Adaptor::InputMethodContextPtr inputMethodContext = Internal::Adaptor::InputMethodContext::New(actor);
41 if(inputMethodContext)
43 inputMethodContext->Initialize();
46 return InputMethodContext(inputMethodContext.Get());
49 InputMethodContext::InputMethodContext(const InputMethodContext& inputMethodContext)
50 : BaseHandle(inputMethodContext)
54 InputMethodContext& InputMethodContext::operator=(const InputMethodContext& inputMethodContext)
56 if(*this != inputMethodContext)
58 BaseHandle::operator=(inputMethodContext);
63 InputMethodContext InputMethodContext::DownCast(BaseHandle handle)
65 return InputMethodContext(dynamic_cast<Internal::Adaptor::InputMethodContext*>(handle.GetObjectPtr()));
68 void InputMethodContext::Finalize()
70 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Finalize();
73 void InputMethodContext::Activate()
75 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Activate();
78 void InputMethodContext::Deactivate()
80 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Deactivate();
83 bool InputMethodContext::RestoreAfterFocusLost() const
85 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost();
88 void InputMethodContext::SetRestoreAfterFocusLost(bool toggle)
90 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost(toggle);
93 void InputMethodContext::Reset()
95 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Reset();
98 void InputMethodContext::NotifyCursorPosition()
100 Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition();
103 void InputMethodContext::SetCursorPosition(unsigned int SetCursorPosition)
105 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition(SetCursorPosition);
108 unsigned int InputMethodContext::GetCursorPosition() const
110 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition();
113 void InputMethodContext::SetSurroundingText(const std::string& text)
115 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText(text);
118 const std::string& InputMethodContext::GetSurroundingText() const
120 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText();
123 void InputMethodContext::NotifyTextInputMultiLine(bool multiLine)
125 Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyTextInputMultiLine(multiLine);
128 InputMethodContext::TextDirection InputMethodContext::GetTextDirection()
130 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetTextDirection();
133 Rect<int> InputMethodContext::GetInputMethodArea()
135 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputMethodArea();
138 void InputMethodContext::ApplyOptions(const InputMethodOptions& options)
140 Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions(options);
143 void InputMethodContext::SetInputPanelData(const std::string& data)
145 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelData(data);
148 void InputMethodContext::GetInputPanelData(std::string& data)
150 Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelData(data);
153 Dali::InputMethodContext::State InputMethodContext::GetInputPanelState()
155 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelState();
158 void InputMethodContext::SetReturnKeyState(bool visible)
160 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetReturnKeyState(visible);
163 void InputMethodContext::AutoEnableInputPanel(bool enabled)
165 Internal::Adaptor::InputMethodContext::GetImplementation(*this).AutoEnableInputPanel(enabled);
168 void InputMethodContext::ShowInputPanel()
170 Internal::Adaptor::InputMethodContext::GetImplementation(*this).ShowInputPanel();
173 void InputMethodContext::HideInputPanel()
175 Internal::Adaptor::InputMethodContext::GetImplementation(*this).HideInputPanel();
178 Dali::InputMethodContext::KeyboardType InputMethodContext::GetKeyboardType()
180 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetKeyboardType();
183 std::string InputMethodContext::GetInputPanelLocale()
185 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLocale();
188 void InputMethodContext::SetContentMIMETypes(const std::string& mimeTypes)
190 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetContentMIMETypes(mimeTypes);
193 bool InputMethodContext::FilterEventKey(const Dali::KeyEvent& keyEvent)
195 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey(keyEvent);
198 void InputMethodContext::AllowTextPrediction(bool prediction)
200 Internal::Adaptor::InputMethodContext::GetImplementation(*this).AllowTextPrediction(prediction);
203 bool InputMethodContext::IsTextPredictionAllowed() const
205 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).IsTextPredictionAllowed();
208 void InputMethodContext::SetInputPanelLanguage(Dali::InputMethodContext::InputPanelLanguage language)
210 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelLanguage(language);
213 Dali::InputMethodContext::InputPanelLanguage InputMethodContext::GetInputPanelLanguage() const
215 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLanguage();
218 void InputMethodContext::SetInputPanelPosition(unsigned int x, unsigned int y)
220 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPosition(x, y);
223 void InputMethodContext::GetPreeditStyle(PreEditAttributeDataContainer& attrs) const
225 Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle(attrs);
229 InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
231 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
234 InputMethodContext::KeyboardEventSignalType& InputMethodContext::EventReceivedSignal()
236 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).EventReceivedSignal();
239 InputMethodContext::StatusSignalType& InputMethodContext::StatusChangedSignal()
241 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).StatusChangedSignal();
244 InputMethodContext::KeyboardResizedSignalType& InputMethodContext::ResizedSignal()
246 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ResizedSignal();
249 InputMethodContext::LanguageChangedSignalType& InputMethodContext::LanguageChangedSignal()
251 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).LanguageChangedSignal();
254 InputMethodContext::KeyboardTypeSignalType& InputMethodContext::KeyboardTypeChangedSignal()
256 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).KeyboardTypeChangedSignal();
259 InputMethodContext::ContentReceivedSignalType& InputMethodContext::ContentReceivedSignal()
261 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ContentReceivedSignal();
264 InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext* impl)