2 * Copyright (c) 2018 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>
29 InputMethodContext::InputMethodContext() = default;
31 InputMethodContext::~InputMethodContext() = default;
33 InputMethodContext InputMethodContext::New()
35 return InputMethodContext::New( Actor() );
38 InputMethodContext InputMethodContext::New( Actor actor )
40 Internal::Adaptor::InputMethodContextPtr inputMethodContext = Internal::Adaptor::InputMethodContext::New( actor );
42 if( inputMethodContext )
44 inputMethodContext->Initialize();
47 return InputMethodContext( inputMethodContext.Get() );
50 InputMethodContext::InputMethodContext( const InputMethodContext& inputMethodContext )
51 : BaseHandle( inputMethodContext )
55 InputMethodContext& InputMethodContext::operator=( const InputMethodContext& inputMethodContext )
57 if( *this != inputMethodContext )
59 BaseHandle::operator=( inputMethodContext );
64 InputMethodContext InputMethodContext::DownCast( BaseHandle handle )
66 return InputMethodContext( dynamic_cast< Internal::Adaptor::InputMethodContext* >( handle.GetObjectPtr() ) );
69 void InputMethodContext::Finalize()
71 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Finalize();
74 void InputMethodContext::Activate()
76 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Activate();
79 void InputMethodContext::Deactivate()
81 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Deactivate();
84 bool InputMethodContext::RestoreAfterFocusLost() const
86 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost();
89 void InputMethodContext::SetRestoreAfterFocusLost( bool toggle )
91 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost( toggle );
94 void InputMethodContext::Reset()
96 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Reset();
99 void InputMethodContext::NotifyCursorPosition()
101 Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition();
104 void InputMethodContext::SetCursorPosition( unsigned int SetCursorPosition )
106 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition( SetCursorPosition );
109 unsigned int InputMethodContext::GetCursorPosition() const
111 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition();
114 void InputMethodContext::SetSurroundingText( const std::string& text )
116 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText( text );
119 const std::string& InputMethodContext::GetSurroundingText() const
121 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText();
124 void InputMethodContext::NotifyTextInputMultiLine( bool multiLine )
126 Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyTextInputMultiLine( multiLine );
129 InputMethodContext::TextDirection InputMethodContext::GetTextDirection()
131 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetTextDirection();
134 Rect<int> InputMethodContext::GetInputMethodArea()
136 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputMethodArea();
139 void InputMethodContext::ApplyOptions( const InputMethodOptions& options )
141 Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions( options );
144 void InputMethodContext::SetInputPanelData( const std::string& data )
146 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelData( data );
149 void InputMethodContext::GetInputPanelData( std::string& data )
151 Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelData( data );
154 Dali::InputMethodContext::State InputMethodContext::GetInputPanelState()
156 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelState();
159 void InputMethodContext::SetReturnKeyState( bool visible )
161 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetReturnKeyState( visible );
164 void InputMethodContext::AutoEnableInputPanel( bool enabled )
166 Internal::Adaptor::InputMethodContext::GetImplementation(*this).AutoEnableInputPanel( enabled );
169 void InputMethodContext::ShowInputPanel()
171 Internal::Adaptor::InputMethodContext::GetImplementation(*this).ShowInputPanel();
174 void InputMethodContext::HideInputPanel()
176 Internal::Adaptor::InputMethodContext::GetImplementation(*this).HideInputPanel();
179 Dali::InputMethodContext::KeyboardType InputMethodContext::GetKeyboardType()
181 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetKeyboardType();
184 std::string InputMethodContext::GetInputPanelLocale()
186 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLocale();
189 void InputMethodContext::SetContentMIMETypes( const std::string& mimeTypes )
191 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetContentMIMETypes( mimeTypes );
194 bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent )
196 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent );
199 void InputMethodContext::AllowTextPrediction( bool prediction )
201 Internal::Adaptor::InputMethodContext::GetImplementation(*this).AllowTextPrediction( prediction );
204 bool InputMethodContext::IsTextPredictionAllowed() const
206 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).IsTextPredictionAllowed();
209 void InputMethodContext::SetInputPanelLanguage( Dali::InputMethodContext::InputPanelLanguage language )
211 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelLanguage( language );
214 Dali::InputMethodContext::InputPanelLanguage InputMethodContext::GetInputPanelLanguage() const
216 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLanguage();
219 void InputMethodContext::SetInputPanelPosition( unsigned int x, unsigned int y )
221 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPosition( x, y );
224 void InputMethodContext::GetPreeditStyle( PreEditAttributeDataContainer& attrs ) const
226 Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle( attrs );
230 InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
232 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
235 InputMethodContext::KeyboardEventSignalType& InputMethodContext::EventReceivedSignal()
237 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).EventReceivedSignal();
240 InputMethodContext::StatusSignalType& InputMethodContext::StatusChangedSignal()
242 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).StatusChangedSignal();
245 InputMethodContext::KeyboardResizedSignalType& InputMethodContext::ResizedSignal()
247 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ResizedSignal();
250 InputMethodContext::LanguageChangedSignalType& InputMethodContext::LanguageChangedSignal()
252 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).LanguageChangedSignal();
255 InputMethodContext::KeyboardTypeSignalType& InputMethodContext::KeyboardTypeChangedSignal()
257 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).KeyboardTypeChangedSignal();
260 InputMethodContext::ContentReceivedSignalType& InputMethodContext::ContentReceivedSignal()
262 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ContentReceivedSignal();
265 InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext *impl)