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 Internal::Adaptor::InputMethodContextPtr inputMethodContext = Internal::Adaptor::InputMethodContext::New();
37 if( inputMethodContext )
39 inputMethodContext->Initialize();
42 return InputMethodContext( inputMethodContext.Get() );
45 InputMethodContext::InputMethodContext( const InputMethodContext& inputMethodContext )
46 : BaseHandle( inputMethodContext )
50 InputMethodContext& InputMethodContext::operator=( const InputMethodContext& inputMethodContext )
52 if( *this != inputMethodContext )
54 BaseHandle::operator=( inputMethodContext );
59 InputMethodContext InputMethodContext::DownCast( BaseHandle handle )
61 return InputMethodContext( dynamic_cast< Internal::Adaptor::InputMethodContext* >( handle.GetObjectPtr() ) );
64 void InputMethodContext::Finalize()
66 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Finalize();
69 void InputMethodContext::Activate()
71 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Activate();
74 void InputMethodContext::Deactivate()
76 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Deactivate();
79 bool InputMethodContext::RestoreAfterFocusLost() const
81 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost();
84 void InputMethodContext::SetRestoreAfterFocusLost( bool toggle )
86 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost( toggle );
89 void InputMethodContext::Reset()
91 Internal::Adaptor::InputMethodContext::GetImplementation(*this).Reset();
94 void InputMethodContext::NotifyCursorPosition()
96 Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition();
99 void InputMethodContext::SetCursorPosition( unsigned int SetCursorPosition )
101 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition( SetCursorPosition );
104 unsigned int InputMethodContext::GetCursorPosition() const
106 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition();
109 void InputMethodContext::SetSurroundingText( const std::string& text )
111 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText( text );
114 const std::string& InputMethodContext::GetSurroundingText() const
116 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText();
119 void InputMethodContext::NotifyTextInputMultiLine( bool multiLine )
121 Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyTextInputMultiLine( multiLine );
124 InputMethodContext::TextDirection InputMethodContext::GetTextDirection()
126 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetTextDirection();
129 Rect<int> InputMethodContext::GetInputMethodArea()
131 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputMethodArea();
134 void InputMethodContext::ApplyOptions( const InputMethodOptions& options )
136 Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions( options );
139 void InputMethodContext::SetInputPanelData( const std::string& data )
141 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelData( data );
144 void InputMethodContext::GetInputPanelData( std::string& data )
146 Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelData( data );
149 Dali::InputMethodContext::State InputMethodContext::GetInputPanelState()
151 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelState();
154 void InputMethodContext::SetReturnKeyState( bool visible )
156 Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetReturnKeyState( visible );
159 void InputMethodContext::AutoEnableInputPanel( bool enabled )
161 Internal::Adaptor::InputMethodContext::GetImplementation(*this).AutoEnableInputPanel( enabled );
164 void InputMethodContext::ShowInputPanel()
166 Internal::Adaptor::InputMethodContext::GetImplementation(*this).ShowInputPanel();
169 void InputMethodContext::HideInputPanel()
171 Internal::Adaptor::InputMethodContext::GetImplementation(*this).HideInputPanel();
174 Dali::InputMethodContext::KeyboardType InputMethodContext::GetKeyboardType()
176 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetKeyboardType();
179 std::string InputMethodContext::GetInputPanelLocale()
181 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLocale();
184 bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent )
186 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent );
189 InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
191 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
194 InputMethodContext::KeyboardEventSignalType& InputMethodContext::EventReceivedSignal()
196 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).EventReceivedSignal();
199 InputMethodContext::StatusSignalType& InputMethodContext::StatusChangedSignal()
201 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).StatusChangedSignal();
204 InputMethodContext::KeyboardResizedSignalType& InputMethodContext::ResizedSignal()
206 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ResizedSignal();
209 InputMethodContext::LanguageChangedSignalType& InputMethodContext::LanguageChangedSignal()
211 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).LanguageChangedSignal();
214 InputMethodContext::KeyboardTypeSignalType& InputMethodContext::KeyboardTypeChangedSignal()
216 return Internal::Adaptor::InputMethodContext::GetImplementation(*this).KeyboardTypeChangedSignal();
219 InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext *impl)