[NUI] Refractor ImfManager to InputMethodContext (#229)
[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         /// Destroy 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         [Obsolete("Please do not use! This will be deprecated! Please use ImfManager.Instance.DestroyContext() instead!")]
545         [EditorBrowsable(EditorBrowsableState.Never)]
546         public void Finalize()
547         {
548             DestroyContext();
549         }
550
551         /// <summary>
552         /// Retrieves a handle to the instance of the ImfManager.
553         /// </summary>
554         /// <returns>A handle to the ImfManager.</returns>
555         /// <since_tizen> 3 </since_tizen>
556         public static ImfManager Get()
557         {
558             return new ImfManager();
559         }
560
561         /// <summary>
562         /// Constructor.<br/>
563         /// </summary>
564         /// <since_tizen> 5 </since_tizen>
565         public ImfManager () : this (NDalicManualPINVOKE.InputMethodContext_New(), true) {
566             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567
568         }
569   
570         internal ImfManager(ImfManager imfManager) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(ImfManager.getCPtr(imfManager)), true) {
571             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572         }
573
574         internal ImfManager Assign(ImfManager imfManager) {
575             ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, ImfManager.getCPtr(imfManager)), false);
576             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
577             return ret;
578         }
579
580         internal static ImfManager DownCast(BaseHandle handle) {
581             ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true);
582             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583             return ret;
584         }
585
586         /// <summary>
587         /// Activates the IMF.<br/>
588         /// It means that the text editing is started somewhere.<br/>
589         /// If the hardware keyboard isn't connected, then it will show the virtual keyboard.
590         /// </summary>
591         /// <since_tizen> 3 </since_tizen>
592         public void Activate()
593         {
594             NDalicManualPINVOKE.InputMethodContext_Activate(swigCPtr);
595             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596         }
597
598         /// <summary>
599         /// Deactivates the IMF.<br/>
600         /// It means that the text editing is finished somewhere.
601         /// </summary>
602         /// <since_tizen> 3 </since_tizen>
603         public void Deactivate()
604         {
605             NDalicManualPINVOKE.InputMethodContext_Deactivate(swigCPtr);
606             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607         }
608
609         /// <summary>
610         /// Gets the restoration status which controls if the keyboard is restored after the focus is lost and then regained.<br/>
611         /// If true, then the keyboard will be restored (activated) after focus is regained.
612         /// </summary>
613         /// <returns>The restoration status.</returns>
614         /// <since_tizen> 3 </since_tizen>
615         public bool RestoreAfterFocusLost()
616         {
617             bool ret = NDalicManualPINVOKE.InputMethodContext_RestoreAfterFocusLost(swigCPtr);
618             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619             return ret;
620         }
621
622         /// <summary>
623         /// Sets the status whether the IMF has to restore the keyboard after losing focus.
624         /// </summary>
625         /// <param name="toggle">True means that keyboard should be restored after the focus is lost and regained.</param>
626         /// <since_tizen> 3 </since_tizen>
627         public void SetRestoreAfterFocusLost(bool toggle)
628         {
629             NDalicManualPINVOKE.InputMethodContext_SetRestoreAfterFocusLost(swigCPtr, toggle);
630             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
631         }
632
633         /// <summary>
634         /// Sends a message reset to the preedit state or the IMF module.
635         /// </summary>
636         /// <since_tizen> 3 </since_tizen>
637         public new void Reset()
638         {
639             NDalicManualPINVOKE.InputMethodContext_Reset(swigCPtr);
640             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641         }
642
643         /// <summary>
644         /// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization.
645         /// </summary>
646         /// <since_tizen> 3 </since_tizen>
647         public void NotifyCursorPosition()
648         {
649             NDalicManualPINVOKE.InputMethodContext_NotifyCursorPosition(swigCPtr);
650             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651         }
652
653         /// <summary>
654         /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
655         /// </summary>
656         /// <param name="cursorPosition">The position of the cursor.</param>
657         /// <since_tizen> 3 </since_tizen>
658         public void SetCursorPosition(uint cursorPosition)
659         {
660             NDalicManualPINVOKE.InputMethodContext_SetCursorPosition(swigCPtr, cursorPosition);
661             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
662         }
663
664         /// <summary>
665         /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
666         /// </summary>
667         /// <returns>The current position of the cursor.</returns>
668         /// <since_tizen> 3 </since_tizen>
669         public uint GetCursorPosition()
670         {
671             uint ret = NDalicManualPINVOKE.InputMethodContext_GetCursorPosition(swigCPtr);
672             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673             return ret;
674         }
675
676         /// <summary>
677         /// A method to store the string required by the IMF, this is used to provide predictive word suggestions.
678         /// </summary>
679         /// <param name="text">The text string surrounding the current cursor point.</param>
680         /// <since_tizen> 3 </since_tizen>
681         public void SetSurroundingText(string text)
682         {
683             NDalicManualPINVOKE.InputMethodContext_SetSurroundingText(swigCPtr, text);
684             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
685         }
686
687         /// <summary>
688         /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.
689         /// </summary>
690         /// <returns>The surrounding text.</returns>
691         /// <since_tizen> 3 </since_tizen>
692         public string GetSurroundingText()
693         {
694             string ret = NDalicManualPINVOKE.InputMethodContext_GetSurroundingText(swigCPtr);
695             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
696             return ret;
697         }
698
699         /// <summary>
700         /// Notifies the IMF context that text input is set to multiline or not.
701         /// </summary>
702         /// <param name="multiLine">True if multiline text input is used.</param>
703         /// <since_tizen> 3 </since_tizen>
704         public void NotifyTextInputMultiLine(bool multiLine)
705         {
706             NDalicManualPINVOKE.InputMethodContext_NotifyTextInputMultiLine(swigCPtr, multiLine);
707             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708         }
709
710         /// <summary>
711         /// Returns the text direction of the keyboard's current input language.
712         /// </summary>
713         /// <returns>The direction of the text.</returns>
714         /// <since_tizen> 3 </since_tizen>
715         public ImfManager.TextDirection GetTextDirection()
716         {
717             ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.InputMethodContext_GetTextDirection(swigCPtr);
718             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
719             return ret;
720         }
721
722         /// <summary>
723         /// Provides the size and the position of the keyboard.<br/>
724         /// The position is relative to whether the keyboard is visible or not.<br/>
725         /// If the keyboard is not visible, then the position will be off the screen.<br/>
726         /// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/>
727         /// the values then taken down. So ideally, GetInputMethodArea() should be called after Show().
728         /// </summary>
729         /// <returns>Rectangle which is keyboard panel x, y, width, height.</returns>
730         /// <since_tizen> 3 </since_tizen>
731         public Rectangle GetInputMethodArea()
732         {
733             Rectangle ret = new Rectangle(NDalicManualPINVOKE.InputMethodContext_GetInputMethodArea(swigCPtr), true);
734             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735             return ret;
736         }
737
738         internal void ApplyOptions(InputMethodOptions options)
739         {
740             NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
741             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
742         }
743
744         /// <summary>
745         /// Sets up the input-panel specific data.
746         /// </summary>
747         /// <param name="text">The specific data to be set to the input panel.</param>
748         /// <since_tizen> 3 </since_tizen>
749         public void SetInputPanelUserData(string text)
750         {
751             NDalicManualPINVOKE.InputMethodContext_SetInputPanelUserData(swigCPtr, text);
752             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
753         }
754
755         /// <summary>
756         /// Gets the specific data of the current active input panel.
757         /// </summary>
758         /// <param name="text">The specific data to be received from the input panel.</param>
759         /// <since_tizen> 4 </since_tizen>
760         public void GetInputPanelUserData(out string text)
761         {
762             NDalicManualPINVOKE.InputMethodContext_GetInputPanelUserData(swigCPtr, out text);
763             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
764         }
765
766         /// <summary>
767         /// Gets the state of the current active input panel.
768         /// </summary>
769         /// <returns>The state of the input panel.</returns>
770         /// <since_tizen> 3 </since_tizen>
771         public ImfManager.State GetInputPanelState()
772         {
773             ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.InputMethodContext_GetInputPanelState(swigCPtr);
774             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
775             return ret;
776         }
777
778         /// <summary>
779         /// Sets the return key on the input panel to be visible or invisible.<br/>
780         /// The default is true.
781         /// </summary>
782         /// <param name="visible">True if the return key is visible (enabled), false otherwise.</param>
783         /// <since_tizen> 3 </since_tizen>
784         public void SetReturnKeyState(bool visible)
785         {
786             NDalicManualPINVOKE.InputMethodContext_SetReturnKeyState(swigCPtr, visible);
787             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
788         }
789
790         /// <summary>
791         /// Enables to show the input panel automatically when focused.
792         /// </summary>
793         /// <param name="enabled">If true, the input panel will be shown when focused.</param>
794         /// <since_tizen> 3 </since_tizen>
795         public void AutoEnableInputPanel(bool enabled)
796         {
797             NDalicManualPINVOKE.InputMethodContext_AutoEnableInputPanel(swigCPtr, enabled);
798             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
799         }
800
801         /// <summary>
802         /// Shows the input panel.
803         /// </summary>
804         /// <since_tizen> 3 </since_tizen>
805         public void ShowInputPanel()
806         {
807             NDalicManualPINVOKE.InputMethodContext_ShowInputPanel(swigCPtr);
808             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809         }
810
811         /// <summary>
812         /// Hides the input panel.
813         /// </summary>
814         /// <since_tizen> 3 </since_tizen>
815         public void HideInputPanel()
816         {
817             NDalicManualPINVOKE.InputMethodContext_HideInputPanel(swigCPtr);
818             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
819         }
820
821         /// <summary>
822         /// Gets the keyboard type.<br/>
823         /// The default keyboard type is SoftwareKeyboard.
824         /// </summary>
825         /// <returns>The keyboard type.</returns>
826         /// <since_tizen> 4 </since_tizen>
827         public ImfManager.KeyboardType GetKeyboardType()
828         {
829             ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.InputMethodContext_GetKeyboardType(swigCPtr);
830             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
831             return ret;
832         }
833
834         /// <summary>
835         /// Gets the current language locale of the input panel.<br/>
836         /// For example, en_US, en_GB, en_PH, fr_FR, ...
837         /// </summary>
838         /// <returns>The current language locale of the input panel.</returns>
839         /// <since_tizen> 4 </since_tizen>
840         public string GetInputPanelLocale()
841         {
842             string ret = NDalicManualPINVOKE.InputMethodContext_GetInputPanelLocale(swigCPtr);
843             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
844             return ret;
845         }
846
847         /// <summary>
848         /// ImfManager activated event arguments.
849         /// </summary>
850         /// <since_tizen> 4 </since_tizen>
851         public class ActivatedEventArgs : EventArgs
852         {
853             /// <summary>
854             /// ImfManager
855             /// </summary>
856             /// <since_tizen> 4 </since_tizen>
857             public ImfManager ImfManager
858             {
859                 get;
860                 set;
861             }
862         }
863
864         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
865         private delegate void ActivatedEventCallbackType(IntPtr data);
866         private ActivatedEventCallbackType _activatedEventCallback;
867         private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
868
869         /// <summary>
870         /// ImfManager activated.
871         /// </summary>
872         /// <since_tizen> 4 </since_tizen>
873         public event EventHandler<ActivatedEventArgs> Activated
874         {
875             add
876             {
877                 if (_activatedEventHandler == null)
878                 {
879                     _activatedEventCallback = OnActivated;
880                     ActivatedSignal().Connect(_activatedEventCallback);
881                 }
882
883                 _activatedEventHandler += value;
884             }
885             remove
886             {
887                 _activatedEventHandler -= value;
888
889                 if (_activatedEventHandler == null && _activatedEventCallback != null)
890                 {
891                     ActivatedSignal().Disconnect(_activatedEventCallback);
892                 }
893             }
894         }
895
896         private void OnActivated(IntPtr data)
897         {
898             ActivatedEventArgs e = new ActivatedEventArgs();
899
900             if (data != null)
901             {
902                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
903             }
904
905             if (_activatedEventHandler != null)
906             {
907                 _activatedEventHandler(this, e);
908             }
909         }
910
911         internal ActivatedSignalType ActivatedSignal()
912         {
913             ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false);
914             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
915             return ret;
916         }
917
918         /// <summary>
919         /// ImfManager event received event arguments.
920         /// </summary>
921         /// <since_tizen> 4 </since_tizen>
922         public class EventReceivedEventArgs : EventArgs
923         {
924             /// <summary>
925             /// ImfManager
926             /// </summary>
927             /// <since_tizen> 4 </since_tizen>
928             public ImfManager ImfManager
929             {
930                 get;
931                 set;
932             }
933
934             /// <summary>
935             /// ImfEventData
936             /// </summary>
937             /// <since_tizen> 4 </since_tizen>
938             public ImfEventData ImfEventData
939             {
940                 get;
941                 set;
942             }
943         }
944
945         private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
946         private EventReceivedEventCallbackType _eventReceivedEventCallback;
947         private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
948
949         /// <summary>
950         /// ImfManager event received.
951         /// </summary>
952         /// <since_tizen> 4 </since_tizen>
953         public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
954         {
955             add
956             {
957                 if (_eventReceivedEventHandler == null)
958                 {
959                     _eventReceivedEventCallback = OnEventReceived;
960                     EventReceivedSignal().Connect(_eventReceivedEventCallback);
961                 }
962
963                 _eventReceivedEventHandler += value;
964             }
965             remove
966             {
967                 _eventReceivedEventHandler -= value;
968
969                 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
970                 {
971                     EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
972                 }
973             }
974         }
975
976         private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
977         {
978             ImfCallbackData imfCallbackData = null;
979
980             EventReceivedEventArgs e = new EventReceivedEventArgs();
981
982             if (imfManager != null)
983             {
984                 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
985             }
986             if (imfEventData != null)
987             {
988                 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
989             }
990
991             if (_eventReceivedEventHandler != null)
992             {
993                 imfCallbackData = _eventReceivedEventHandler(this, e);
994             }
995             if (imfCallbackData != null)
996             {
997                 return imfCallbackData.GetImfCallbackDataPtr();
998             }
999             else
1000             {
1001                 return new ImfCallbackData().GetImfCallbackDataPtr();
1002             }
1003         }
1004
1005         internal KeyboardEventSignalType EventReceivedSignal()
1006         {
1007             KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false);
1008             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1009             return ret;
1010         }
1011
1012         /// <summary>
1013         /// ImfManager status changed event arguments.
1014         /// </summary>
1015         /// <since_tizen> 4 </since_tizen>
1016         public class StatusChangedEventArgs : EventArgs
1017         {
1018             /// <summary>
1019             /// ImfManager status
1020             /// </summary>
1021             /// <since_tizen> 4 </since_tizen>
1022             public bool StatusChanged
1023             {
1024                 get;
1025                 set;
1026             }
1027         }
1028
1029         private delegate void StatusChangedEventCallbackType(bool statusChanged);
1030         private StatusChangedEventCallbackType _statusChangedEventCallback;
1031         private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1032
1033         /// <summary>
1034         /// ImfManager status changed.
1035         /// </summary>
1036         /// <since_tizen> 4 </since_tizen>
1037         public event EventHandler<StatusChangedEventArgs> StatusChanged
1038         {
1039             add
1040             {
1041                 if (_statusChangedEventHandler == null)
1042                 {
1043                     _statusChangedEventCallback = OnStatusChanged;
1044                     StatusChangedSignal().Connect(_statusChangedEventCallback);
1045                 }
1046
1047                 _statusChangedEventHandler += value;
1048             }
1049             remove
1050             {
1051                 _statusChangedEventHandler -= value;
1052
1053                 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1054                 {
1055                     StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1056                 }
1057             }
1058         }
1059
1060         private void OnStatusChanged(bool statusChanged)
1061         {
1062             StatusChangedEventArgs e = new StatusChangedEventArgs();
1063
1064             e.StatusChanged = statusChanged;
1065
1066             if (_statusChangedEventHandler != null)
1067             {
1068                 _statusChangedEventHandler(this, e);
1069             }
1070         }
1071
1072         internal StatusSignalType StatusChangedSignal()
1073         {
1074             StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false);
1075             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1076             return ret;
1077         }
1078
1079         /// <summary>
1080         /// ImfManager resized event.
1081         /// </summary>
1082         /// <since_tizen> 4 </since_tizen>
1083         public class ResizedEventArgs : EventArgs
1084         {
1085             /// <summary>
1086             /// resized.
1087             /// </summary>
1088             /// <since_tizen> 4 </since_tizen>
1089             public int Resized
1090             {
1091                 get;
1092                 set;
1093             }
1094         }
1095
1096         private delegate void ResizedEventCallbackType(int resized);
1097         private ResizedEventCallbackType _resizedEventCallback;
1098         private event EventHandler<ResizedEventArgs> _resizedEventHandler;
1099
1100         /// <summary>
1101         /// ImfManager resized.
1102         /// </summary>
1103         /// <since_tizen> 4 </since_tizen>
1104         public event EventHandler<ResizedEventArgs> Resized
1105         {
1106             add
1107             {
1108                 if (_resizedEventHandler == null)
1109                 {
1110                     _resizedEventCallback = OnResized;
1111                     ResizedSignal().Connect(_resizedEventCallback);
1112                 }
1113
1114                 _resizedEventHandler += value;
1115             }
1116             remove
1117             {
1118                 _resizedEventHandler -= value;
1119
1120                 if (_resizedEventHandler == null && _resizedEventCallback != null)
1121                 {
1122                     ResizedSignal().Disconnect(_resizedEventCallback);
1123                 }
1124             }
1125         }
1126
1127         private void OnResized(int resized)
1128         {
1129             ResizedEventArgs e = new ResizedEventArgs();
1130             e.Resized = resized;
1131
1132             if (_resizedEventHandler != null)
1133             {
1134                 _resizedEventHandler(this, e);
1135             }
1136         }
1137
1138         internal KeyboardResizedSignalType ResizedSignal()
1139         {
1140             KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false);
1141             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1142             return ret;
1143         }
1144
1145         /// <summary>
1146         /// ImfManager language changed event args.
1147         /// </summary>
1148         /// <since_tizen> 4 </since_tizen>
1149         public class LanguageChangedEventArgs : EventArgs
1150         {
1151             /// <summary>
1152             /// language changed.
1153             /// </summary>
1154             /// <since_tizen> 4 </since_tizen>
1155             public int LanguageChanged
1156             {
1157                 get;
1158                 set;
1159             }
1160         }
1161
1162         private delegate void LanguageChangedEventCallbackType(int languageChanged);
1163         private LanguageChangedEventCallbackType _languageChangedEventCallback;
1164         private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
1165
1166         /// <summary>
1167         /// ImfManager language changed.
1168         /// </summary>
1169         /// <since_tizen> 4 </since_tizen>
1170         public event EventHandler<LanguageChangedEventArgs> LanguageChanged
1171         {
1172             add
1173             {
1174                 if (_languageChangedEventHandler == null)
1175                 {
1176                     _languageChangedEventCallback = OnLanguageChanged;
1177                     LanguageChangedSignal().Connect(_languageChangedEventCallback);
1178                 }
1179
1180                 _languageChangedEventHandler += value;
1181             }
1182             remove
1183             {
1184                 _languageChangedEventHandler -= value;
1185
1186                 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1187                 {
1188                     LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1189                 }
1190             }
1191         }
1192
1193         private void OnLanguageChanged(int languageChanged)
1194         {
1195             LanguageChangedEventArgs e = new LanguageChangedEventArgs();
1196             e.LanguageChanged = languageChanged;
1197
1198             if (_languageChangedEventHandler != null)
1199             {
1200                 _languageChangedEventHandler(this, e);
1201             }
1202         }
1203
1204         internal LanguageChangedSignalType LanguageChangedSignal()
1205         {
1206             LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false);
1207             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1208             return ret;
1209         }
1210
1211         /// <summary>
1212         /// ImfManager keyboard type changed event arguments.
1213         /// </summary>
1214         /// <since_tizen> 4 </since_tizen>
1215         public class KeyboardTypeChangedEventArgs : EventArgs
1216         {
1217             /// <summary>
1218             /// ImfManager keyboard type
1219             /// </summary>
1220             /// <since_tizen> 4 </since_tizen>
1221             public KeyboardType KeyboardType
1222             {
1223                 get;
1224                 set;
1225             }
1226         }
1227
1228         private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1229         private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1230         private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1231
1232         /// <summary>
1233         /// ImfManager keyboard type changed.
1234         /// </summary>
1235         /// <since_tizen> 4 </since_tizen>
1236         public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1237         {
1238             add
1239             {
1240                 if (_keyboardTypeChangedEventHandler == null)
1241                 {
1242                     _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1243                     KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1244                 }
1245
1246                 _keyboardTypeChangedEventHandler += value;
1247             }
1248             remove
1249             {
1250                 _keyboardTypeChangedEventHandler -= value;
1251
1252                 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1253                 {
1254                     KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1255                 }
1256             }
1257         }
1258
1259         private void OnKeyboardTypeChanged(KeyboardType type)
1260         {
1261             KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1262
1263             e.KeyboardType = type;
1264
1265             if (_keyboardTypeChangedEventHandler != null)
1266             {
1267                 _keyboardTypeChangedEventHandler(this, e);
1268             }
1269         }
1270
1271         internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1272         {
1273             KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false);
1274             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1275             return ret;
1276         }
1277
1278         /// <summary>
1279         /// The direction of the text.
1280         /// </summary>
1281         /// <since_tizen> 3 </since_tizen>
1282         public enum TextDirection
1283         {
1284             /// <summary>
1285             /// Left to right.
1286             /// </summary>
1287             LeftToRight,
1288             /// <summary>
1289             /// Right to left.
1290             /// </summary>
1291             RightToLeft
1292         }
1293
1294         /// <summary>
1295         /// Events that are generated by the IMF.
1296         /// </summary>
1297         /// <since_tizen> 3 </since_tizen>
1298         public enum ImfEvent
1299         {
1300             /// <summary>
1301             /// No event.
1302             /// </summary>
1303             /// <since_tizen> 4 </since_tizen>
1304             Void,
1305             /// <summary>
1306             /// Pre-Edit changed.
1307             /// </summary>
1308             /// <since_tizen> 4 </since_tizen>
1309             Preedit,
1310             /// <summary>
1311             /// Commit received.
1312             /// </summary>
1313             /// <since_tizen> 4 </since_tizen>
1314             Commit,
1315             /// <summary>
1316             /// An event to delete a range of characters from the string.
1317             /// </summary>
1318             /// <since_tizen> 4 </since_tizen>
1319             DeleteSurrounding,
1320             /// <summary>
1321             /// An event to query string and the cursor position.
1322             /// </summary>
1323             /// <since_tizen> 4 </since_tizen>
1324             GetSurrounding,
1325             /// <summary>
1326             /// Private command sent from the input panel.
1327             /// </summary>
1328             /// <since_tizen> 4 </since_tizen>
1329             PrivateCommand
1330         }
1331
1332         /// <summary>
1333         /// Enumeration for the state of the input panel.
1334         /// </summary>
1335         /// <since_tizen> 3 </since_tizen>
1336         public enum State
1337         {
1338             /// <summary>
1339             /// Unknown state.
1340             /// </summary>
1341             /// <since_tizen> 4 </since_tizen>
1342             Default = 0,
1343             /// <summary>
1344             /// Input panel is shown.
1345             /// </summary>
1346             /// <since_tizen> 4 </since_tizen>
1347             Show,
1348             /// <summary>
1349             /// Input panel is hidden.
1350             /// </summary>
1351             /// <since_tizen> 4 </since_tizen>
1352             Hide,
1353             /// <summary>
1354             /// Input panel in process of being shown.
1355             /// </summary>
1356             /// <since_tizen> 4 </since_tizen>
1357             WillShow
1358         }
1359
1360         /// <summary>
1361         /// Enumeration for the types of keyboard.
1362         /// </summary>
1363         /// <since_tizen> 4 </since_tizen>
1364         public enum KeyboardType
1365         {
1366             /// <summary>
1367             /// Software keyboard (virtual keyboard) is default.
1368             /// </summary>
1369             /// <since_tizen> 4 </since_tizen>
1370             SoftwareKeyboard,
1371             /// <summary>
1372             /// Hardware keyboard.
1373             /// </summary>
1374             /// <since_tizen> 4 </since_tizen>
1375             HardwareKeyboard
1376         }
1377     }
1378 }