Add AllowTextPrediction/IsTextPredictionAllowed api
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / input-method-context.cpp
1 /*
2  * Copyright (c) 2018 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
29 InputMethodContext::InputMethodContext() = default;
30
31 InputMethodContext::~InputMethodContext() = default;
32
33 InputMethodContext InputMethodContext::New()
34 {
35   Internal::Adaptor::InputMethodContextPtr inputMethodContext = Internal::Adaptor::InputMethodContext::New();
36
37   if( inputMethodContext )
38   {
39     inputMethodContext->Initialize();
40   }
41
42   return InputMethodContext( inputMethodContext.Get() );
43 }
44
45 InputMethodContext::InputMethodContext( const InputMethodContext& inputMethodContext )
46 : BaseHandle( inputMethodContext )
47 {
48 }
49
50 InputMethodContext& InputMethodContext::operator=( const InputMethodContext& inputMethodContext )
51 {
52  if( *this != inputMethodContext )
53  {
54    BaseHandle::operator=( inputMethodContext );
55  }
56  return *this;
57 }
58
59 InputMethodContext InputMethodContext::DownCast( BaseHandle handle )
60 {
61   return InputMethodContext( dynamic_cast< Internal::Adaptor::InputMethodContext* >( handle.GetObjectPtr() ) );
62 }
63
64 void InputMethodContext::Finalize()
65 {
66   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Finalize();
67 }
68
69 void InputMethodContext::Activate()
70 {
71   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Activate();
72 }
73
74 void InputMethodContext::Deactivate()
75 {
76   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Deactivate();
77 }
78
79 bool InputMethodContext::RestoreAfterFocusLost() const
80 {
81   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost();
82 }
83
84 void InputMethodContext::SetRestoreAfterFocusLost( bool toggle )
85 {
86   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost( toggle );
87 }
88
89 void InputMethodContext::Reset()
90 {
91   Internal::Adaptor::InputMethodContext::GetImplementation(*this).Reset();
92 }
93
94 void InputMethodContext::NotifyCursorPosition()
95 {
96   Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition();
97 }
98
99 void InputMethodContext::SetCursorPosition( unsigned int SetCursorPosition )
100 {
101   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition( SetCursorPosition );
102 }
103
104 unsigned int InputMethodContext::GetCursorPosition() const
105 {
106   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition();
107 }
108
109 void InputMethodContext::SetSurroundingText( const std::string& text )
110 {
111   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText( text );
112 }
113
114 const std::string& InputMethodContext::GetSurroundingText() const
115 {
116   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText();
117 }
118
119 void InputMethodContext::NotifyTextInputMultiLine( bool multiLine )
120 {
121   Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyTextInputMultiLine( multiLine );
122 }
123
124 InputMethodContext::TextDirection InputMethodContext::GetTextDirection()
125 {
126   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetTextDirection();
127 }
128
129 Rect<int> InputMethodContext::GetInputMethodArea()
130 {
131   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputMethodArea();
132 }
133
134 void InputMethodContext::ApplyOptions( const InputMethodOptions& options )
135 {
136   Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions( options );
137 }
138
139 void InputMethodContext::SetInputPanelData( const std::string& data )
140 {
141   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelData( data );
142 }
143
144 void InputMethodContext::GetInputPanelData( std::string& data )
145 {
146   Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelData( data );
147 }
148
149 Dali::InputMethodContext::State InputMethodContext::GetInputPanelState()
150 {
151   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelState();
152 }
153
154 void InputMethodContext::SetReturnKeyState( bool visible )
155 {
156   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetReturnKeyState( visible );
157 }
158
159 void InputMethodContext::AutoEnableInputPanel( bool enabled )
160 {
161   Internal::Adaptor::InputMethodContext::GetImplementation(*this).AutoEnableInputPanel( enabled );
162 }
163
164 void InputMethodContext::ShowInputPanel()
165 {
166   Internal::Adaptor::InputMethodContext::GetImplementation(*this).ShowInputPanel();
167 }
168
169 void InputMethodContext::HideInputPanel()
170 {
171   Internal::Adaptor::InputMethodContext::GetImplementation(*this).HideInputPanel();
172 }
173
174 Dali::InputMethodContext::KeyboardType InputMethodContext::GetKeyboardType()
175 {
176   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetKeyboardType();
177 }
178
179 std::string InputMethodContext::GetInputPanelLocale()
180 {
181   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetInputPanelLocale();
182 }
183
184 bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent )
185 {
186   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent );
187 }
188
189 void InputMethodContext::AllowTextPrediction( bool prediction )
190 {
191   Internal::Adaptor::InputMethodContext::GetImplementation(*this).AllowTextPrediction( prediction );
192 }
193
194 bool InputMethodContext::IsTextPredictionAllowed() const
195 {
196   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).IsTextPredictionAllowed();
197 }
198
199 InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
200 {
201   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
202 }
203
204 InputMethodContext::KeyboardEventSignalType& InputMethodContext::EventReceivedSignal()
205 {
206   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).EventReceivedSignal();
207 }
208
209 InputMethodContext::StatusSignalType& InputMethodContext::StatusChangedSignal()
210 {
211   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).StatusChangedSignal();
212 }
213
214 InputMethodContext::KeyboardResizedSignalType& InputMethodContext::ResizedSignal()
215 {
216   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ResizedSignal();
217 }
218
219 InputMethodContext::LanguageChangedSignalType& InputMethodContext::LanguageChangedSignal()
220 {
221   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).LanguageChangedSignal();
222 }
223
224 InputMethodContext::KeyboardTypeSignalType& InputMethodContext::KeyboardTypeChangedSignal()
225 {
226   return Internal::Adaptor::InputMethodContext::GetImplementation(*this).KeyboardTypeChangedSignal();
227 }
228
229 InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext *impl)
230   : BaseHandle(impl)
231 {
232 }
233 } // namespace Dali