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