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