Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / ImfManager.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 using System;
17 using System.Runtime.InteropServices;
18
19 namespace Tizen.NUI
20 {
21     /// <summary>
22     /// Specifically manages the ecore input method framework which enables the virtual or hardware keyboards.
23     /// </summary>
24     public class ImfManager : BaseHandle
25     {
26         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27
28         internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ImfManager_SWIGUpcast(cPtr), cMemoryOwn)
29         {
30             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31         }
32
33         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj)
34         {
35             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
36         }
37
38         protected override void Dispose(DisposeTypes type)
39         {
40             if (disposed)
41             {
42                 return;
43             }
44
45             if (type == DisposeTypes.Explicit)
46             {
47                 //Called by User
48                 //Release your own managed resources here.
49                 //You should release all of your own disposable objects here.
50
51             }
52
53             //Release your own unmanaged resources here.
54             //You should not access any managed member here except static instance.
55             //because the execution order of Finalizes is non-deterministic.
56
57             if (swigCPtr.Handle != IntPtr.Zero)
58             {
59                 if (swigCMemOwn)
60                 {
61                     swigCMemOwn = false;
62                     NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
63                 }
64                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
65             }
66
67             base.Dispose(type);
68         }
69
70         /// <summary>
71         /// This structure is used to pass on data from the IMF regarding predictive text.
72         /// </summary>
73         public class ImfEventData : global::System.IDisposable
74         {
75             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
76             protected bool swigCMemOwn;
77
78             internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
79             {
80                 swigCMemOwn = cMemoryOwn;
81                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
82             }
83
84             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
85             {
86                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
87             }
88
89             //A Flag to check who called Dispose(). (By User or DisposeQueue)
90             private bool isDisposeQueued = false;
91             //A Flat to check if it is already disposed.
92             protected bool disposed = false;
93
94
95             ~ImfEventData()
96             {
97                 if (!isDisposeQueued)
98                 {
99                     isDisposeQueued = true;
100                     DisposeQueue.Instance.Add(this);
101                 }
102             }
103
104             /// <summary>
105             /// Dispose pattern
106             /// </summary>
107             public void Dispose()
108             {
109                 //Throw excpetion if Dispose() is called in separate thread.
110                 if (!Window.IsInstalled())
111                 {
112                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
113                 }
114
115                 if (isDisposeQueued)
116                 {
117                     Dispose(DisposeTypes.Implicit);
118                 }
119                 else
120                 {
121                     Dispose(DisposeTypes.Explicit);
122                     System.GC.SuppressFinalize(this);
123                 }
124             }
125
126             protected virtual void Dispose(DisposeTypes type)
127             {
128                 if (disposed)
129                 {
130                     return;
131                 }
132
133                 if (type == DisposeTypes.Explicit)
134                 {
135                     //Called by User
136                     //Release your own managed resources here.
137                     //You should release all of your own disposable objects here.
138
139                 }
140
141                 //Release your own unmanaged resources here.
142                 //You should not access any managed member here except static instance.
143                 //because the execution order of Finalizes is non-deterministic.
144
145                 if (swigCPtr.Handle != IntPtr.Zero)
146                 {
147                     if (swigCMemOwn)
148                     {
149                         swigCMemOwn = false;
150                         NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
151                     }
152                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
153                 }
154
155                 disposed = true;
156             }
157
158             internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
159             {
160                 ImfEventData ret = new ImfEventData(cPtr, false);
161                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162                 return ret;
163             }
164
165             /// <summary>
166             /// Default Constructor
167             /// </summary>
168             public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
169             {
170                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171             }
172
173             /// <summary>
174             /// Constructor
175             /// </summary>
176             /// <param name="aEventName">The name of the event from the IMF.</param>
177             /// <param name="aPredictiveString">The pre-edit or commit string.</param>
178             /// <param name="aCursorOffset">Start position from the current cursor position to start deleting characters.</param>
179             /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
180             public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
181             {
182                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183             }
184
185             /// <summary>
186             /// The pre-edit or commit string.
187             /// </summary>
188             [Obsolete("Please do not use! this will be deprecated")]
189             public string predictiveString
190             {
191                 set
192                 {
193                     NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
194                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195                 }
196                 get
197                 {
198                     string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
199                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200                     return ret;
201                 }
202             }
203
204             /// <summary>
205             /// The pre-edit or commit string.
206             /// </summary>
207             public string PredictiveString
208             {
209                 set
210                 {
211                     NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
212                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213                 }
214                 get
215                 {
216                     string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
217                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218                     return ret;
219                 }
220             }
221
222             /// <summary>
223             /// The name of the event from the IMF.
224             /// </summary>
225             [Obsolete("Please do not use! this will be deprecated")]
226             public ImfManager.ImfEvent eventName
227             {
228                 set
229                 {
230                     NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
231                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232                 }
233                 get
234                 {
235                     ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
236                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237                     return ret;
238                 }
239             }
240
241             /// <summary>
242             /// The name of the event from the IMF.
243             /// </summary>
244             public ImfManager.ImfEvent EventName
245             {
246                 set
247                 {
248                     NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
249                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250                 }
251                 get
252                 {
253                     ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
254                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255                     return ret;
256                 }
257             }
258
259             /// <summary>
260             /// Start position from the current cursor position to start deleting characters.
261             /// </summary>
262             [Obsolete("Please do not use! this will be deprecated")]
263             public int cursorOffset
264             {
265                 set
266                 {
267                     NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
268                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269                 }
270                 get
271                 {
272                     int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
273                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274                     return ret;
275                 }
276             }
277
278             /// <summary>
279             /// Start position from the current cursor position to start deleting characters.
280             /// </summary>
281             public int CursorOffset
282             {
283                 set
284                 {
285                     NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
286                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287                 }
288                 get
289                 {
290                     int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
291                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292                     return ret;
293                 }
294             }
295
296             /// <summary>
297             /// Number of characters to delete from the cursorOffset.
298             /// </summary>
299             [Obsolete("Please do not use! this will be deprecated")]
300             public int numberOfChars
301             {
302                 set
303                 {
304                     NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
305                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306                 }
307                 get
308                 {
309                     int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
310                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311                     return ret;
312                 }
313             }
314
315             /// <summary>
316             /// Number of characters to delete from the cursorOffset.
317             /// </summary>
318             public int NumberOfChars
319             {
320                 set
321                 {
322                     NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
323                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324                 }
325                 get
326                 {
327                     int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
328                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329                     return ret;
330                 }
331             }
332
333         }
334
335         /// <summary>
336         /// Data required by IMF from the callback.
337         /// </summary>
338         public class ImfCallbackData : global::System.IDisposable
339         {
340             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
341             protected bool swigCMemOwn;
342
343             internal IntPtr GetImfCallbackDataPtr()
344             {
345                 return (IntPtr)swigCPtr;
346             }
347
348             internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
349             {
350                 swigCMemOwn = cMemoryOwn;
351                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
352             }
353
354             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
355             {
356                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
357             }
358
359             //A Flag to check who called Dispose(). (By User or DisposeQueue)
360             private bool isDisposeQueued = false;
361             //A Flat to check if it is already disposed.
362             protected bool disposed = false;
363
364
365             ~ImfCallbackData()
366             {
367                 if (!isDisposeQueued)
368                 {
369                     isDisposeQueued = true;
370                     DisposeQueue.Instance.Add(this);
371                 }
372             }
373
374             /// <summary>
375             /// Dispose pattern
376             /// </summary>
377             public void Dispose()
378             {
379                 //Throw excpetion if Dispose() is called in separate thread.
380                 if (!Window.IsInstalled())
381                 {
382                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
383                 }
384
385                 if (isDisposeQueued)
386                 {
387                     Dispose(DisposeTypes.Implicit);
388                 }
389                 else
390                 {
391                     Dispose(DisposeTypes.Explicit);
392                     System.GC.SuppressFinalize(this);
393                 }
394             }
395
396             protected virtual void Dispose(DisposeTypes type)
397             {
398                 if (disposed)
399                 {
400                     return;
401                 }
402
403                 if (type == DisposeTypes.Explicit)
404                 {
405                     //Called by User
406                     //Release your own managed resources here.
407                     //You should release all of your own disposable objects here.
408
409                 }
410
411                 //Release your own unmanaged resources here.
412                 //You should not access any managed member here except static instance.
413                 //because the execution order of Finalizes is non-deterministic.
414
415                 if (swigCPtr.Handle != IntPtr.Zero)
416                 {
417                     if (swigCMemOwn)
418                     {
419                         swigCMemOwn = false;
420                         NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
421                     }
422                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
423                 }
424
425                 disposed = true;
426             }
427
428             internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
429             {
430                 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
431                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
432                 return ret;
433             }
434
435             /// <summary>
436             /// Default Constructor
437             /// </summary>
438             public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
439             {
440                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
441             }
442
443             /// <summary>
444             /// Constructor
445             /// </summary>
446             /// <param name="aUpdate">True if cursor position needs to be updated.</param>
447             /// <param name="aCursorPosition">New position of cursor.</param>
448             /// <param name="aCurrentText">Current text string.</param>
449             /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
450             public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
451             {
452                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453             }
454
455             /// <summary>
456             /// Current text string.
457             /// </summary>
458             [Obsolete("Please do not use! this will be deprecated")]
459             public string currentText
460             {
461                 set
462                 {
463                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
464                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465                 }
466                 get
467                 {
468                     string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
469                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470                     return ret;
471                 }
472             }
473
474             /// <summary>
475             /// Current text string.
476             /// </summary>
477             public string CurrentText
478             {
479                 set
480                 {
481                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
482                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
483                 }
484                 get
485                 {
486                     string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
487                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
488                     return ret;
489                 }
490             }
491
492             /// <summary>
493             /// Current text string.
494             /// </summary>
495             [Obsolete("Please do not use! this will be deprecated")]
496             public int cursorPosition
497             {
498                 set
499                 {
500                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
501                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
502                 }
503                 get
504                 {
505                     int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
506                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507                     return ret;
508                 }
509             }
510
511             /// <summary>
512             /// Current text string.
513             /// </summary>
514             public int CursorPosition
515             {
516                 set
517                 {
518                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
519                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
520                 }
521                 get
522                 {
523                     int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
524                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525                     return ret;
526                 }
527             }
528
529             /// <summary>
530             /// If cursor position needs to be updated.
531             /// </summary>
532             [Obsolete("Please do not use! this will be deprecated")]
533             public bool update
534             {
535                 set
536                 {
537                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
538                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
539                 }
540                 get
541                 {
542                     bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
543                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
544                     return ret;
545                 }
546             }
547
548             /// <summary>
549             /// If cursor position needs to be updated.
550             /// </summary>
551             public bool Update
552             {
553                 set
554                 {
555                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
556                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557                 }
558                 get
559                 {
560                     bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
561                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
562                     return ret;
563                 }
564             }
565
566             /// <summary>
567             /// Flag if preedit reset is required.
568             /// </summary>
569             [Obsolete("Please do not use! this will be deprecated")]
570             public bool preeditResetRequired
571             {
572                 set
573                 {
574                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
575                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576                 }
577                 get
578                 {
579                     bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
580                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
581                     return ret;
582                 }
583             }
584
585             /// <summary>
586             /// Flag if preedit reset is required.
587             /// </summary>
588             public bool PreeditResetRequired
589             {
590                 set
591                 {
592                     NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
593                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
594                 }
595                 get
596                 {
597                     bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
598                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599                     return ret;
600                 }
601             }
602
603         }
604
605         /// <summary>
606         /// Retrieve a handle to the instance of ImfManager.
607         /// </summary>
608         /// <returns>A handle to the ImfManager.</returns>
609         public static ImfManager Get()
610         {
611             ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
612             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613             return ret;
614         }
615
616         /// <summary>
617         /// Activate the IMF.<br/>
618         /// It means that the text editing is started at somewhere.<br/>
619         /// If the H/W keyboard isn't connected then it will show the virtual keyboard.
620         /// </summary>
621         public void Activate()
622         {
623             NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
624             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625         }
626
627         /// <summary>
628         /// Deactivate the IMF.<br/>
629         /// It means that the text editing is finished at somewhere.
630         /// </summary>
631         public void Deactivate()
632         {
633             NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
634             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
635         }
636
637         /// <summary>
638         /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.<br/>
639         /// If true then keyboard will be restored (activated) after focus is regained.
640         /// </summary>
641         /// <returns>Restoration status.</returns>
642         public bool RestoreAfterFocusLost()
643         {
644             bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
645             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646             return ret;
647         }
648
649         /// <summary>
650         /// Set status whether the IMF has to restore the keyboard after losing focus.
651         /// </summary>
652         /// <param name="toggle">True means that keyboard should be restored after focus lost and regained.</param>
653         public void SetRestoreAfterFocusLost(bool toggle)
654         {
655             NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
656             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
657         }
658
659         /// <summary>
660         /// Send message reset the pred-edit state / imf module.
661         /// </summary>
662         public new void Reset()
663         {
664             NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
665             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666         }
667
668         /// <summary>
669         /// Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation.
670         /// </summary>
671         public void NotifyCursorPosition()
672         {
673             NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
674             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
675         }
676
677         /// <summary>
678         /// Sets cursor position stored in VirtualKeyboard, this is required by the IMF context.
679         /// </summary>
680         /// <param name="cursorPosition">Position of cursor.</param>
681         public void SetCursorPosition(uint cursorPosition)
682         {
683             NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
684             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
685         }
686
687         /// <summary>
688         /// Gets cursor position stored in VirtualKeyboard, this is required by the IMF context.
689         /// </summary>
690         /// <returns>Current position of cursor</returns>
691         public uint GetCursorPosition()
692         {
693             uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
694             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
695             return ret;
696         }
697
698         /// <summary>
699         /// Method to store the string required by the IMF, this is used to provide predictive word suggestions.
700         /// </summary>
701         /// <param name="text">The text string surrounding the current cursor point.</param>
702         public void SetSurroundingText(string text)
703         {
704             NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
705             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706         }
707
708         /// <summary>
709         /// Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
710         /// </summary>
711         /// <returns>Surrounding text.</returns>
712         public string GetSurroundingText()
713         {
714             string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
715             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
716             return ret;
717         }
718
719         /// <summary>
720         /// Notifies IMF context that text input is set to multi line or not.
721         /// </summary>
722         /// <param name="multiLine">True if multiline text input is used.</param>
723         public void NotifyTextInputMultiLine(bool multiLine)
724         {
725             NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
726             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
727         }
728
729         /// <summary>
730         /// Returns text direction of the keyboard's current input language.
731         /// </summary>
732         /// <returns>The direction of the text.</returns>
733         public ImfManager.TextDirection GetTextDirection()
734         {
735             ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
736             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
737             return ret;
738         }
739
740         /// <summary>
741         /// Provides size and position of keyboard.<br/>
742         /// Position is relative to whether keyboard is visible or not.<br/>
743         /// If keyboard is not visible then position will be off the screen.<br/>
744         /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get<br/>
745         /// the values then taken down.  So ideally GetInputMethodArea() should be called after Show().
746         /// </summary>
747         /// <returns>Rectangle which is keyboard panel x, y, width, height</returns>
748         public Rectangle GetInputMethodArea()
749         {
750             Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
751             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
752             return ret;
753         }
754
755         internal void ApplyOptions(InputMethodOptions options)
756         {
757             NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
758             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
759         }
760
761         /// <summary>
762         /// Sets up the input-panel specific data.
763         /// </summary>
764         /// <param name="text">The specific data to be set to the input panel.</param>
765         public void SetInputPanelUserData(string text)
766         {
767             NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
768             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
769         }
770
771         /// <summary>
772         /// Gets the specific data of the current active input panel.
773         /// </summary>
774         /// <param name="text">The specific data to be got from the input panel.</param>
775         public void GetInputPanelUserData(out string text)
776         {
777             NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
778             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
779         }
780
781         /// <summary>
782         /// Gets the state of the current active input panel.
783         /// </summary>
784         /// <returns>The state of the input panel.</returns>
785         public ImfManager.State GetInputPanelState()
786         {
787             ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
788             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
789             return ret;
790         }
791
792         /// <summary>
793         /// Sets the return key on the input panel to be visible or invisible.<br/>
794         /// The default is true.
795         /// </summary>
796         /// <param name="visible">True if the return key is visible(enabled), false otherwise.</param>
797         public void SetReturnKeyState(bool visible)
798         {
799             NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
800             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801         }
802
803         /// <summary>
804         /// Enable to show the input panel automatically when focused.
805         /// </summary>
806         /// <param name="enabled">If true, the input panel will be shown when focused.</param>
807         public void AutoEnableInputPanel(bool enabled)
808         {
809             NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
810             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
811         }
812
813         /// <summary>
814         /// Shows the input panel.
815         /// </summary>
816         public void ShowInputPanel()
817         {
818             NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
819             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
820         }
821
822         /// <summary>
823         /// Hides the input panel.
824         /// </summary>
825         public void HideInputPanel()
826         {
827             NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
828             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
829         }
830
831         /// <summary>
832         /// Gets the keyboard type.<br/>
833         /// The default keyboard type is SoftwareKeyboard.
834         /// </summary>
835         /// <returns>The keyboard type</returns>
836         public ImfManager.KeyboardType GetKeyboardType()
837         {
838             ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
839             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840             return ret;
841         }
842
843         /// <summary>
844         /// Gets the current language locale of the input panel.<br/>
845         /// Ex) en_US, en_GB, en_PH, fr_FR, ...
846         /// </summary>
847         /// <returns>The current language locale of the input panel.</returns>
848         public string GetInputPanelLocale()
849         {
850             string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
851             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
852             return ret;
853         }
854
855         /// <summary>
856         /// Constructor
857         /// </summary>
858         public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
859         {
860             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
861         }
862
863         /// <summary>
864         /// ImfManager activated event arguments.
865         /// </summary>
866         [Obsolete("Please do not use! this will be deprecated")]
867         public class ImfManagerActivatedEventArgs : EventArgs
868         {
869             public ImfManager ImfManager
870             {
871                 get;
872                 set;
873             }
874         }
875
876         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
877         private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
878         private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
879         private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
880
881         /// <summary>
882         /// ImfManager activated event.
883         /// </summary>
884         [Obsolete("Please do not use! this will be deprecated")]
885         public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
886         {
887             add
888             {
889                 if (_imfManagerActivatedEventHandler == null)
890                 {
891                     _imfManagerActivatedEventCallback = OnImfManagerActivated;
892                     ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
893                 }
894
895                 _imfManagerActivatedEventHandler += value;
896             }
897             remove
898             {
899                 _imfManagerActivatedEventHandler -= value;
900
901                 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
902                 {
903                     ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
904                 }
905             }
906         }
907
908         private void OnImfManagerActivated(global::System.IntPtr data)
909         {
910             ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
911
912             if (data != null)
913             {
914                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
915             }
916
917             if (_imfManagerActivatedEventHandler != null)
918             {
919                 _imfManagerActivatedEventHandler(this, e);
920             }
921         }
922
923         /// <summary>
924         /// ImfManager activated event arguments.
925         /// </summary>
926         public class ActivatedEventArgs : EventArgs
927         {
928             public ImfManager ImfManager
929             {
930                 get;
931                 set;
932             }
933         }
934
935         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
936         private delegate void ActivatedEventCallbackType(IntPtr data);
937         private ActivatedEventCallbackType _activatedEventCallback;
938         private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
939
940         /// <summary>
941         /// ImfManager activated.
942         /// </summary>
943         public event EventHandler<ActivatedEventArgs> Activated
944         {
945             add
946             {
947                 if (_activatedEventHandler == null)
948                 {
949                     _activatedEventCallback = OnActivated;
950                     ActivatedSignal().Connect(_activatedEventCallback);
951                 }
952
953                 _activatedEventHandler += value;
954             }
955             remove
956             {
957                 _activatedEventHandler -= value;
958
959                 if (_activatedEventHandler == null && _activatedEventCallback != null)
960                 {
961                     ActivatedSignal().Disconnect(_activatedEventCallback);
962                 }
963             }
964         }
965
966         private void OnActivated(IntPtr data)
967         {
968             ActivatedEventArgs e = new ActivatedEventArgs();
969
970             if (data != null)
971             {
972                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
973             }
974
975             if (_activatedEventHandler != null)
976             {
977                 _activatedEventHandler(this, e);
978             }
979         }
980
981         /// <summary>
982         /// ImfManager activated signal.
983         /// </summary>
984         [Obsolete("Please do not use! this will be internal")]
985         public ActivatedSignalType ActivatedSignal()
986         {
987             ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
988             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
989             return ret;
990         }
991
992         /// <summary>
993         /// ImfManager event received event arguments.
994         /// </summary>
995         [Obsolete("Please do not use! this will be deprecated")]
996         public class ImfManagerEventReceivedEventArgs : EventArgs
997         {
998             public ImfManager ImfManager
999             {
1000                 get;
1001                 set;
1002             }
1003         }
1004
1005         private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
1006         private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
1007         private event EventHandler<ImfManagerEventReceivedEventArgs> _imfManagerEventReceivedEventHandler;
1008
1009         /// <summary>
1010         /// ImfManager event received.
1011         /// </summary>
1012         [Obsolete("Please do not use! this will be deprecated")]
1013         public event EventHandler<ImfManagerEventReceivedEventArgs> ImfManagerEventReceived
1014         {
1015             add
1016             {
1017                 if (_imfManagerEventReceivedEventHandler == null)
1018                 {
1019                     _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
1020                     EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
1021                 }
1022
1023                 _imfManagerEventReceivedEventHandler += value;
1024             }
1025             remove
1026             {
1027                 _imfManagerEventReceivedEventHandler -= value;
1028
1029                 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
1030                 {
1031                     EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
1032                 }
1033             }
1034         }
1035
1036         private void OnImfManagerEventReceived(global::System.IntPtr data)
1037         {
1038             ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
1039
1040             if (data != null)
1041             {
1042                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1043             }
1044
1045             if (_imfManagerEventReceivedEventHandler != null)
1046             {
1047                 _imfManagerEventReceivedEventHandler(this, e);
1048             }
1049         }
1050
1051         /// <summary>
1052         /// ImfManager event received event arguments.
1053         /// </summary>
1054         public class EventReceivedEventArgs : EventArgs
1055         {
1056             public ImfManager ImfManager
1057             {
1058                 get;
1059                 set;
1060             }
1061
1062             public ImfEventData ImfEventData
1063             {
1064                 get;
1065                 set;
1066             }
1067         }
1068
1069         private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
1070         private EventReceivedEventCallbackType _eventReceivedEventCallback;
1071         private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
1072
1073         /// <summary>
1074         /// ImfManager event received.
1075         /// </summary>
1076         public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
1077         {
1078             add
1079             {
1080                 if (_eventReceivedEventHandler == null)
1081                 {
1082                     _eventReceivedEventCallback = OnEventReceived;
1083                     EventReceivedSignal().Connect(_eventReceivedEventCallback);
1084                 }
1085
1086                 _eventReceivedEventHandler += value;
1087             }
1088             remove
1089             {
1090                 _eventReceivedEventHandler -= value;
1091
1092                 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
1093                 {
1094                     EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
1095                 }
1096             }
1097         }
1098
1099         private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
1100         {
1101             ImfCallbackData imfCallbackData = null;
1102
1103             EventReceivedEventArgs e = new EventReceivedEventArgs();
1104
1105             if (imfManager != null)
1106             {
1107                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
1108             }
1109             if (imfEventData != null)
1110             {
1111                 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
1112             }
1113
1114             if (_eventReceivedEventHandler != null)
1115             {
1116                 imfCallbackData = _eventReceivedEventHandler(this, e);
1117             }
1118             if (imfCallbackData != null)
1119             {
1120                 return imfCallbackData.GetImfCallbackDataPtr();
1121             }
1122             else
1123             {
1124                 return new ImfCallbackData().GetImfCallbackDataPtr();
1125             }
1126         }
1127
1128         /// <summary>
1129         /// ImfManager event received signal.
1130         /// </summary>
1131         [Obsolete("Please do not use! this will be internal")]
1132         public ImfEventSignalType EventReceivedSignal()
1133         {
1134             ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
1135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1136             return ret;
1137         }
1138
1139         /// <summary>
1140         /// ImfManager status changed event arguments.
1141         /// </summary>
1142         [Obsolete("Please do not use! this will be deprecated")]
1143         public class ImfManagerStatusChangedEventArgs : EventArgs
1144         {
1145             public ImfManager ImfManager
1146             {
1147                 get;
1148                 set;
1149             }
1150         }
1151
1152         private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data);
1153         private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
1154         private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
1155
1156         /// <summary>
1157         /// ImfManager status changed.
1158         /// </summary>
1159         [Obsolete("Please do not use! this will be deprecated")]
1160         public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
1161         {
1162             add
1163             {
1164                 if (_imfManagerStatusChangedEventHandler == null)
1165                 {
1166                     _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
1167                     StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
1168                 }
1169
1170                 _imfManagerStatusChangedEventHandler += value;
1171             }
1172             remove
1173             {
1174                 _imfManagerStatusChangedEventHandler -= value;
1175
1176                 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
1177                 {
1178                     StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
1179                 }
1180             }
1181         }
1182
1183         private void OnImfManagerStatusChanged(global::System.IntPtr data)
1184         {
1185             ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
1186
1187             if (data != null)
1188             {
1189                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1190             }
1191
1192             if (_imfManagerStatusChangedEventHandler != null)
1193             {
1194                 _imfManagerStatusChangedEventHandler(this, e);
1195             }
1196         }
1197
1198         /// <summary>
1199         /// ImfManager status changed event arguments.
1200         /// </summary>
1201         public class StatusChangedEventArgs : EventArgs
1202         {
1203             public bool StatusChanged
1204             {
1205                 get;
1206                 set;
1207             }
1208         }
1209
1210         private delegate void StatusChangedEventCallbackType(bool statusChanged);
1211         private StatusChangedEventCallbackType _statusChangedEventCallback;
1212         private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1213
1214         /// <summary>
1215         /// ImfManager status changed.
1216         /// </summary>
1217         public event EventHandler<StatusChangedEventArgs> StatusChanged
1218         {
1219             add
1220             {
1221                 if (_statusChangedEventHandler == null)
1222                 {
1223                     _statusChangedEventCallback = OnStatusChanged;
1224                     StatusChangedSignal().Connect(_statusChangedEventCallback);
1225                 }
1226
1227                 _statusChangedEventHandler += value;
1228             }
1229             remove
1230             {
1231                 _statusChangedEventHandler -= value;
1232
1233                 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1234                 {
1235                     StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1236                 }
1237             }
1238         }
1239
1240         private void OnStatusChanged(bool statusChanged)
1241         {
1242             StatusChangedEventArgs e = new StatusChangedEventArgs();
1243
1244             e.StatusChanged = statusChanged;
1245
1246             if (_statusChangedEventHandler != null)
1247             {
1248                 _statusChangedEventHandler(this, e);
1249             }
1250         }
1251
1252         /// <summary>
1253         /// ImfManager status changed signal.
1254         /// </summary>
1255         [Obsolete("Please do not use! this will be internal")]
1256         public StatusSignalType StatusChangedSignal()
1257         {
1258             StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
1259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1260             return ret;
1261         }
1262
1263         /// <summary>
1264         /// ImfManager resized event arguments.
1265         /// </summary>
1266         [Obsolete("Please do not use! this will be deprecated")]
1267         public class ImfManagerResizedEventArgs : EventArgs
1268         {
1269             public ImfManager ImfManager
1270             {
1271                 get;
1272                 set;
1273             }
1274         }
1275
1276         private delegate void ImfManagerResizedEventCallbackType(IntPtr data);
1277         private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
1278         private event EventHandler<ImfManagerResizedEventArgs> _imfManagerResizedEventHandler;
1279
1280         /// <summary>
1281         /// ImfManager resized event.
1282         /// </summary>
1283         [Obsolete("Please do not use! this will be deprecated")]
1284         public event EventHandler<ImfManagerResizedEventArgs> ImfManagerResized
1285         {
1286             add
1287             {
1288                 if (_imfManagerResizedEventHandler == null)
1289                 {
1290                     _imfManagerResizedEventCallback = OnImfManagerResized;
1291                     ResizedSignal().Connect(_imfManagerResizedEventCallback);
1292                 }
1293
1294                 _imfManagerResizedEventHandler += value;
1295             }
1296             remove
1297             {
1298                 _imfManagerResizedEventHandler -= value;
1299
1300                 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
1301                 {
1302                     ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
1303                 }
1304             }
1305         }
1306
1307         private void OnImfManagerResized(IntPtr data)
1308         {
1309             ImfManagerResizedEventArgs e = new ImfManagerResizedEventArgs();
1310
1311             if (data != null)
1312             {
1313                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1314             }
1315
1316             if (_imfManagerResizedEventHandler != null)
1317             {
1318                 _imfManagerResizedEventHandler(this, e);
1319             }
1320         }
1321
1322         private delegate void ResizedEventCallbackType();
1323         private ResizedEventCallbackType _resizedEventCallback;
1324         private event EventHandler _resizedEventHandler;
1325
1326         /// <summary>
1327         /// ImfManager resized.
1328         /// </summary>
1329         public event EventHandler Resized
1330         {
1331             add
1332             {
1333                 if (_resizedEventHandler == null)
1334                 {
1335                     _resizedEventCallback = OnResized;
1336                     ResizedSignal().Connect(_resizedEventCallback);
1337                 }
1338
1339                 _resizedEventHandler += value;
1340             }
1341             remove
1342             {
1343                 _resizedEventHandler -= value;
1344
1345                 if (_resizedEventHandler == null && _resizedEventCallback != null)
1346                 {
1347                     ResizedSignal().Disconnect(_resizedEventCallback);
1348                 }
1349             }
1350         }
1351
1352         private void OnResized()
1353         {
1354             if (_resizedEventHandler != null)
1355             {
1356                 _resizedEventHandler(this, null);
1357             }
1358         }
1359
1360         /// <summary>
1361         /// ImfManager resized signal.
1362         /// </summary>
1363         [Obsolete("Please do not use! this will be internal")]
1364         public ImfVoidSignalType ResizedSignal()
1365         {
1366             ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), false);
1367             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1368             return ret;
1369         }
1370
1371         /// <summary>
1372         /// ImfManager language changed event arguments.
1373         /// </summary>
1374         [Obsolete("Please do not use! this will be deprecated")]
1375         public class ImfManagerLanguageChangedEventArgs : EventArgs
1376         {
1377             public ImfManager ImfManager
1378             {
1379                 get;
1380                 set;
1381             }
1382         }
1383
1384         private delegate void ImfManagerLanguageChangedEventCallbackType(IntPtr data);
1385         private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
1386         private event EventHandler<ImfManagerLanguageChangedEventArgs> _imfManagerLanguageChangedEventHandler;
1387
1388         /// <summary>
1389         /// ImfManager language changed event.
1390         /// </summary>
1391         [Obsolete("Please do not use! this will be deprecated")]
1392         public event EventHandler<ImfManagerLanguageChangedEventArgs> ImfManagerLanguageChanged
1393         {
1394             add
1395             {
1396                 if (_imfManagerLanguageChangedEventHandler == null)
1397                 {
1398                     _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
1399                     LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
1400                 }
1401
1402                 _imfManagerLanguageChangedEventHandler += value;
1403             }
1404             remove
1405             {
1406                 _imfManagerLanguageChangedEventHandler -= value;
1407
1408                 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
1409                 {
1410                     LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
1411                 }
1412             }
1413         }
1414
1415         private void OnImfManagerLanguageChanged(IntPtr data)
1416         {
1417             ImfManagerLanguageChangedEventArgs e = new ImfManagerLanguageChangedEventArgs();
1418
1419             if (data != null)
1420             {
1421                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1422             }
1423
1424             if (_imfManagerLanguageChangedEventHandler != null)
1425             {
1426                 _imfManagerLanguageChangedEventHandler(this, e);
1427             }
1428         }
1429
1430         private delegate void LanguageChangedEventCallbackType();
1431         private LanguageChangedEventCallbackType _languageChangedEventCallback;
1432         private event EventHandler _languageChangedEventHandler;
1433
1434         /// <summary>
1435         /// ImfManager language changed.
1436         /// </summary>
1437         public event EventHandler LanguageChanged
1438         {
1439             add
1440             {
1441                 if (_languageChangedEventHandler == null)
1442                 {
1443                     _languageChangedEventCallback = OnLanguageChanged;
1444                     LanguageChangedSignal().Connect(_languageChangedEventCallback);
1445                 }
1446
1447                 _languageChangedEventHandler += value;
1448             }
1449             remove
1450             {
1451                 _languageChangedEventHandler -= value;
1452
1453                 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1454                 {
1455                     LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1456                 }
1457             }
1458         }
1459
1460         private void OnLanguageChanged()
1461         {
1462             if (_languageChangedEventHandler != null)
1463             {
1464                 _languageChangedEventHandler(this, null);
1465             }
1466         }
1467
1468         /// <summary>
1469         /// ImfManager language changed signal.
1470         /// </summary>
1471         [Obsolete("Please do not use! this will be internal")]
1472         public ImfVoidSignalType LanguageChangedSignal()
1473         {
1474             ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), false);
1475             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1476             return ret;
1477         }
1478
1479         /// <summary>
1480         /// ImfManager keyboard type changed event arguments.
1481         /// </summary>
1482         public class KeyboardTypeChangedEventArgs : EventArgs
1483         {
1484             public KeyboardType KeyboardType
1485             {
1486                 get;
1487                 set;
1488             }
1489         }
1490
1491         private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1492         private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1493         private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1494
1495         /// <summary>
1496         /// ImfManager keyboard type changed.
1497         /// </summary>
1498         public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1499         {
1500             add
1501             {
1502                 if (_keyboardTypeChangedEventHandler == null)
1503                 {
1504                     _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1505                     KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1506                 }
1507
1508                 _keyboardTypeChangedEventHandler += value;
1509             }
1510             remove
1511             {
1512                 _keyboardTypeChangedEventHandler -= value;
1513
1514                 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1515                 {
1516                     KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1517                 }
1518             }
1519         }
1520
1521         private void OnKeyboardTypeChanged(KeyboardType type)
1522         {
1523             KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1524
1525             e.KeyboardType = type;
1526
1527             if (_keyboardTypeChangedEventHandler != null)
1528             {
1529                 _keyboardTypeChangedEventHandler(this, e);
1530             }
1531         }
1532
1533         internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1534         {
1535             KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1536             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1537             return ret;
1538         }
1539
1540         /// <summary>
1541         /// The direction of text.
1542         /// </summary>
1543         public enum TextDirection
1544         {
1545             /// <summary>
1546             /// Left to right.
1547             /// </summary>
1548             LeftToRight,
1549             /// <summary>
1550             /// Right to left.
1551             /// </summary>
1552             RightToLeft
1553         }
1554
1555         /// <summary>
1556         /// Events that are generated by the IMF.
1557         /// </summary>
1558         public enum ImfEvent
1559         {
1560             /// <summary>
1561             /// No event.
1562             /// </summary>
1563             Void,
1564             /// <summary>
1565             /// Pre-Edit changed.
1566             /// </summary>
1567             Preedit,
1568             /// <summary>
1569             /// Commit recieved.
1570             /// </summary>
1571             Commit,
1572             /// <summary>
1573             /// Event to delete a range of characters from the string.
1574             /// </summary>
1575             DeleteSurrounding,
1576             /// <summary>
1577             /// Event to query string and cursor position.
1578             /// </summary>
1579             GetSurrounding,
1580             /// <summary>
1581             /// Private command sent from the input panel.
1582             /// </summary>
1583             PrivateCommand
1584         }
1585
1586         /// <summary>
1587         /// Enumeration for state of the input panel.
1588         /// </summary>
1589         public enum State
1590         {
1591             /// <summary>
1592             /// Unknown state.
1593             /// </summary>
1594             Default = 0,
1595             /// <summary>
1596             /// Input panel is shown.
1597             /// </summary>
1598             Show,
1599             /// <summary>
1600             /// Input panel is hidden.
1601             /// </summary>
1602             Hide,
1603             /// <summary>
1604             /// Input panel in process of being shown.
1605             /// </summary>
1606             WillShow
1607         }
1608
1609         /// <summary>
1610         /// Enumeration for the type of Keyboard.
1611         /// </summary>
1612         public enum KeyboardType
1613         {
1614             /// <summary>
1615             /// Software keyboard (Virtual keyboard) is default.
1616             /// </summary>
1617             SoftwareKeyboard,
1618             /// <summary>
1619             /// Hardware keyboard.
1620             /// </summary>
1621             HardwareKeyboard
1622         }
1623     }
1624 }