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