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