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