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