a7cd1c57bc28dd8ec94436d1b5eef5566ae0136f
[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 (_imfKeyboardTypeChangedEventCallback != null)
58             {
59                 KeyboardTypeChangedSignal().Disconnect(_imfKeyboardTypeChangedEventCallback);
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             /// 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             /// 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             /// Constructor
205             /// </summary>
206             /// <param name="aEventName">The name of the event from the IMF.</param>
207             /// <param name="aPredictiveString">The pre-edit or commit string.</param>
208             /// <param name="aCursorOffset">Start 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 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 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             /// 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             /// 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             /// 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             /// 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 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             /// 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             /// 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             /// Constructor
475             /// </summary>
476             /// <param name="aUpdate">True if cursor position needs to be updated.</param>
477             /// <param name="aCursorPosition">New position of cursor.</param>
478             /// <param name="aCurrentText">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             /// 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             /// 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             /// 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             /// 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 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 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             /// Flag 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             /// Flag 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         /// Retrieve a handle to the instance of 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         /// Activate the IMF.<br/>
648         /// It means that the text editing is started at somewhere.<br/>
649         /// If the H/W 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         /// Deactivate the IMF.<br/>
659         /// It means that the text editing is finished at 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         /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.<br/>
669         /// If true then keyboard will be restored (activated) after focus is regained.
670         /// </summary>
671         /// <returns>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         /// Set 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 focus 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         /// Send message reset the pred-edit state / 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 IMF context that the cursor position has changed, required for features like auto-capitalisation.
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 cursor position stored in VirtualKeyboard, this is required by the IMF context.
709         /// </summary>
710         /// <param name="cursorPosition">Position of 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 cursor position stored in VirtualKeyboard, this is required by the IMF context.
719         /// </summary>
720         /// <returns>Current position of 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         /// 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 current text string set within the IMF manager, this is used to offer predictive suggestions.
740         /// </summary>
741         /// <returns>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 IMF context that text input is set to multi line 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 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 size and position of keyboard.<br/>
772         /// Position is relative to whether keyboard is visible or not.<br/>
773         /// If keyboard is not visible then position will be off the screen.<br/>
774         /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get<br/>
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 got 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         /// Enable 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         /// Ex) 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         /// Constructor
887         /// </summary>
888         public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
889         {
890             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
891         }
892
893         internal static ImfManager GetImfManagerFromPtr(IntPtr cPtr)
894         {
895             ImfManager ret = new ImfManager(cPtr, false);
896             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
897             return ret;
898         }
899
900         /// <summary>
901         /// ImfManager activated event arguments.
902         /// </summary>
903         [Obsolete("Please do not use! this will be deprecated")]
904         public class ImfManagerActivatedEventArgs : EventArgs
905         {
906             public ImfManager ImfManager
907             {
908                 get;
909                 set;
910             }
911         }
912
913         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
914         private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
915         private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
916         private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
917
918         /// <summary>
919         /// ImfManager activated event.
920         /// </summary>
921         [Obsolete("Please do not use! this will be deprecated")]
922         public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
923         {
924             add
925             {
926                 if (_imfManagerActivatedEventHandler == null)
927                 {
928                     _imfManagerActivatedEventCallback = OnImfManagerActivated;
929                     ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
930                 }
931
932                 _imfManagerActivatedEventHandler += value;
933             }
934             remove
935             {
936                 _imfManagerActivatedEventHandler -= value;
937
938                 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
939                 {
940                     ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
941                 }
942             }
943         }
944
945         private void OnImfManagerActivated(global::System.IntPtr data)
946         {
947             ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
948
949             e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
950
951             if (_imfManagerActivatedEventHandler != null)
952             {
953                 _imfManagerActivatedEventHandler(this, e);
954             }
955         }
956
957         /// <summary>
958         /// ImfManager activated event arguments.
959         /// </summary>
960         public class ActivatedEventArgs : EventArgs
961         {
962             public ImfManager ImfManager
963             {
964                 get;
965                 set;
966             }
967         }
968
969         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
970         private delegate void ActivatedEventCallbackType(IntPtr data);
971         private ActivatedEventCallbackType _activatedEventCallback;
972         private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
973
974         /// <summary>
975         /// ImfManager activated.
976         /// </summary>
977         public event EventHandler<ActivatedEventArgs> Activated
978         {
979             add
980             {
981                 if (_activatedEventHandler == null)
982                 {
983                     _activatedEventCallback = OnActivated;
984                     ActivatedSignal().Connect(_activatedEventCallback);
985                 }
986
987                 _activatedEventHandler += value;
988             }
989             remove
990             {
991                 _activatedEventHandler -= value;
992
993                 if (_activatedEventHandler == null && _activatedEventCallback != null)
994                 {
995                     ActivatedSignal().Disconnect(_activatedEventCallback);
996                 }
997             }
998         }
999
1000         private void OnActivated(IntPtr data)
1001         {
1002             ActivatedEventArgs e = new ActivatedEventArgs();
1003
1004             e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1005
1006             if (_activatedEventHandler != null)
1007             {
1008                 _activatedEventHandler(this, e);
1009             }
1010         }
1011
1012         /// <summary>
1013         /// ImfManager activated signal.
1014         /// </summary>
1015         [Obsolete("Please do not use! this will be internal")]
1016         public ActivatedSignalType ActivatedSignal()
1017         {
1018             ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
1019             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020             return ret;
1021         }
1022
1023         /// <summary>
1024         /// ImfManager event received event arguments.
1025         /// </summary>
1026         [Obsolete("Please do not use! this will be deprecated")]
1027         public class ImfManagerEventReceivedEventArgs : EventArgs
1028         {
1029             public ImfManager ImfManager
1030             {
1031                 get;
1032                 set;
1033             }
1034         }
1035
1036         private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
1037         private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
1038         private event EventHandler<ImfManagerEventReceivedEventArgs> _imfManagerEventReceivedEventHandler;
1039
1040         /// <summary>
1041         /// ImfManager event received.
1042         /// </summary>
1043         [Obsolete("Please do not use! this will be deprecated")]
1044         public event EventHandler<ImfManagerEventReceivedEventArgs> ImfManagerEventReceived
1045         {
1046             add
1047             {
1048                 if (_imfManagerEventReceivedEventHandler == null)
1049                 {
1050                     _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
1051                     EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
1052                 }
1053
1054                 _imfManagerEventReceivedEventHandler += value;
1055             }
1056             remove
1057             {
1058                 _imfManagerEventReceivedEventHandler -= value;
1059
1060                 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
1061                 {
1062                     EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
1063                 }
1064             }
1065         }
1066
1067         private void OnImfManagerEventReceived(global::System.IntPtr data)
1068         {
1069             ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
1070
1071             e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1072
1073             if (_imfManagerEventReceivedEventHandler != null)
1074             {
1075                 _imfManagerEventReceivedEventHandler(this, e);
1076             }
1077         }
1078
1079         /// <summary>
1080         /// ImfManager event received event arguments.
1081         /// </summary>
1082         public class EventReceivedEventArgs : EventArgs
1083         {
1084             public ImfManager ImfManager
1085             {
1086                 get;
1087                 set;
1088             }
1089
1090             public ImfEventData ImfEventData
1091             {
1092                 get;
1093                 set;
1094             }
1095         }
1096
1097         private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
1098         private EventReceivedEventCallbackType _eventReceivedEventCallback;
1099         private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
1100
1101         /// <summary>
1102         /// ImfManager event received.
1103         /// </summary>
1104         public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
1105         {
1106             add
1107             {
1108                 if (_eventReceivedEventHandler == null)
1109                 {
1110                     _eventReceivedEventCallback = OnEventReceived;
1111                     EventReceivedSignal().Connect(_eventReceivedEventCallback);
1112                 }
1113
1114                 _eventReceivedEventHandler += value;
1115             }
1116             remove
1117             {
1118                 _eventReceivedEventHandler -= value;
1119
1120                 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
1121                 {
1122                     EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
1123                 }
1124             }
1125         }
1126
1127         private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
1128         {
1129             ImfCallbackData imfCallbackData = null;
1130
1131             EventReceivedEventArgs e = new EventReceivedEventArgs();
1132
1133             e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager);
1134             e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
1135
1136             if (_eventReceivedEventHandler != null)
1137             {
1138                 imfCallbackData = _eventReceivedEventHandler(this, e);
1139             }
1140             if (imfCallbackData != null)
1141             {
1142                 return imfCallbackData.GetImfCallbackDataPtr();
1143             }
1144             else
1145             {
1146                 return new ImfCallbackData().GetImfCallbackDataPtr();
1147             }
1148         }
1149
1150         /// <summary>
1151         /// ImfManager event received signal.
1152         /// </summary>
1153         [Obsolete("Please do not use! this will be internal")]
1154         public ImfEventSignalType EventReceivedSignal()
1155         {
1156             ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
1157             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1158             return ret;
1159         }
1160
1161         /// <summary>
1162         /// ImfManager status changed event arguments.
1163         /// </summary>
1164         [Obsolete("Please do not use! this will be deprecated")]
1165         public class ImfManagerStatusChangedEventArgs : EventArgs
1166         {
1167             public ImfManager ImfManager
1168             {
1169                 get;
1170                 set;
1171             }
1172         }
1173
1174         private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data);
1175         private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
1176         private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
1177
1178         /// <summary>
1179         /// ImfManager status changed.
1180         /// </summary>
1181         [Obsolete("Please do not use! this will be deprecated")]
1182         public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
1183         {
1184             add
1185             {
1186                 if (_imfManagerStatusChangedEventHandler == null)
1187                 {
1188                     _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
1189                     StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
1190                 }
1191
1192                 _imfManagerStatusChangedEventHandler += value;
1193             }
1194             remove
1195             {
1196                 _imfManagerStatusChangedEventHandler -= value;
1197
1198                 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
1199                 {
1200                     StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
1201                 }
1202             }
1203         }
1204
1205         private void OnImfManagerStatusChanged(global::System.IntPtr data)
1206         {
1207             ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
1208
1209             e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1210
1211             if (_imfManagerStatusChangedEventHandler != null)
1212             {
1213                 _imfManagerStatusChangedEventHandler(this, e);
1214             }
1215         }
1216
1217         /// <summary>
1218         /// ImfManager status changed event arguments.
1219         /// </summary>
1220         public class StatusChangedEventArgs : EventArgs
1221         {
1222             public bool StatusChanged
1223             {
1224                 get;
1225                 set;
1226             }
1227         }
1228
1229         private delegate void StatusChangedEventCallbackType(bool statusChanged);
1230         private StatusChangedEventCallbackType _statusChangedEventCallback;
1231         private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1232
1233         /// <summary>
1234         /// ImfManager status changed.
1235         /// </summary>
1236         public event EventHandler<StatusChangedEventArgs> StatusChanged
1237         {
1238             add
1239             {
1240                 if (_statusChangedEventHandler == null)
1241                 {
1242                     _statusChangedEventCallback = OnStatusChanged;
1243                     StatusChangedSignal().Connect(_statusChangedEventCallback);
1244                 }
1245
1246                 _statusChangedEventHandler += value;
1247             }
1248             remove
1249             {
1250                 _statusChangedEventHandler -= value;
1251
1252                 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1253                 {
1254                     StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1255                 }
1256             }
1257         }
1258
1259         private void OnStatusChanged(bool statusChanged)
1260         {
1261             StatusChangedEventArgs e = new StatusChangedEventArgs();
1262
1263             e.StatusChanged = statusChanged;
1264
1265             if (_statusChangedEventHandler != null)
1266             {
1267                 _statusChangedEventHandler(this, e);
1268             }
1269         }
1270
1271         /// <summary>
1272         /// ImfManager status changed signal.
1273         /// </summary>
1274         [Obsolete("Please do not use! this will be internal")]
1275         public StatusSignalType StatusChangedSignal()
1276         {
1277             StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
1278             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1279             return ret;
1280         }
1281
1282         /// <summary>
1283         /// ImfManager resized event arguments.
1284         /// </summary>
1285         [Obsolete("Please do not use! this will be deprecated")]
1286         public class ImfManagerResizedEventArgs : EventArgs
1287         {
1288             public ImfManager ImfManager
1289             {
1290                 get;
1291                 set;
1292             }
1293         }
1294
1295         private delegate void ImfManagerResizedEventCallbackType(IntPtr data);
1296         private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
1297         private event EventHandler<ImfManagerResizedEventArgs> _imfManagerResizedEventHandler;
1298
1299         /// <summary>
1300         /// ImfManager resized event.
1301         /// </summary>
1302         [Obsolete("Please do not use! this will be deprecated")]
1303         public event EventHandler<ImfManagerResizedEventArgs> ImfManagerResized
1304         {
1305             add
1306             {
1307                 if (_imfManagerResizedEventHandler == null)
1308                 {
1309                     _imfManagerResizedEventCallback = OnImfManagerResized;
1310                     ResizedSignal().Connect(_imfManagerResizedEventCallback);
1311                 }
1312
1313                 _imfManagerResizedEventHandler += value;
1314             }
1315             remove
1316             {
1317                 _imfManagerResizedEventHandler -= value;
1318
1319                 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
1320                 {
1321                     ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
1322                 }
1323             }
1324         }
1325
1326         private void OnImfManagerResized(IntPtr data)
1327         {
1328             ImfManagerResizedEventArgs e = new ImfManagerResizedEventArgs();
1329
1330             e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1331
1332             if (_imfManagerResizedEventHandler != null)
1333             {
1334                 _imfManagerResizedEventHandler(this, e);
1335             }
1336         }
1337
1338         private delegate void ResizedEventCallbackType();
1339         private ResizedEventCallbackType _resizedEventCallback;
1340         private event EventHandler _resizedEventHandler;
1341
1342         /// <summary>
1343         /// ImfManager resized.
1344         /// </summary>
1345         public event EventHandler Resized
1346         {
1347             add
1348             {
1349                 if (_resizedEventHandler == null)
1350                 {
1351                     _resizedEventCallback = OnResized;
1352                     ResizedSignal().Connect(_resizedEventCallback);
1353                 }
1354
1355                 _resizedEventHandler += value;
1356             }
1357             remove
1358             {
1359                 _resizedEventHandler -= value;
1360
1361                 if (_resizedEventHandler == null && _resizedEventCallback != null)
1362                 {
1363                     ResizedSignal().Disconnect(_resizedEventCallback);
1364                 }
1365             }
1366         }
1367
1368         private void OnResized()
1369         {
1370             if (_resizedEventHandler != null)
1371             {
1372                 _resizedEventHandler(this, null);
1373             }
1374         }
1375
1376         /// <summary>
1377         /// ImfManager resized signal.
1378         /// </summary>
1379         [Obsolete("Please do not use! this will be internal")]
1380         public ImfVoidSignalType ResizedSignal()
1381         {
1382             ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), true);
1383             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1384             return ret;
1385         }
1386
1387         /// <summary>
1388         /// ImfManager language changed event arguments.
1389         /// </summary>
1390         [Obsolete("Please do not use! this will be deprecated")]
1391         public class ImfManagerLanguageChangedEventArgs : EventArgs
1392         {
1393             public ImfManager ImfManager
1394             {
1395                 get;
1396                 set;
1397             }
1398         }
1399
1400         private delegate void ImfManagerLanguageChangedEventCallbackType(IntPtr data);
1401         private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
1402         private event EventHandler<ImfManagerLanguageChangedEventArgs> _imfManagerLanguageChangedEventHandler;
1403
1404         /// <summary>
1405         /// ImfManager language changed event.
1406         /// </summary>
1407         [Obsolete("Please do not use! this will be deprecated")]
1408         public event EventHandler<ImfManagerLanguageChangedEventArgs> ImfManagerLanguageChanged
1409         {
1410             add
1411             {
1412                 if (_imfManagerLanguageChangedEventHandler == null)
1413                 {
1414                     _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
1415                     LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
1416                 }
1417
1418                 _imfManagerLanguageChangedEventHandler += value;
1419             }
1420             remove
1421             {
1422                 _imfManagerLanguageChangedEventHandler -= value;
1423
1424                 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
1425                 {
1426                     LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
1427                 }
1428             }
1429         }
1430
1431         private void OnImfManagerLanguageChanged(IntPtr data)
1432         {
1433             ImfManagerLanguageChangedEventArgs e = new ImfManagerLanguageChangedEventArgs();
1434
1435             e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1436
1437             if (_imfManagerLanguageChangedEventHandler != null)
1438             {
1439                 _imfManagerLanguageChangedEventHandler(this, e);
1440             }
1441         }
1442
1443         private delegate void LanguageChangedEventCallbackType();
1444         private LanguageChangedEventCallbackType _languageChangedEventCallback;
1445         private event EventHandler _languageChangedEventHandler;
1446
1447         /// <summary>
1448         /// ImfManager language changed.
1449         /// </summary>
1450         public event EventHandler LanguageChanged
1451         {
1452             add
1453             {
1454                 if (_languageChangedEventHandler == null)
1455                 {
1456                     _languageChangedEventCallback = OnLanguageChanged;
1457                     LanguageChangedSignal().Connect(_languageChangedEventCallback);
1458                 }
1459
1460                 _languageChangedEventHandler += value;
1461             }
1462             remove
1463             {
1464                 _languageChangedEventHandler -= value;
1465
1466                 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1467                 {
1468                     LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1469                 }
1470             }
1471         }
1472
1473         private void OnLanguageChanged()
1474         {
1475             if (_languageChangedEventHandler != null)
1476             {
1477                 _languageChangedEventHandler(this, null);
1478             }
1479         }
1480
1481         /// <summary>
1482         /// ImfManager language changed signal.
1483         /// </summary>
1484         [Obsolete("Please do not use! this will be internal")]
1485         public ImfVoidSignalType LanguageChangedSignal()
1486         {
1487             ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), true);
1488             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1489             return ret;
1490         }
1491
1492         /// <summary>
1493         /// ImfManager keyboard type changed event arguments.
1494         /// </summary>
1495         public class KeyboardTypeChangedEventArgs : EventArgs
1496         {
1497             public KeyboardType KeyboardType
1498             {
1499                 get;
1500                 set;
1501             }
1502         }
1503
1504         private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1505         private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1506         private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1507
1508         /// <summary>
1509         /// ImfManager keyboard type changed.
1510         /// </summary>
1511         public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1512         {
1513             add
1514             {
1515                 if (_keyboardTypeChangedEventHandler == null)
1516                 {
1517                     _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1518                     KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1519                 }
1520
1521                 _keyboardTypeChangedEventHandler += value;
1522             }
1523             remove
1524             {
1525                 _keyboardTypeChangedEventHandler -= value;
1526
1527                 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1528                 {
1529                     KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1530                 }
1531             }
1532         }
1533
1534         private void OnKeyboardTypeChanged(KeyboardType type)
1535         {
1536             KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1537
1538             e.KeyboardType = type;
1539
1540             if (_keyboardTypeChangedEventHandler != null)
1541             {
1542                 _keyboardTypeChangedEventHandler(this, e);
1543             }
1544         }
1545
1546         internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1547         {
1548             KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1549             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1550             return ret;
1551         }
1552
1553         /// <summary>
1554         /// The direction of text.
1555         /// </summary>
1556         public enum TextDirection
1557         {
1558             /// <summary>
1559             /// Left to right.
1560             /// </summary>
1561             LeftToRight,
1562             /// <summary>
1563             /// Right to left.
1564             /// </summary>
1565             RightToLeft
1566         }
1567
1568         /// <summary>
1569         /// Events that are generated by the IMF.
1570         /// </summary>
1571         public enum ImfEvent
1572         {
1573             /// <summary>
1574             /// No event.
1575             /// </summary>
1576             Void,
1577             /// <summary>
1578             /// Pre-Edit changed.
1579             /// </summary>
1580             Preedit,
1581             /// <summary>
1582             /// Commit recieved.
1583             /// </summary>
1584             Commit,
1585             /// <summary>
1586             /// Event to delete a range of characters from the string.
1587             /// </summary>
1588             DeleteSurrounding,
1589             /// <summary>
1590             /// Event to query string and cursor position.
1591             /// </summary>
1592             GetSurrounding,
1593             /// <summary>
1594             /// Private command sent from the input panel.
1595             /// </summary>
1596             PrivateCommand
1597         }
1598
1599         /// <summary>
1600         /// Enumeration for state of the input panel.
1601         /// </summary>
1602         public enum State
1603         {
1604             /// <summary>
1605             /// Unknown state.
1606             /// </summary>
1607             Default = 0,
1608             /// <summary>
1609             /// Input panel is shown.
1610             /// </summary>
1611             Show,
1612             /// <summary>
1613             /// Input panel is hidden.
1614             /// </summary>
1615             Hide,
1616             /// <summary>
1617             /// Input panel in process of being shown.
1618             /// </summary>
1619             WillShow
1620         }
1621
1622         /// <summary>
1623         /// Enumeration for the type of Keyboard.
1624         /// </summary>
1625         public enum KeyboardType
1626         {
1627             /// <summary>
1628             /// Software keyboard (Virtual keyboard) is default.
1629             /// </summary>
1630             SoftwareKeyboard,
1631             /// <summary>
1632             /// Hardware keyboard.
1633             /// </summary>
1634             HardwareKeyboard
1635         }
1636     }
1637 }