Dali 3D User Interface Engine
toolkit-imf-manager.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 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 "toolkit-imf-manager.h"
20 
21 // EXTERNAL INCLUDES
24 
25 namespace Dali
26 {
27 namespace Internal
28 {
29 namespace Adaptor
30 {
31 class RenderSurface;
32 
33 
35 {
36 public:
37  typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType;
38  typedef Dali::ImfManager::ImfEventSignalType ImfEventSignalType;
39 
40 public:
41  static Dali::ImfManager Get();
42 
43  ImfManager( /* Ecore_X_Window ecoreXwin */ );
44  void ConnectCallbacks();
45  void DisconnectCallbacks();
46  void Activate();
47  void Deactivate();
48  void Reset();
49 
50  bool RestoreAfterFocusLost() const;
51  void SetRestoreAfterFocusLost( bool toggle );
52  void NotifyCursorPosition();
53  void SetCursorPosition( unsigned int cursorPosition );
54  unsigned int GetCursorPosition() const;
55  void SetSurroundingText( const std::string& text );
56  const std::string& GetSurroundingText() const;
57 
58 public: // Signals
61 
62 protected:
63  virtual ~ImfManager();
64 
65 private:
66  void CreateContext( /*Ecore_X_Window ecoreXwin*/ );
67  void DeleteContext();
68 
69 private:
70  // Undefined
71  ImfManager( const ImfManager& );
73 
74 private:
76  std::string mSurroundingText;
79 
82 
83 
84  static Dali::ImfManager mToolkitImfManager;
85 
86 public:
87 
88 inline static Internal::Adaptor::ImfManager& GetImplementation(Dali::ImfManager& imfManager)
89 {
90  Dali::ImfManager actualImfManager = ImfManager::Get();
91 
92  BaseObject& handle = actualImfManager.GetBaseObject();
93  return static_cast<Internal::Adaptor::ImfManager&>(handle);
94 }
95 
96 inline static const Internal::Adaptor::ImfManager& GetImplementation(const Dali::ImfManager& imfManager)
97 {
98  Dali::ImfManager actualImfManager = ImfManager::Get();
99 
100  const BaseObject& handle = imfManager.GetBaseObject();
101  return static_cast<const Internal::Adaptor::ImfManager&>(handle);
102 }
103 
104 };
105 
107 
108 Dali::ImfManager ImfManager::Get()
109 {
110  Dali::ImfManager manager;
111 
112  if( ! mToolkitImfManager )
113  {
114  mToolkitImfManager = Dali::ImfManager( new Dali::Internal::Adaptor::ImfManager() );
115  }
116  return mToolkitImfManager;
117 }
118 
119 ImfManager::ImfManager( /*Ecore_X_Window ecoreXwin*/ )
120 : mIMFCursorPosition( 0 ),
121  mSurroundingText(),
122  mRestoreAfterFocusLost( false ),
123  mIdleCallbackConnected( false )
124 {
125  CreateContext( /*ecoreXwin*/ );
127 }
128 
130 {
132  DeleteContext();
133 }
134 
135 void ImfManager::CreateContext( /*Ecore_X_Window ecoreXwin*/ )
136 {
137 }
138 
140 {
141 }
142 
143 // Callbacks for predicitive text support.
145 {
146 }
147 
149 {
150 }
151 
153 {
154 }
155 
157 {
158 }
159 
161 {
162 }
163 
165 {
166  return mRestoreAfterFocusLost;
167 }
168 
170 {
171  mRestoreAfterFocusLost = toggle;
172 }
173 
175 {
176 }
177 
178 void ImfManager::SetCursorPosition( unsigned int cursorPosition )
179 {
180  mIMFCursorPosition = static_cast< int >( cursorPosition );
181 }
182 
183 unsigned int ImfManager::GetCursorPosition() const
184 {
185  return static_cast<unsigned int>( mIMFCursorPosition );
186 }
187 
188 void ImfManager::SetSurroundingText( const std::string& text )
189 {
190  mSurroundingText = text;
191 }
192 
193 const std::string& ImfManager::GetSurroundingText() const
194 {
195  return mSurroundingText;
196 }
197 
198 } // Adaptor
199 
200 } // Internal
201 
202 
203 /********************************************************************************/
204 /********************************* PUBLIC CLASS *******************************/
205 /********************************************************************************/
206 
207 ImfManager::ImfManager()
208 {
209 }
210 
211 ImfManager::~ImfManager()
212 {
213 }
214 
216 {
218 }
219 
220 void ImfManager::Activate()
221 {
223 }
224 
225 void ImfManager::Deactivate()
226 {
228 }
229 
230 bool ImfManager::RestoreAfterFocusLost() const
231 {
233 }
234 
235 void ImfManager::SetRestoreAfterFocusLost( bool toggle )
236 {
238 }
239 
240 void ImfManager::Reset()
241 {
243 }
244 
245 void ImfManager::NotifyCursorPosition()
246 {
248 }
249 
250 void ImfManager::SetCursorPosition( unsigned int SetCursorPosition )
251 {
253 }
254 
255 unsigned int ImfManager::GetCursorPosition() const
256 {
258 }
259 
260 void ImfManager::SetSurroundingText( const std::string& text )
261 {
263 }
264 
265 const std::string& ImfManager::GetSurroundingText() const
266 {
268 }
269 
270 ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal()
271 {
273 }
274 
275 ImfManager::ImfEventSignalType& ImfManager::EventReceivedSignal()
276 {
278 }
279 
280 ImfManager::ImfManager(Internal::Adaptor::ImfManager *impl)
281  : BaseHandle(impl)
282 {
283 }
284 
285 } // namespace Dali
Dali Docs Home
Read more about Dali