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