[NUI] sync with dalihub (#651)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / ImfManager.cs
1 /*
2  * Copyright(c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.Runtime.InteropServices;
20 using System.ComponentModel;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// Specifically manages the input method framework which enables the virtual or hardware keyboards.
26     /// </summary>
27     /// <since_tizen> 3 </since_tizen>
28     [Obsolete("Please do not use! This will be deprecated! Please use InputMethodContext instead!")]
29     [EditorBrowsable(EditorBrowsableState.Never)]
30     public class ImfManager : BaseHandle
31     {
32         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
33
34         internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn)
35         {
36             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37         }
38
39         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj)
40         {
41             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
42         }
43
44         /// <summary>
45         /// Gets the singleton of the ImfManager object.
46         /// </summary>
47         /// <since_tizen> 5 </since_tizen>
48         public static ImfManager Instance
49         {
50             get
51             {
52                 return new ImfManager();
53             }
54         }
55
56         /// <summary>
57         /// Dispose.
58         /// </summary>
59         /// <param name="type">Dispose Type</param>
60         /// <since_tizen> 3 </since_tizen>
61         /// Please DO NOT use! This will be deprecated!
62         /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, ImfManager, TtsPlayer, Window) is not required.
63         [EditorBrowsable(EditorBrowsableState.Never)]
64         protected override void Dispose(DisposeTypes type)
65         {
66             if (disposed)
67             {
68                 return;
69             }
70
71             if (type == DisposeTypes.Explicit)
72             {
73                 //Called by User
74                 //Release your own managed resources here.
75                 //You should release all of your own disposable objects here.
76
77             }
78
79             //Release your own unmanaged resources here.
80             //You should not access any managed member here except static instance.
81             //because the execution order of Finalizes is non-deterministic.
82
83             if (_keyboardTypeChangedEventCallback != null)
84             {
85                 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
86             }
87
88             if (swigCPtr.Handle != global::System.IntPtr.Zero)
89             {
90                 if (swigCMemOwn)
91                 {
92                     swigCMemOwn = false;
93                     NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr);
94                 }
95                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
96             }
97
98             base.Dispose(type);
99         }
100
101         /// <summary>
102         /// This structure is used to pass on data from the IMF regarding predictive text.
103         /// </summary>
104         /// <since_tizen> 3 </since_tizen>
105         public class ImfEventData : global::System.IDisposable
106         {
107             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
108             /// <summary>
109             /// swigCMemOwn
110             /// </summary>
111             /// <since_tizen> 3 </since_tizen>
112             protected bool swigCMemOwn;
113
114             internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
115             {
116                 swigCMemOwn = cMemoryOwn;
117                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
118             }
119
120             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
121             {
122                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
123             }
124
125             //A Flag to check who called Dispose(). (By User or DisposeQueue)
126             private bool isDisposeQueued = false;
127             /// <summary>
128             /// A Flat to check if it is already disposed.
129             /// </summary>
130             /// <since_tizen> 3 </since_tizen>
131             protected bool disposed = false;
132
133             /// <summary>
134             /// Dispose.
135             /// </summary>
136             /// <since_tizen> 3 </since_tizen>
137             ~ImfEventData()
138             {
139                 if (!isDisposeQueued)
140                 {
141                     isDisposeQueued = true;
142                     DisposeQueue.Instance.Add(this);
143                 }
144             }
145
146             /// <summary>
147             /// The dispose pattern.
148             /// </summary>
149             /// <since_tizen> 3 </since_tizen>
150             public void Dispose()
151             {
152                 //Throw excpetion if Dispose() is called in separate thread.
153                 if (!Window.IsInstalled())
154                 {
155                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
156                 }
157
158                 if (isDisposeQueued)
159                 {
160                     Dispose(DisposeTypes.Implicit);
161                 }
162                 else
163                 {
164                     Dispose(DisposeTypes.Explicit);
165                     System.GC.SuppressFinalize(this);
166                 }
167             }
168
169             /// <summary>
170             /// Dispose.
171             /// </summary>
172             /// <since_tizen> 3 </since_tizen>
173             protected virtual void Dispose(DisposeTypes type)
174             {
175                 if (disposed)
176                 {
177                     return;
178                 }
179
180                 if (type == DisposeTypes.Explicit)
181                 {
182                     //Called by User
183                     //Release your own managed resources here.
184                     //You should release all of your own disposable objects here.
185
186                 }
187
188                 //Release your own unmanaged resources here.
189                 //You should not access any managed member here except static instance.
190                 //because the execution order of Finalizes is non-deterministic.
191
192                 if (swigCPtr.Handle != IntPtr.Zero)
193                 {
194                     if (swigCMemOwn)
195                     {
196                         swigCMemOwn = false;
197                         NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr);
198                     }
199                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
200                 }
201
202                 disposed = true;
203             }
204
205             internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
206             {
207                 ImfEventData ret = new ImfEventData(cPtr, false);
208                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209                 return ret;
210             }
211
212             /// <summary>
213             /// The default constructor.
214             /// </summary>
215             /// <since_tizen> 3 </since_tizen>
216             public ImfEventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true)
217             {
218                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219             }
220
221             /// <summary>
222             /// The constructor.
223             /// </summary>
224             /// <param name="aEventName">The name of the event from the IMF.</param>
225             /// <param name="aPredictiveString">The pre-edit or the commit string.</param>
226             /// <param name="aCursorOffset">Start the position from the current cursor position to start deleting characters.</param>
227             /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
228             /// <since_tizen> 3 </since_tizen>
229             public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
230             {
231                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232             }
233
234             /// <summary>
235             /// The pre-edit or the commit string.
236             /// </summary>
237             /// <since_tizen> 4 </since_tizen>
238             public string PredictiveString
239             {
240                 set
241                 {
242                     NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_set(swigCPtr, value);
243                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244                 }
245                 get
246                 {
247                     string ret = NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_get(swigCPtr);
248                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249                     return ret;
250                 }
251             }
252
253             /// <summary>
254             /// The name of the event from the IMF.
255             /// </summary>
256             /// <since_tizen> 4 </since_tizen>
257             public ImfManager.ImfEvent EventName
258             {
259                 set
260                 {
261                     NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value);
262                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263                 }
264                 get
265                 {
266                     ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr);
267                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268                     return ret;
269                 }
270             }
271
272             /// <summary>
273             /// The start position from the current cursor position to start deleting characters.
274             /// </summary>
275             /// <since_tizen> 4 </since_tizen>
276             public int CursorOffset
277             {
278                 set
279                 {
280                     NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value);
281                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282                 }
283                 get
284                 {
285                     int ret = NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_get(swigCPtr);
286                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287                     return ret;
288                 }
289             }
290
291             /// <summary>
292             /// The number of characters to delete from the cursorOffset.
293             /// </summary>
294             /// <since_tizen> 4 </since_tizen>
295             public int NumberOfChars
296             {
297                 set
298                 {
299                     NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value);
300                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301                 }
302                 get
303                 {
304                     int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr);
305                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306                     return ret;
307                 }
308             }
309
310         }
311
312         /// <summary>
313         /// Data required by the IMF from the callback.
314         /// </summary>
315         /// <since_tizen> 3 </since_tizen>
316         public class ImfCallbackData : global::System.IDisposable
317         {
318             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
319             /// <summary>
320             /// swigCMemOwn
321             /// </summary>
322             /// <since_tizen> 3 </since_tizen>
323             protected bool swigCMemOwn;
324
325             internal IntPtr GetImfCallbackDataPtr()
326             {
327                 return (IntPtr)swigCPtr;
328             }
329
330             internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
331             {
332                 swigCMemOwn = cMemoryOwn;
333                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
334             }
335
336             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
337             {
338                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
339             }
340
341             //A Flag to check who called Dispose(). (By User or DisposeQueue)
342             private bool isDisposeQueued = false;
343             /// <summary>
344             /// A Flat to check if it is already disposed.
345             /// </summary>
346             /// <since_tizen> 3 </since_tizen>
347             protected bool disposed = false;
348
349
350             /// <summary>
351             /// Dispose.
352             /// </summary>
353             /// <since_tizen> 3 </since_tizen>
354             ~ImfCallbackData()
355             {
356                 if (!isDisposeQueued)
357                 {
358                     isDisposeQueued = true;
359                     DisposeQueue.Instance.Add(this);
360                 }
361             }
362
363             /// <summary>
364             /// The dispose pattern.
365             /// </summary>
366             /// <since_tizen> 3 </since_tizen>
367             public void Dispose()
368             {
369                 //Throw excpetion if Dispose() is called in separate thread.
370                 if (!Window.IsInstalled())
371                 {
372                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
373                 }
374
375                 if (isDisposeQueued)
376                 {
377                     Dispose(DisposeTypes.Implicit);
378                 }
379                 else
380                 {
381                     Dispose(DisposeTypes.Explicit);
382                     System.GC.SuppressFinalize(this);
383                 }
384             }
385
386             /// <summary>
387             /// Dispose.
388             /// </summary>
389             /// <since_tizen> 3 </since_tizen>
390             protected virtual void Dispose(DisposeTypes type)
391             {
392                 if (disposed)
393                 {
394                     return;
395                 }
396
397                 if (type == DisposeTypes.Explicit)
398                 {
399                     //Called by User
400                     //Release your own managed resources here.
401                     //You should release all of your own disposable objects here.
402
403                 }
404
405                 //Release your own unmanaged resources here.
406                 //You should not access any managed member here except static instance.
407                 //because the execution order of Finalizes is non-deterministic.
408
409                 if (swigCPtr.Handle != IntPtr.Zero)
410                 {
411                     if (swigCMemOwn)
412                     {
413                         swigCMemOwn = false;
414                         NDalicManualPINVOKE.delete_InputMethodContext_CallbackData(swigCPtr);
415                     }
416                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
417                 }
418
419                 disposed = true;
420             }
421
422             internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
423             {
424                 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
425                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426                 return ret;
427             }
428
429             /// <summary>
430             /// The default constructor.
431             /// </summary>
432             /// <since_tizen> 3 </since_tizen>
433             public ImfCallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true)
434             {
435                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436             }
437
438             /// <summary>
439             /// The constructor.
440             /// </summary>
441             /// <param name="aUpdate">True if the cursor position needs to be updated.</param>
442             /// <param name="aCursorPosition">The new position of the cursor.</param>
443             /// <param name="aCurrentText">The current text string.</param>
444             /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
445             /// <since_tizen> 3 </since_tizen>
446             public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
447             {
448                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
449             }
450
451             /// <summary>
452             /// The current text string.
453             /// </summary>
454             /// <since_tizen> 4 </since_tizen>
455             public string CurrentText
456             {
457                 set
458                 {
459                     NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value);
460                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
461                 }
462                 get
463                 {
464                     string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr);
465                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466                     return ret;
467                 }
468             }
469
470             /// <summary>
471             /// The current text string.
472             /// </summary>
473             /// <since_tizen> 4 </since_tizen>
474             public int CursorPosition
475             {
476                 set
477                 {
478                     NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value);
479                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480                 }
481                 get
482                 {
483                     int ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr);
484                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485                     return ret;
486                 }
487             }
488
489             /// <summary>
490             /// If the cursor position needs to be updated.
491             /// </summary>
492             /// <since_tizen> 4 </since_tizen>
493             public bool Update
494             {
495                 set
496                 {
497                     NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value);
498                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499                 }
500                 get
501                 {
502                     bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr);
503                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504                     return ret;
505                 }
506             }
507
508             /// <summary>
509             /// Flags if preedit reset is required.
510             /// </summary>
511             /// <since_tizen> 4 </since_tizen>
512             public bool PreeditResetRequired
513             {
514                 set
515                 {
516                     NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value);
517                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518                 }
519                 get
520                 {
521                     bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr);
522                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523                     return ret;
524                 }
525             }
526
527         }
528
529         /// <summary>
530         /// Destroys the context of the IMF.<br/>
531         /// </summary>
532         /// <since_tizen> 5 </since_tizen>
533         public void DestroyContext()
534         {
535             NDalicManualPINVOKE.InputMethodContext_Finalize(swigCPtr);
536             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
537         }
538
539         /// <summary>
540         /// Destroy the context of the IMF.<br/>
541         /// </summary>
542         /// <since_tizen> 4 </since_tizen>
543         /// Please do not use! This will be deprecated, instead please USE Tizen.NUI.ImfManager.Instance.DestroyContext()!
544          #pragma warning disable 0465
545         [Obsolete("Please do not use! This will be deprecated! Please use ImfManager.Instance.DestroyContext() instead!")]
546         [EditorBrowsable(EditorBrowsableState.Never)]
547         public void Finalize()
548         {
549             DestroyContext();
550         }
551         #pragma warning restore 0465
552
553         /// <summary>
554         /// Retrieves a handle to the instance of the ImfManager.
555         /// </summary>
556         /// <returns>A handle to the ImfManager.</returns>
557         /// <since_tizen> 3 </since_tizen>
558         public static ImfManager Get()
559         {
560             return new ImfManager();
561         }
562
563         /// <summary>
564         /// Constructor.<br/>
565         /// </summary>
566         /// <since_tizen> 5 </since_tizen>
567         public ImfManager () : this (NDalicManualPINVOKE.InputMethodContext_New(), true) {
568             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569
570         }
571
572         internal ImfManager(ImfManager imfManager) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(ImfManager.getCPtr(imfManager)), true) {
573             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574         }
575
576         internal ImfManager Assign(ImfManager imfManager) {
577             ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, ImfManager.getCPtr(imfManager)), false);
578             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579             return ret;
580         }
581
582         internal static ImfManager DownCast(BaseHandle handle) {
583             ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true);
584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585             return ret;
586         }
587
588         /// <summary>
589         /// Activates the IMF.<br/>
590         /// It means that the text editing is started somewhere.<br/>
591         /// If the hardware keyboard isn't connected, then it will show the virtual keyboard.
592         /// </summary>
593         /// <since_tizen> 3 </since_tizen>
594         public void Activate()
595         {
596             NDalicManualPINVOKE.InputMethodContext_Activate(swigCPtr);
597             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598         }
599
600         /// <summary>
601         /// Deactivates the IMF.<br/>
602         /// It means that the text editing is finished somewhere.
603         /// </summary>
604         /// <since_tizen> 3 </since_tizen>
605         public void Deactivate()
606         {
607             NDalicManualPINVOKE.InputMethodContext_Deactivate(swigCPtr);
608             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609         }
610
611         /// <summary>
612         /// Gets the restoration status which controls if the keyboard is restored after the focus is lost and then regained.<br/>
613         /// If true, then the keyboard will be restored (activated) after focus is regained.
614         /// </summary>
615         /// <returns>The restoration status.</returns>
616         /// <since_tizen> 3 </since_tizen>
617         public bool RestoreAfterFocusLost()
618         {
619             bool ret = NDalicManualPINVOKE.InputMethodContext_RestoreAfterFocusLost(swigCPtr);
620             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621             return ret;
622         }
623
624         /// <summary>
625         /// Sets the status whether the IMF has to restore the keyboard after losing focus.
626         /// </summary>
627         /// <param name="toggle">True means that keyboard should be restored after the focus is lost and regained.</param>
628         /// <since_tizen> 3 </since_tizen>
629         public void SetRestoreAfterFocusLost(bool toggle)
630         {
631             NDalicManualPINVOKE.InputMethodContext_SetRestoreAfterFocusLost(swigCPtr, toggle);
632             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633         }
634
635         /// <summary>
636         /// Sends a message reset to the preedit state or the IMF module.
637         /// </summary>
638         /// <since_tizen> 3 </since_tizen>
639         public new void Reset()
640         {
641             NDalicManualPINVOKE.InputMethodContext_Reset(swigCPtr);
642             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643         }
644
645         /// <summary>
646         /// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization.
647         /// </summary>
648         /// <since_tizen> 3 </since_tizen>
649         public void NotifyCursorPosition()
650         {
651             NDalicManualPINVOKE.InputMethodContext_NotifyCursorPosition(swigCPtr);
652             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653         }
654
655         /// <summary>
656         /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
657         /// </summary>
658         /// <param name="cursorPosition">The position of the cursor.</param>
659         /// <since_tizen> 3 </since_tizen>
660         public void SetCursorPosition(uint cursorPosition)
661         {
662             NDalicManualPINVOKE.InputMethodContext_SetCursorPosition(swigCPtr, cursorPosition);
663             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
664         }
665
666         /// <summary>
667         /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
668         /// </summary>
669         /// <returns>The current position of the cursor.</returns>
670         /// <since_tizen> 3 </since_tizen>
671         public uint GetCursorPosition()
672         {
673             uint ret = NDalicManualPINVOKE.InputMethodContext_GetCursorPosition(swigCPtr);
674             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
675             return ret;
676         }
677
678         /// <summary>
679         /// A method to store the string required by the IMF, this is used to provide predictive word suggestions.
680         /// </summary>
681         /// <param name="text">The text string surrounding the current cursor point.</param>
682         /// <since_tizen> 3 </since_tizen>
683         public void SetSurroundingText(string text)
684         {
685             NDalicManualPINVOKE.InputMethodContext_SetSurroundingText(swigCPtr, text);
686             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
687         }
688
689         /// <summary>
690         /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.
691         /// </summary>
692         /// <returns>The surrounding text.</returns>
693         /// <since_tizen> 3 </since_tizen>
694         public string GetSurroundingText()
695         {
696             string ret = NDalicManualPINVOKE.InputMethodContext_GetSurroundingText(swigCPtr);
697             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698             return ret;
699         }
700
701         /// <summary>
702         /// Notifies the IMF context that text input is set to multiline or not.
703         /// </summary>
704         /// <param name="multiLine">True if multiline text input is used.</param>
705         /// <since_tizen> 3 </since_tizen>
706         public void NotifyTextInputMultiLine(bool multiLine)
707         {
708             NDalicManualPINVOKE.InputMethodContext_NotifyTextInputMultiLine(swigCPtr, multiLine);
709             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710         }
711
712         /// <summary>
713         /// Returns the text direction of the keyboard's current input language.
714         /// </summary>
715         /// <returns>The direction of the text.</returns>
716         /// <since_tizen> 3 </since_tizen>
717         public ImfManager.TextDirection GetTextDirection()
718         {
719             ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.InputMethodContext_GetTextDirection(swigCPtr);
720             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
721             return ret;
722         }
723
724         /// <summary>
725         /// Provides the size and the position of the keyboard.<br/>
726         /// The position is relative to whether the keyboard is visible or not.<br/>
727         /// If the keyboard is not visible, then the position will be off the screen.<br/>
728         /// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/>
729         /// the values then taken down. So ideally, GetInputMethodArea() should be called after Show().
730         /// </summary>
731         /// <returns>Rectangle which is keyboard panel x, y, width, height.</returns>
732         /// <since_tizen> 3 </since_tizen>
733         public Rectangle GetInputMethodArea()
734         {
735             Rectangle ret = new Rectangle(NDalicManualPINVOKE.InputMethodContext_GetInputMethodArea(swigCPtr), true);
736             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
737             return ret;
738         }
739
740         internal void ApplyOptions(InputMethodOptions options)
741         {
742             NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
743             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
744         }
745
746         /// <summary>
747         /// Sets up the input-panel specific data.
748         /// </summary>
749         /// <param name="text">The specific data to be set to the input panel.</param>
750         /// <since_tizen> 3 </since_tizen>
751         public void SetInputPanelUserData(string text)
752         {
753             NDalicManualPINVOKE.InputMethodContext_SetInputPanelUserData(swigCPtr, text);
754             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755         }
756
757         /// <summary>
758         /// Gets the specific data of the current active input panel.
759         /// </summary>
760         /// <param name="text">The specific data to be received from the input panel.</param>
761         /// <since_tizen> 4 </since_tizen>
762         public void GetInputPanelUserData(out string text)
763         {
764             NDalicManualPINVOKE.InputMethodContext_GetInputPanelUserData(swigCPtr, out text);
765             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
766         }
767
768         /// <summary>
769         /// Gets the state of the current active input panel.
770         /// </summary>
771         /// <returns>The state of the input panel.</returns>
772         /// <since_tizen> 3 </since_tizen>
773         public ImfManager.State GetInputPanelState()
774         {
775             ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.InputMethodContext_GetInputPanelState(swigCPtr);
776             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
777             return ret;
778         }
779
780         /// <summary>
781         /// Sets the return key on the input panel to be visible or invisible.<br/>
782         /// The default is true.
783         /// </summary>
784         /// <param name="visible">True if the return key is visible (enabled), false otherwise.</param>
785         /// <since_tizen> 3 </since_tizen>
786         public void SetReturnKeyState(bool visible)
787         {
788             NDalicManualPINVOKE.InputMethodContext_SetReturnKeyState(swigCPtr, visible);
789             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
790         }
791
792         /// <summary>
793         /// Enables to show the input panel automatically when focused.
794         /// </summary>
795         /// <param name="enabled">If true, the input panel will be shown when focused.</param>
796         /// <since_tizen> 3 </since_tizen>
797         public void AutoEnableInputPanel(bool enabled)
798         {
799             NDalicManualPINVOKE.InputMethodContext_AutoEnableInputPanel(swigCPtr, enabled);
800             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801         }
802
803         /// <summary>
804         /// Shows the input panel.
805         /// </summary>
806         /// <since_tizen> 3 </since_tizen>
807         public void ShowInputPanel()
808         {
809             NDalicManualPINVOKE.InputMethodContext_ShowInputPanel(swigCPtr);
810             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
811         }
812
813         /// <summary>
814         /// Hides the input panel.
815         /// </summary>
816         /// <since_tizen> 3 </since_tizen>
817         public void HideInputPanel()
818         {
819             NDalicManualPINVOKE.InputMethodContext_HideInputPanel(swigCPtr);
820             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
821         }
822
823         /// <summary>
824         /// Gets the keyboard type.<br/>
825         /// The default keyboard type is SoftwareKeyboard.
826         /// </summary>
827         /// <returns>The keyboard type.</returns>
828         /// <since_tizen> 4 </since_tizen>
829         public ImfManager.KeyboardType GetKeyboardType()
830         {
831             ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.InputMethodContext_GetKeyboardType(swigCPtr);
832             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833             return ret;
834         }
835
836         /// <summary>
837         /// Gets the current language locale of the input panel.<br/>
838         /// For example, en_US, en_GB, en_PH, fr_FR, ...
839         /// </summary>
840         /// <returns>The current language locale of the input panel.</returns>
841         /// <since_tizen> 4 </since_tizen>
842         public string GetInputPanelLocale()
843         {
844             string ret = NDalicManualPINVOKE.InputMethodContext_GetInputPanelLocale(swigCPtr);
845             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846             return ret;
847         }
848
849         /// <summary>
850         /// ImfManager activated event arguments.
851         /// </summary>
852         /// <since_tizen> 4 </since_tizen>
853         public class ActivatedEventArgs : EventArgs
854         {
855             /// <summary>
856             /// ImfManager
857             /// </summary>
858             /// <since_tizen> 4 </since_tizen>
859             public ImfManager ImfManager
860             {
861                 get;
862                 set;
863             }
864         }
865
866         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
867         private delegate void ActivatedEventCallbackType(IntPtr data);
868         private ActivatedEventCallbackType _activatedEventCallback;
869         private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
870
871         /// <summary>
872         /// ImfManager activated.
873         /// </summary>
874         /// <since_tizen> 4 </since_tizen>
875         public event EventHandler<ActivatedEventArgs> Activated
876         {
877             add
878             {
879                 if (_activatedEventHandler == null)
880                 {
881                     _activatedEventCallback = OnActivated;
882                     ActivatedSignal().Connect(_activatedEventCallback);
883                 }
884
885                 _activatedEventHandler += value;
886             }
887             remove
888             {
889                 _activatedEventHandler -= value;
890
891                 if (_activatedEventHandler == null && _activatedEventCallback != null)
892                 {
893                     ActivatedSignal().Disconnect(_activatedEventCallback);
894                 }
895             }
896         }
897
898         private void OnActivated(IntPtr data)
899         {
900             ActivatedEventArgs e = new ActivatedEventArgs();
901
902             if (data != null)
903             {
904                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
905             }
906
907             if (_activatedEventHandler != null)
908             {
909                 _activatedEventHandler(this, e);
910             }
911         }
912
913         internal ActivatedSignalType ActivatedSignal()
914         {
915             ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false);
916             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
917             return ret;
918         }
919
920         /// <summary>
921         /// ImfManager event received event arguments.
922         /// </summary>
923         /// <since_tizen> 4 </since_tizen>
924         public class EventReceivedEventArgs : EventArgs
925         {
926             /// <summary>
927             /// ImfManager
928             /// </summary>
929             /// <since_tizen> 4 </since_tizen>
930             public ImfManager ImfManager
931             {
932                 get;
933                 set;
934             }
935
936             /// <summary>
937             /// ImfEventData
938             /// </summary>
939             /// <since_tizen> 4 </since_tizen>
940             public ImfEventData ImfEventData
941             {
942                 get;
943                 set;
944             }
945         }
946
947         private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
948         private EventReceivedEventCallbackType _eventReceivedEventCallback;
949         private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
950
951         /// <summary>
952         /// ImfManager event received.
953         /// </summary>
954         /// <since_tizen> 4 </since_tizen>
955         public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
956         {
957             add
958             {
959                 if (_eventReceivedEventHandler == null)
960                 {
961                     _eventReceivedEventCallback = OnEventReceived;
962                     EventReceivedSignal().Connect(_eventReceivedEventCallback);
963                 }
964
965                 _eventReceivedEventHandler += value;
966             }
967             remove
968             {
969                 _eventReceivedEventHandler -= value;
970
971                 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
972                 {
973                     EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
974                 }
975             }
976         }
977
978         private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
979         {
980             ImfCallbackData imfCallbackData = null;
981
982             EventReceivedEventArgs e = new EventReceivedEventArgs();
983
984             if (imfManager != null)
985             {
986                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
987             }
988             if (imfEventData != null)
989             {
990                 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
991             }
992
993             if (_eventReceivedEventHandler != null)
994             {
995                 imfCallbackData = _eventReceivedEventHandler(this, e);
996             }
997             if (imfCallbackData != null)
998             {
999                 return imfCallbackData.GetImfCallbackDataPtr();
1000             }
1001             else
1002             {
1003                 return new ImfCallbackData().GetImfCallbackDataPtr();
1004             }
1005         }
1006
1007         internal KeyboardEventSignalType EventReceivedSignal()
1008         {
1009             KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false);
1010             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1011             return ret;
1012         }
1013
1014         /// <summary>
1015         /// ImfManager status changed event arguments.
1016         /// </summary>
1017         /// <since_tizen> 4 </since_tizen>
1018         public class StatusChangedEventArgs : EventArgs
1019         {
1020             /// <summary>
1021             /// ImfManager status
1022             /// </summary>
1023             /// <since_tizen> 4 </since_tizen>
1024             public bool StatusChanged
1025             {
1026                 get;
1027                 set;
1028             }
1029         }
1030
1031         private delegate void StatusChangedEventCallbackType(bool statusChanged);
1032         private StatusChangedEventCallbackType _statusChangedEventCallback;
1033         private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1034
1035         /// <summary>
1036         /// ImfManager status changed.
1037         /// </summary>
1038         /// <since_tizen> 4 </since_tizen>
1039         public event EventHandler<StatusChangedEventArgs> StatusChanged
1040         {
1041             add
1042             {
1043                 if (_statusChangedEventHandler == null)
1044                 {
1045                     _statusChangedEventCallback = OnStatusChanged;
1046                     StatusChangedSignal().Connect(_statusChangedEventCallback);
1047                 }
1048
1049                 _statusChangedEventHandler += value;
1050             }
1051             remove
1052             {
1053                 _statusChangedEventHandler -= value;
1054
1055                 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1056                 {
1057                     StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1058                 }
1059             }
1060         }
1061
1062         private void OnStatusChanged(bool statusChanged)
1063         {
1064             StatusChangedEventArgs e = new StatusChangedEventArgs();
1065
1066             e.StatusChanged = statusChanged;
1067
1068             if (_statusChangedEventHandler != null)
1069             {
1070                 _statusChangedEventHandler(this, e);
1071             }
1072         }
1073
1074         internal StatusSignalType StatusChangedSignal()
1075         {
1076             StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false);
1077             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1078             return ret;
1079         }
1080
1081         /// <summary>
1082         /// ImfManager resized event.
1083         /// </summary>
1084         /// <since_tizen> 4 </since_tizen>
1085         public class ResizedEventArgs : EventArgs
1086         {
1087             /// <summary>
1088             /// resized.
1089             /// </summary>
1090             /// <since_tizen> 4 </since_tizen>
1091             public int Resized
1092             {
1093                 get;
1094                 set;
1095             }
1096         }
1097
1098         private delegate void ResizedEventCallbackType(int resized);
1099         private ResizedEventCallbackType _resizedEventCallback;
1100         private event EventHandler<ResizedEventArgs> _resizedEventHandler;
1101
1102         /// <summary>
1103         /// ImfManager resized.
1104         /// </summary>
1105         /// <since_tizen> 4 </since_tizen>
1106         public event EventHandler<ResizedEventArgs> Resized
1107         {
1108             add
1109             {
1110                 if (_resizedEventHandler == null)
1111                 {
1112                     _resizedEventCallback = OnResized;
1113                     ResizedSignal().Connect(_resizedEventCallback);
1114                 }
1115
1116                 _resizedEventHandler += value;
1117             }
1118             remove
1119             {
1120                 _resizedEventHandler -= value;
1121
1122                 if (_resizedEventHandler == null && _resizedEventCallback != null)
1123                 {
1124                     ResizedSignal().Disconnect(_resizedEventCallback);
1125                 }
1126             }
1127         }
1128
1129         private void OnResized(int resized)
1130         {
1131             ResizedEventArgs e = new ResizedEventArgs();
1132             e.Resized = resized;
1133
1134             if (_resizedEventHandler != null)
1135             {
1136                 _resizedEventHandler(this, e);
1137             }
1138         }
1139
1140         internal KeyboardResizedSignalType ResizedSignal()
1141         {
1142             KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false);
1143             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1144             return ret;
1145         }
1146
1147         /// <summary>
1148         /// ImfManager language changed event args.
1149         /// </summary>
1150         /// <since_tizen> 4 </since_tizen>
1151         public class LanguageChangedEventArgs : EventArgs
1152         {
1153             /// <summary>
1154             /// language changed.
1155             /// </summary>
1156             /// <since_tizen> 4 </since_tizen>
1157             public int LanguageChanged
1158             {
1159                 get;
1160                 set;
1161             }
1162         }
1163
1164         private delegate void LanguageChangedEventCallbackType(int languageChanged);
1165         private LanguageChangedEventCallbackType _languageChangedEventCallback;
1166         private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
1167
1168         /// <summary>
1169         /// ImfManager language changed.
1170         /// </summary>
1171         /// <since_tizen> 4 </since_tizen>
1172         public event EventHandler<LanguageChangedEventArgs> LanguageChanged
1173         {
1174             add
1175             {
1176                 if (_languageChangedEventHandler == null)
1177                 {
1178                     _languageChangedEventCallback = OnLanguageChanged;
1179                     LanguageChangedSignal().Connect(_languageChangedEventCallback);
1180                 }
1181
1182                 _languageChangedEventHandler += value;
1183             }
1184             remove
1185             {
1186                 _languageChangedEventHandler -= value;
1187
1188                 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1189                 {
1190                     LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1191                 }
1192             }
1193         }
1194
1195         private void OnLanguageChanged(int languageChanged)
1196         {
1197             LanguageChangedEventArgs e = new LanguageChangedEventArgs();
1198             e.LanguageChanged = languageChanged;
1199
1200             if (_languageChangedEventHandler != null)
1201             {
1202                 _languageChangedEventHandler(this, e);
1203             }
1204         }
1205
1206         internal LanguageChangedSignalType LanguageChangedSignal()
1207         {
1208             LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false);
1209             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1210             return ret;
1211         }
1212
1213         /// <summary>
1214         /// ImfManager keyboard type changed event arguments.
1215         /// </summary>
1216         /// <since_tizen> 4 </since_tizen>
1217         public class KeyboardTypeChangedEventArgs : EventArgs
1218         {
1219             /// <summary>
1220             /// ImfManager keyboard type
1221             /// </summary>
1222             /// <since_tizen> 4 </since_tizen>
1223             public KeyboardType KeyboardType
1224             {
1225                 get;
1226                 set;
1227             }
1228         }
1229
1230         private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1231         private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1232         private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1233
1234         /// <summary>
1235         /// ImfManager keyboard type changed.
1236         /// </summary>
1237         /// <since_tizen> 4 </since_tizen>
1238         public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1239         {
1240             add
1241             {
1242                 if (_keyboardTypeChangedEventHandler == null)
1243                 {
1244                     _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1245                     KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1246                 }
1247
1248                 _keyboardTypeChangedEventHandler += value;
1249             }
1250             remove
1251             {
1252                 _keyboardTypeChangedEventHandler -= value;
1253
1254                 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1255                 {
1256                     KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1257                 }
1258             }
1259         }
1260
1261         private void OnKeyboardTypeChanged(KeyboardType type)
1262         {
1263             KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1264
1265             e.KeyboardType = type;
1266
1267             if (_keyboardTypeChangedEventHandler != null)
1268             {
1269                 _keyboardTypeChangedEventHandler(this, e);
1270             }
1271         }
1272
1273         internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1274         {
1275             KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false);
1276             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1277             return ret;
1278         }
1279
1280         /// <summary>
1281         /// The direction of the text.
1282         /// </summary>
1283         /// <since_tizen> 3 </since_tizen>
1284         public enum TextDirection
1285         {
1286             /// <summary>
1287             /// Left to right.
1288             /// </summary>
1289             LeftToRight,
1290             /// <summary>
1291             /// Right to left.
1292             /// </summary>
1293             RightToLeft
1294         }
1295
1296         /// <summary>
1297         /// Events that are generated by the IMF.
1298         /// </summary>
1299         /// <since_tizen> 3 </since_tizen>
1300         public enum ImfEvent
1301         {
1302             /// <summary>
1303             /// No event.
1304             /// </summary>
1305             /// <since_tizen> 4 </since_tizen>
1306             Void,
1307             /// <summary>
1308             /// Pre-Edit changed.
1309             /// </summary>
1310             /// <since_tizen> 4 </since_tizen>
1311             Preedit,
1312             /// <summary>
1313             /// Commit received.
1314             /// </summary>
1315             /// <since_tizen> 4 </since_tizen>
1316             Commit,
1317             /// <summary>
1318             /// An event to delete a range of characters from the string.
1319             /// </summary>
1320             /// <since_tizen> 4 </since_tizen>
1321             DeleteSurrounding,
1322             /// <summary>
1323             /// An event to query string and the cursor position.
1324             /// </summary>
1325             /// <since_tizen> 4 </since_tizen>
1326             GetSurrounding,
1327             /// <summary>
1328             /// Private command sent from the input panel.
1329             /// </summary>
1330             /// <since_tizen> 4 </since_tizen>
1331             PrivateCommand
1332         }
1333
1334         /// <summary>
1335         /// Enumeration for the state of the input panel.
1336         /// </summary>
1337         /// <since_tizen> 3 </since_tizen>
1338         public enum State
1339         {
1340             /// <summary>
1341             /// Unknown state.
1342             /// </summary>
1343             /// <since_tizen> 4 </since_tizen>
1344             Default = 0,
1345             /// <summary>
1346             /// Input panel is shown.
1347             /// </summary>
1348             /// <since_tizen> 4 </since_tizen>
1349             Show,
1350             /// <summary>
1351             /// Input panel is hidden.
1352             /// </summary>
1353             /// <since_tizen> 4 </since_tizen>
1354             Hide,
1355             /// <summary>
1356             /// Input panel in process of being shown.
1357             /// </summary>
1358             /// <since_tizen> 4 </since_tizen>
1359             WillShow
1360         }
1361
1362         /// <summary>
1363         /// Enumeration for the types of keyboard.
1364         /// </summary>
1365         /// <since_tizen> 4 </since_tizen>
1366         public enum KeyboardType
1367         {
1368             /// <summary>
1369             /// Software keyboard (virtual keyboard) is default.
1370             /// </summary>
1371             /// <since_tizen> 4 </since_tizen>
1372             SoftwareKeyboard,
1373             /// <summary>
1374             /// Hardware keyboard.
1375             /// </summary>
1376             /// <since_tizen> 4 </since_tizen>
1377             HardwareKeyboard
1378         }
1379     }
1380 }