[NUI] Sync with dalihub & API5 branch (#631)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / InputMethodContext.cs
1 /*
2  * Copyright(c) 2018 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 (IMF) that enables the virtual or hardware keyboards.
26     /// </summary>
27     /// <since_tizen> 5 </since_tizen>
28     public class InputMethodContext : BaseHandle
29     {
30         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31
32         private ActivatedEventCallbackType _activatedEventCallback;
33         private EventReceivedEventCallbackType _eventReceivedEventCallback;
34         private StatusChangedEventCallbackType _statusChangedEventCallback;
35         private ResizedEventCallbackType _resizedEventCallback;
36         private LanguageChangedEventCallbackType _languageChangedEventCallback;
37         private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
38
39         /// <summary>
40         /// Constructor.<br/>
41         /// </summary>
42         /// <since_tizen> 5 </since_tizen>
43         public InputMethodContext() : this(NDalicManualPINVOKE.InputMethodContext_New(), true)
44         {
45             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
46
47         }
48
49         internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn)
50         {
51             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
52         }
53
54         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
55         private delegate void ActivatedEventCallbackType(IntPtr data);
56         private delegate IntPtr EventReceivedEventCallbackType(IntPtr inputMethodContext, IntPtr eventData);
57         private delegate void StatusChangedEventCallbackType(bool statusChanged);
58         private delegate void ResizedEventCallbackType(int resized);
59         private delegate void LanguageChangedEventCallbackType(int languageChanged);
60         private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
61
62         private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
63         private event EventHandlerWithReturnType<object, EventReceivedEventArgs, CallbackData> _eventReceivedEventHandler;
64         private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
65         private event EventHandler<ResizedEventArgs> _resizedEventHandler;
66         private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
67         private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
68
69         /// <summary>
70         /// InputMethodContext activated.
71         /// </summary>
72         /// <since_tizen> 5 </since_tizen>
73         public event EventHandler<ActivatedEventArgs> Activated
74         {
75             add
76             {
77                 if (_activatedEventHandler == null)
78                 {
79                     _activatedEventCallback = OnActivated;
80                     ActivatedSignal().Connect(_activatedEventCallback);
81                 }
82
83                 _activatedEventHandler += value;
84             }
85             remove
86             {
87                 _activatedEventHandler -= value;
88
89                 if (_activatedEventHandler == null && _activatedEventCallback != null)
90                 {
91                     ActivatedSignal().Disconnect(_activatedEventCallback);
92                 }
93             }
94         }
95
96         /// <summary>
97         /// InputMethodContext event received.
98         /// </summary>
99         /// <since_tizen> 5 </since_tizen>
100         public event EventHandlerWithReturnType<object, EventReceivedEventArgs, CallbackData> EventReceived
101         {
102             add
103             {
104                 if (_eventReceivedEventHandler == null)
105                 {
106                     _eventReceivedEventCallback = OnEventReceived;
107                     EventReceivedSignal().Connect(_eventReceivedEventCallback);
108                 }
109
110                 _eventReceivedEventHandler += value;
111             }
112             remove
113             {
114                 _eventReceivedEventHandler -= value;
115
116                 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
117                 {
118                     EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
119                 }
120             }
121         }
122
123         /// <summary>
124         /// InputMethodContext status changed.
125         /// </summary>
126         /// <since_tizen> 5 </since_tizen>
127         public event EventHandler<StatusChangedEventArgs> StatusChanged
128         {
129             add
130             {
131                 if (_statusChangedEventHandler == null)
132                 {
133                     _statusChangedEventCallback = OnStatusChanged;
134                     StatusChangedSignal().Connect(_statusChangedEventCallback);
135                 }
136
137                 _statusChangedEventHandler += value;
138             }
139             remove
140             {
141                 _statusChangedEventHandler -= value;
142
143                 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
144                 {
145                     StatusChangedSignal().Disconnect(_statusChangedEventCallback);
146                 }
147             }
148         }
149
150         /// <summary>
151         /// InputMethodContext resized.
152         /// </summary>
153         /// <since_tizen> 5 </since_tizen>
154         public event EventHandler<ResizedEventArgs> Resized
155         {
156             add
157             {
158                 if (_resizedEventHandler == null)
159                 {
160                     _resizedEventCallback = OnResized;
161                     ResizedSignal().Connect(_resizedEventCallback);
162                 }
163
164                 _resizedEventHandler += value;
165             }
166             remove
167             {
168                 _resizedEventHandler -= value;
169
170                 if (_resizedEventHandler == null && _resizedEventCallback != null)
171                 {
172                     ResizedSignal().Disconnect(_resizedEventCallback);
173                 }
174             }
175         }
176
177         /// <summary>
178         /// InputMethodContext language changed.
179         /// </summary>
180         /// <since_tizen> 5 </since_tizen>
181         public event EventHandler<LanguageChangedEventArgs> LanguageChanged
182         {
183             add
184             {
185                 if (_languageChangedEventHandler == null)
186                 {
187                     _languageChangedEventCallback = OnLanguageChanged;
188                     LanguageChangedSignal().Connect(_languageChangedEventCallback);
189                 }
190
191                 _languageChangedEventHandler += value;
192             }
193             remove
194             {
195                 _languageChangedEventHandler -= value;
196
197                 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
198                 {
199                     LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
200                 }
201             }
202         }
203
204         /// <summary>
205         /// InputMethodContext keyboard type changed.
206         /// </summary>
207         /// <since_tizen> 5 </since_tizen>
208         public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
209         {
210             add
211             {
212                 if (_keyboardTypeChangedEventHandler == null)
213                 {
214                     _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
215                     KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
216                 }
217
218                 _keyboardTypeChangedEventHandler += value;
219             }
220             remove
221             {
222                 _keyboardTypeChangedEventHandler -= value;
223
224                 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
225                 {
226                     KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
227                 }
228             }
229         }
230
231         /// <summary>
232         /// The direction of the text.
233         /// </summary>
234         /// <since_tizen> 5 </since_tizen>
235         public enum TextDirection
236         {
237             /// <summary>
238             /// Left to right.
239             /// </summary>
240             LeftToRight,
241             /// <summary>
242             /// Right to left.
243             /// </summary>
244             RightToLeft
245         }
246
247         /// <summary>
248         /// Events that are generated by the IMF.
249         /// </summary>
250         /// <since_tizen> 5 </since_tizen>
251         public enum EventType
252         {
253             /// <summary>
254             /// No event.
255             /// </summary>
256             /// <since_tizen> 5 </since_tizen>
257             Void,
258             /// <summary>
259             /// Pre-edit changed.
260             /// </summary>
261             /// <since_tizen> 5 </since_tizen>
262             Preedit,
263             /// <summary>
264             /// Commit received.
265             /// </summary>
266             /// <since_tizen> 5 </since_tizen>
267             Commit,
268             /// <summary>
269             /// An event to delete a range of characters from the string.
270             /// </summary>
271             /// <since_tizen> 5 </since_tizen>
272             DeleteSurrounding,
273             /// <summary>
274             /// An event to query string and the cursor position.
275             /// </summary>
276             /// <since_tizen> 5 </since_tizen>
277             GetSurrounding,
278             /// <summary>
279             /// Private command sent from the input panel.
280             /// </summary>
281             /// <since_tizen> 5 </since_tizen>
282             PrivateCommand
283         }
284
285         /// <summary>
286         /// Enumeration for the state of the input panel.
287         /// </summary>
288         /// <since_tizen> 5 </since_tizen>
289         public enum State
290         {
291             /// <summary>
292             /// Unknown state.
293             /// </summary>
294             /// <since_tizen> 5 </since_tizen>
295             Default = 0,
296             /// <summary>
297             /// Input panel is shown.
298             /// </summary>
299             /// <since_tizen> 5 </since_tizen>
300             Show,
301             /// <summary>
302             /// Input panel is hidden.
303             /// </summary>
304             /// <since_tizen> 5 </since_tizen>
305             Hide,
306             /// <summary>
307             /// Input panel in process of being shown.
308             /// </summary>
309             /// <since_tizen> 5 </since_tizen>
310             WillShow
311         }
312
313         /// <summary>
314         /// Enumeration for the types of keyboard.
315         /// </summary>
316         /// <since_tizen> 5 </since_tizen>
317         public enum KeyboardType
318         {
319             /// <summary>
320             /// Software keyboard (virtual keyboard) is default.
321             /// </summary>
322             /// <since_tizen> 5 </since_tizen>
323             SoftwareKeyboard,
324             /// <summary>
325             /// Hardware keyboard.
326             /// </summary>
327             /// <since_tizen> 5 </since_tizen>
328             HardwareKeyboard
329         }
330
331         /// <summary>
332         /// Gets or sets whether the IM context allows to use the text prediction.
333         /// </summary>
334         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
335         [EditorBrowsable(EditorBrowsableState.Never)]
336         public bool TextPrediction
337         {
338             get
339             {
340                 return IsTextPredictionAllowed();
341             }
342             set
343             {
344                 AllowTextPrediction(value);
345             }
346         }
347
348         /// <summary>
349         /// Destroys the context of the IMF.<br/>
350         /// </summary>
351         /// <since_tizen> 5 </since_tizen>
352         public void DestroyContext()
353         {
354             NDalicManualPINVOKE.InputMethodContext_Finalize(swigCPtr);
355             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356         }
357
358         /// <summary>
359         /// Activates the IMF.<br/>
360         /// It means that the text editing has started.<br/>
361         /// If the hardware keyboard is not connected, then it shows the virtual keyboard.
362         /// </summary>
363         /// <since_tizen> 5 </since_tizen>
364         public void Activate()
365         {
366             NDalicManualPINVOKE.InputMethodContext_Activate(swigCPtr);
367             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
368         }
369
370         /// <summary>
371         /// Deactivates the IMF.<br/>
372         /// It means that the text editing is complete.
373         /// </summary>
374         /// <since_tizen> 5 </since_tizen>
375         public void Deactivate()
376         {
377             NDalicManualPINVOKE.InputMethodContext_Deactivate(swigCPtr);
378             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379         }
380
381         /// <summary>
382         /// Gets the restoration status, which controls if the keyboard is restored after the focus is lost and then regained.<br/>
383         /// If true, then the keyboard will be restored (activated) after the focus is regained.
384         /// </summary>
385         /// <returns>The restoration status.</returns>
386         /// <since_tizen> 5 </since_tizen>
387         public bool RestoreAfterFocusLost()
388         {
389             bool ret = NDalicManualPINVOKE.InputMethodContext_RestoreAfterFocusLost(swigCPtr);
390             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391             return ret;
392         }
393
394         /// <summary>
395         /// Sets the status whether the IMF has to restore the keyboard after losing focus.
396         /// </summary>
397         /// <param name="toggle">True means that keyboard must be restored after the focus is lost and regained.</param>
398         /// <since_tizen> 5 </since_tizen>
399         public void SetRestoreAfterFocusLost(bool toggle)
400         {
401             NDalicManualPINVOKE.InputMethodContext_SetRestoreAfterFocusLost(swigCPtr, toggle);
402             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
403         }
404
405         /// <summary>
406         /// Sends a message reset to the pre-edit state or the IMF module.
407         /// </summary>
408         /// <since_tizen> 5 </since_tizen>
409         public new void Reset()
410         {
411             NDalicManualPINVOKE.InputMethodContext_Reset(swigCPtr);
412             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413         }
414
415         /// <summary>
416         /// Notifies the IMF context that the cursor position has changed, required for features such as auto-capitalization.
417         /// </summary>
418         /// <since_tizen> 5 </since_tizen>
419         public void NotifyCursorPosition()
420         {
421             NDalicManualPINVOKE.InputMethodContext_NotifyCursorPosition(swigCPtr);
422             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
423         }
424
425         /// <summary>
426         /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
427         /// </summary>
428         /// <param name="cursorPosition">The position of the cursor.</param>
429         /// <since_tizen> 5 </since_tizen>
430         public void SetCursorPosition(uint cursorPosition)
431         {
432             NDalicManualPINVOKE.InputMethodContext_SetCursorPosition(swigCPtr, cursorPosition);
433             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434         }
435
436         /// <summary>
437         /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
438         /// </summary>
439         /// <returns>The current position of the cursor.</returns>
440         /// <since_tizen> 5 </since_tizen>
441         public uint GetCursorPosition()
442         {
443             uint ret = NDalicManualPINVOKE.InputMethodContext_GetCursorPosition(swigCPtr);
444             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
445             return ret;
446         }
447
448         /// <summary>
449         /// A method to store the string required by the IMF, this is used to provide predictive word suggestions.
450         /// </summary>
451         /// <param name="text">The text string surrounding the current cursor point.</param>
452         /// <since_tizen> 5 </since_tizen>
453         public void SetSurroundingText(string text)
454         {
455             NDalicManualPINVOKE.InputMethodContext_SetSurroundingText(swigCPtr, text);
456             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
457         }
458
459         /// <summary>
460         /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.
461         /// </summary>
462         /// <returns>The surrounding text.</returns>
463         /// <since_tizen> 5 </since_tizen>
464         public string GetSurroundingText()
465         {
466             string ret = NDalicManualPINVOKE.InputMethodContext_GetSurroundingText(swigCPtr);
467             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
468             return ret;
469         }
470
471         /// <summary>
472         /// Notifies the IMF context that text input is set to multiline or not.
473         /// </summary>
474         /// <param name="multiLine">True if multiline text input is used.</param>
475         /// <since_tizen> 5 </since_tizen>
476         public void NotifyTextInputMultiLine(bool multiLine)
477         {
478             NDalicManualPINVOKE.InputMethodContext_NotifyTextInputMultiLine(swigCPtr, multiLine);
479             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480         }
481
482         /// <summary>
483         /// Returns the text direction of the current input language of the keyboard.
484         /// </summary>
485         /// <returns>The direction of the text.</returns>
486         /// <since_tizen> 5 </since_tizen>
487         public InputMethodContext.TextDirection GetTextDirection()
488         {
489             InputMethodContext.TextDirection ret = (InputMethodContext.TextDirection)NDalicManualPINVOKE.InputMethodContext_GetTextDirection(swigCPtr);
490             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491             return ret;
492         }
493
494         /// <summary>
495         /// Provides the size and the position of the keyboard.<br/>
496         /// The position is relative to whether the keyboard is visible or not.<br/>
497         /// If the keyboard is not visible, then the position will be off the screen.<br/>
498         /// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/>
499         /// the values then taken down. So ideally, GetInputMethodArea() must be called after Show().
500         /// </summary>
501         /// <returns>Rectangle which is keyboard panel x, y, width, and height.</returns>
502         /// <since_tizen> 5 </since_tizen>
503         public Rectangle GetInputMethodArea()
504         {
505             Rectangle ret = new Rectangle(NDalicManualPINVOKE.InputMethodContext_GetInputMethodArea(swigCPtr), true);
506             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507             return ret;
508         }
509
510         /// <summary>
511         /// Sets up the input panel specific data.
512         /// </summary>
513         /// <param name="text">The specific data to be set to the input panel.</param>
514         /// <since_tizen> 5 </since_tizen>
515         public void SetInputPanelUserData(string text)
516         {
517             NDalicManualPINVOKE.InputMethodContext_SetInputPanelUserData(swigCPtr, text);
518             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519         }
520
521         /// <summary>
522         /// Gets the specific data of the current active input panel.
523         /// </summary>
524         /// <param name="text">The specific data to be received from the input panel.</param>
525         /// <since_tizen> 5 </since_tizen>
526         public void GetInputPanelUserData(out string text)
527         {
528             NDalicManualPINVOKE.InputMethodContext_GetInputPanelUserData(swigCPtr, out text);
529             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530         }
531
532         /// <summary>
533         /// Gets the state of the current active input panel.
534         /// </summary>
535         /// <returns>The state of the input panel.</returns>
536         /// <since_tizen> 5 </since_tizen>
537         public InputMethodContext.State GetInputPanelState()
538         {
539             InputMethodContext.State ret = (InputMethodContext.State)NDalicManualPINVOKE.InputMethodContext_GetInputPanelState(swigCPtr);
540             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
541             return ret;
542         }
543
544         /// <summary>
545         /// Sets the return key on the input panel to be visible or invisible.<br/>
546         /// The default value is true.
547         /// </summary>
548         /// <param name="visible">True if the return key is visible (enabled), false otherwise.</param>
549         /// <since_tizen> 5 </since_tizen>
550         public void SetReturnKeyState(bool visible)
551         {
552             NDalicManualPINVOKE.InputMethodContext_SetReturnKeyState(swigCPtr, visible);
553             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554         }
555
556         /// <summary>
557         /// Enables to show the input panel automatically when focused.
558         /// </summary>
559         /// <param name="enabled">If true, the input panel will be shown when focused.</param>
560         /// <since_tizen> 5 </since_tizen>
561         public void AutoEnableInputPanel(bool enabled)
562         {
563             NDalicManualPINVOKE.InputMethodContext_AutoEnableInputPanel(swigCPtr, enabled);
564             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
565         }
566
567         /// <summary>
568         /// Shows the input panel.
569         /// </summary>
570         /// <since_tizen> 5 </since_tizen>
571         public void ShowInputPanel()
572         {
573             NDalicManualPINVOKE.InputMethodContext_ShowInputPanel(swigCPtr);
574             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
575         }
576
577         /// <summary>
578         /// Hides the input panel.
579         /// </summary>
580         /// <since_tizen> 5 </since_tizen>
581         public void HideInputPanel()
582         {
583             NDalicManualPINVOKE.InputMethodContext_HideInputPanel(swigCPtr);
584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585         }
586
587         /// <summary>
588         /// Gets the keyboard type.<br/>
589         /// The default keyboard type is SoftwareKeyboard.
590         /// </summary>
591         /// <returns>The keyboard type.</returns>
592         /// <since_tizen> 5 </since_tizen>
593         public InputMethodContext.KeyboardType GetKeyboardType()
594         {
595             InputMethodContext.KeyboardType ret = (InputMethodContext.KeyboardType)NDalicManualPINVOKE.InputMethodContext_GetKeyboardType(swigCPtr);
596             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
597             return ret;
598         }
599
600         /// <summary>
601         /// Gets the current language locale of the input panel.<br/>
602         /// For example, en_US, en_GB, en_PH, fr_FR, and so on.
603         /// </summary>
604         /// <returns>The current language locale of the input panel.</returns>
605         /// <since_tizen> 5 </since_tizen>
606         public string GetInputPanelLocale()
607         {
608             string ret = NDalicManualPINVOKE.InputMethodContext_GetInputPanelLocale(swigCPtr);
609             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610             return ret;
611         }
612
613         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(InputMethodContext obj)
614         {
615             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
616         }
617
618         internal InputMethodContext(InputMethodContext inputMethodContext) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(InputMethodContext.getCPtr(inputMethodContext)), true)
619         {
620             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621         }
622
623         internal InputMethodContext Assign(InputMethodContext inputMethodContext)
624         {
625             InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, InputMethodContext.getCPtr(inputMethodContext)), false);
626             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627             return ret;
628         }
629
630         internal static InputMethodContext DownCast(BaseHandle handle)
631         {
632             InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true);
633             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634             return ret;
635         }
636
637         internal void ApplyOptions(InputMethodOptions options)
638         {
639             NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
640             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641         }
642
643         internal void AllowTextPrediction(bool prediction)
644         {
645             NDalicManualPINVOKE.InputMethodContext_AllowTextPrediction(swigCPtr, prediction);
646             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647         }
648
649         internal bool IsTextPredictionAllowed()
650         {
651             bool ret = NDalicManualPINVOKE.InputMethodContext_IsTextPredictionAllowed(swigCPtr);
652             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653             return ret;
654         }
655
656         internal ActivatedSignalType ActivatedSignal()
657         {
658             ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false);
659             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
660             return ret;
661         }
662
663         internal KeyboardEventSignalType EventReceivedSignal()
664         {
665             KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false);
666             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667             return ret;
668         }
669
670         internal StatusSignalType StatusChangedSignal()
671         {
672             StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false);
673             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
674             return ret;
675         }
676
677         internal KeyboardResizedSignalType ResizedSignal()
678         {
679             KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false);
680             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
681             return ret;
682         }
683
684         internal LanguageChangedSignalType LanguageChangedSignal()
685         {
686             LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false);
687             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
688             return ret;
689         }
690
691         internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
692         {
693             KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false);
694             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
695             return ret;
696         }
697
698         /// <summary>
699         /// Dispose
700         /// </summary>
701         /// <param name="type">Dispose Type</param>
702         /// <since_tizen> 5 </since_tizen>
703         /// Please DO NOT use! This will be deprecated!
704         /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, InputMethodContext, TtsPlayer, Window) is not required.
705         [EditorBrowsable(EditorBrowsableState.Never)]
706         protected override void Dispose(DisposeTypes type)
707         {
708             if (disposed)
709             {
710                 return;
711             }
712
713             if (type == DisposeTypes.Explicit)
714             {
715                 //Called by User.
716                 //Release your own managed resources here.
717                 //You should release all of your own disposable objects here.
718
719             }
720
721             //Release your own unmanaged resources here.
722             //You should not access any managed member here except static instance.
723             //Because the execution order of Finalizes is non-deterministic.
724
725             if (_keyboardTypeChangedEventCallback != null)
726             {
727                 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
728             }
729
730             if (swigCPtr.Handle != global::System.IntPtr.Zero)
731             {
732                 if (swigCMemOwn)
733                 {
734                     swigCMemOwn = false;
735                     NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr);
736                 }
737                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
738             }
739
740             base.Dispose(type);
741         }
742
743         private void OnActivated(IntPtr data)
744         {
745             ActivatedEventArgs e = new ActivatedEventArgs();
746
747             if (data != null)
748             {
749                 e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(data) as InputMethodContext;
750             }
751
752             if (_activatedEventHandler != null)
753             {
754                 _activatedEventHandler(this, e);
755             }
756         }
757
758         private IntPtr OnEventReceived(IntPtr inputMethodContext, IntPtr eventData)
759         {
760             CallbackData callbackData = null;
761
762             EventReceivedEventArgs e = new EventReceivedEventArgs();
763
764             if (inputMethodContext != null)
765             {
766                 e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(inputMethodContext) as InputMethodContext;
767             }
768             if (eventData != null)
769             {
770                 e.EventData = EventData.GetEventDataFromPtr(eventData);
771             }
772
773             if (_eventReceivedEventHandler != null)
774             {
775                 callbackData = _eventReceivedEventHandler(this, e);
776             }
777             if (callbackData != null)
778             {
779                 return callbackData.GetCallbackDataPtr();
780             }
781             else
782             {
783                 return new CallbackData().GetCallbackDataPtr();
784             }
785         }
786
787         private void OnStatusChanged(bool statusChanged)
788         {
789             StatusChangedEventArgs e = new StatusChangedEventArgs();
790
791             e.StatusChanged = statusChanged;
792
793             if (_statusChangedEventHandler != null)
794             {
795                 _statusChangedEventHandler(this, e);
796             }
797         }
798
799         private void OnResized(int resized)
800         {
801             ResizedEventArgs e = new ResizedEventArgs();
802             e.Resized = resized;
803
804             if (_resizedEventHandler != null)
805             {
806                 _resizedEventHandler(this, e);
807             }
808         }
809
810         private void OnLanguageChanged(int languageChanged)
811         {
812             LanguageChangedEventArgs e = new LanguageChangedEventArgs();
813             e.LanguageChanged = languageChanged;
814
815             if (_languageChangedEventHandler != null)
816             {
817                 _languageChangedEventHandler(this, e);
818             }
819         }
820
821         private void OnKeyboardTypeChanged(KeyboardType type)
822         {
823             KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
824
825             e.KeyboardType = type;
826
827             if (_keyboardTypeChangedEventHandler != null)
828             {
829                 _keyboardTypeChangedEventHandler(this, e);
830             }
831         }
832
833         /// <summary>
834         /// This structure is used to pass on data from the IMF regarding predictive text.
835         /// </summary>
836         /// <since_tizen> 5 </since_tizen>
837         public class EventData : global::System.IDisposable
838         {
839             /// <summary>
840             /// swigCMemOwn
841             /// </summary>
842             /// <since_tizen> 5 </since_tizen>
843             protected bool swigCMemOwn;
844
845             /// <summary>
846             /// A flag to check if it is already disposed.
847             /// </summary>
848             /// <since_tizen> 5 </since_tizen>
849             protected bool disposed = false;
850
851             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
852
853             //A flag to check who called Dispose(). (By User or DisposeQueue)
854             private bool isDisposeQueued = false;
855
856             /// <summary>
857             /// The default constructor.
858             /// </summary>
859             /// <since_tizen> 5 </since_tizen>
860             public EventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true)
861             {
862                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
863             }
864
865             /// <summary>
866             /// The constructor.
867             /// </summary>
868             /// <param name="aEventName">The name of the event from the IMF.</param>
869             /// <param name="aPredictiveString">The pre-edit or the commit string.</param>
870             /// <param name="aCursorOffset">Start the position from the current cursor position to start deleting characters.</param>
871             /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
872             /// <since_tizen> 5 </since_tizen>
873             public EventData(InputMethodContext.EventType aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
874             {
875                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
876             }
877
878             internal EventData(IntPtr cPtr, bool cMemoryOwn)
879             {
880                 swigCMemOwn = cMemoryOwn;
881                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
882             }
883
884             /// <summary>
885             /// Dispose.
886             /// </summary>
887             /// <since_tizen> 5 </since_tizen>
888             ~EventData()
889             {
890                 if (!isDisposeQueued)
891                 {
892                     isDisposeQueued = true;
893                     DisposeQueue.Instance.Add(this);
894                 }
895             }
896
897             /// <summary>
898             /// The pre-edit or the commit string.
899             /// </summary>
900             /// <since_tizen> 5 </since_tizen>
901             public string PredictiveString
902             {
903                 set
904                 {
905                     NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_set(swigCPtr, value);
906                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907                 }
908                 get
909                 {
910                     string ret = NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_get(swigCPtr);
911                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
912                     return ret;
913                 }
914             }
915
916             /// <summary>
917             /// The name of the event from the IMF.
918             /// </summary>
919             /// <since_tizen> 5 </since_tizen>
920             public InputMethodContext.EventType EventName
921             {
922                 set
923                 {
924                     NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value);
925                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
926                 }
927                 get
928                 {
929                     InputMethodContext.EventType ret = (InputMethodContext.EventType)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr);
930                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
931                     return ret;
932                 }
933             }
934
935             /// <summary>
936             /// The start position from the current cursor position to start deleting characters.
937             /// </summary>
938             /// <since_tizen> 5 </since_tizen>
939             public int CursorOffset
940             {
941                 set
942                 {
943                     NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value);
944                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
945                 }
946                 get
947                 {
948                     int ret = NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_get(swigCPtr);
949                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
950                     return ret;
951                 }
952             }
953
954             /// <summary>
955             /// The number of characters to delete from the cursorOffset.
956             /// </summary>
957             /// <since_tizen> 5 </since_tizen>
958             public int NumberOfChars
959             {
960                 set
961                 {
962                     NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value);
963                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
964                 }
965                 get
966                 {
967                     int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr);
968                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
969                     return ret;
970                 }
971             }
972
973             /// <summary>
974             /// The dispose pattern.
975             /// </summary>
976             /// <since_tizen> 5 </since_tizen>
977             public void Dispose()
978             {
979                 //Throw excpetion if Dispose() is called in separate thread.
980                 if (!Window.IsInstalled())
981                 {
982                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
983                 }
984
985                 if (isDisposeQueued)
986                 {
987                     Dispose(DisposeTypes.Implicit);
988                 }
989                 else
990                 {
991                     Dispose(DisposeTypes.Explicit);
992                     System.GC.SuppressFinalize(this);
993                 }
994             }
995
996             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventData obj)
997             {
998                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
999             }
1000
1001             internal static EventData GetEventDataFromPtr(IntPtr cPtr)
1002             {
1003                 EventData ret = new EventData(cPtr, false);
1004                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1005                 return ret;
1006             }
1007
1008             /// <summary>
1009             /// Dispose.
1010             /// </summary>
1011             /// <since_tizen> 5 </since_tizen>
1012             protected virtual void Dispose(DisposeTypes type)
1013             {
1014                 if (disposed)
1015                 {
1016                     return;
1017                 }
1018
1019                 if (type == DisposeTypes.Explicit)
1020                 {
1021                     //Called by User.
1022                     //Release your own managed resources here.
1023                     //You should release all of your own disposable objects here.
1024
1025                 }
1026
1027                 //Release your own unmanaged resources here.
1028                 //You should not access any managed member here except static instance.
1029                 //because the execution order of Finalizes is non-deterministic.
1030
1031                 if (swigCPtr.Handle != IntPtr.Zero)
1032                 {
1033                     if (swigCMemOwn)
1034                     {
1035                         swigCMemOwn = false;
1036                         NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr);
1037                     }
1038                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
1039                 }
1040
1041                 disposed = true;
1042             }
1043         }
1044
1045         /// <summary>
1046         /// Data required by the IMF from the callback.
1047         /// </summary>
1048         /// <since_tizen> 5 </since_tizen>
1049         public class CallbackData : global::System.IDisposable
1050         {
1051             /// <summary>
1052             /// swigCMemOwn
1053             /// </summary>
1054             /// <since_tizen> 5 </since_tizen>
1055             protected bool swigCMemOwn;
1056
1057             /// <summary>
1058             /// A Flag to check if it is already disposed.
1059             /// </summary>
1060             /// <since_tizen> 5 </since_tizen>
1061             protected bool disposed = false;
1062
1063             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
1064
1065             //A Flag to check who called Dispose(). (By User or DisposeQueue)
1066             private bool isDisposeQueued = false;
1067
1068             /// <summary>
1069             /// The default constructor.
1070             /// </summary>
1071             /// <since_tizen> 5 </since_tizen>
1072             public CallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true)
1073             {
1074                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1075             }
1076
1077             /// <summary>
1078             /// The constructor.
1079             /// </summary>
1080             /// <param name="aUpdate">True if the cursor position needs to be updated.</param>
1081             /// <param name="aCursorPosition">The new position of the cursor.</param>
1082             /// <param name="aCurrentText">The current text string.</param>
1083             /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
1084             /// <since_tizen> 5 </since_tizen>
1085             public CallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
1086             {
1087                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1088             }
1089
1090             /// <summary>
1091             /// Dispose.
1092             /// </summary>
1093             /// <since_tizen> 5 </since_tizen>
1094             ~CallbackData()
1095             {
1096                 if (!isDisposeQueued)
1097                 {
1098                     isDisposeQueued = true;
1099                     DisposeQueue.Instance.Add(this);
1100                 }
1101             }
1102
1103             /// <summary>
1104             /// The current text string.
1105             /// </summary>
1106             /// <since_tizen> 5 </since_tizen>
1107             public string CurrentText
1108             {
1109                 set
1110                 {
1111                     NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value);
1112                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1113                 }
1114                 get
1115                 {
1116                     string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr);
1117                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118                     return ret;
1119                 }
1120             }
1121
1122             /// <summary>
1123             /// The current cursor position.
1124             /// </summary>
1125             /// <since_tizen> 5 </since_tizen>
1126             public int CursorPosition
1127             {
1128                 set
1129                 {
1130                     NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value);
1131                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1132                 }
1133                 get
1134                 {
1135                     int ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr);
1136                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1137                     return ret;
1138                 }
1139             }
1140
1141             /// <summary>
1142             /// If the cursor position needs to be updated.
1143             /// </summary>
1144             /// <since_tizen> 5 </since_tizen>
1145             public bool Update
1146             {
1147                 set
1148                 {
1149                     NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value);
1150                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1151                 }
1152                 get
1153                 {
1154                     bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr);
1155                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1156                     return ret;
1157                 }
1158             }
1159
1160             /// <summary>
1161             /// Flags if the pre-edit reset is required.
1162             /// </summary>
1163             /// <since_tizen> 5 </since_tizen>
1164             public bool PreeditResetRequired
1165             {
1166                 set
1167                 {
1168                     NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value);
1169                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1170                 }
1171                 get
1172                 {
1173                     bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr);
1174                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1175                     return ret;
1176                 }
1177             }
1178
1179             /// <summary>
1180             /// The dispose pattern.
1181             /// </summary>
1182             /// <since_tizen> 5 </since_tizen>
1183             public void Dispose()
1184             {
1185                 //Throw excpetion if Dispose() is called in separate thread.
1186                 if (!Window.IsInstalled())
1187                 {
1188                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
1189                 }
1190
1191                 if (isDisposeQueued)
1192                 {
1193                     Dispose(DisposeTypes.Implicit);
1194                 }
1195                 else
1196                 {
1197                     Dispose(DisposeTypes.Explicit);
1198                     System.GC.SuppressFinalize(this);
1199                 }
1200             }
1201
1202             internal IntPtr GetCallbackDataPtr()
1203             {
1204                 return (IntPtr)swigCPtr;
1205             }
1206
1207             internal CallbackData(IntPtr cPtr, bool cMemoryOwn)
1208             {
1209                 swigCMemOwn = cMemoryOwn;
1210                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1211             }
1212
1213             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CallbackData obj)
1214             {
1215                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
1216             }
1217
1218             internal static CallbackData GetCallbackDataFromPtr(IntPtr cPtr)
1219             {
1220                 CallbackData ret = new CallbackData(cPtr, false);
1221                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1222                 return ret;
1223             }
1224
1225             /// <summary>
1226             /// Dispose.
1227             /// </summary>
1228             /// <since_tizen> 5 </since_tizen>
1229             protected virtual void Dispose(DisposeTypes type)
1230             {
1231                 if (disposed)
1232                 {
1233                     return;
1234                 }
1235
1236                 if (type == DisposeTypes.Explicit)
1237                 {
1238                     //Called by User.
1239                     //Release your own managed resources here.
1240                     //You should release all of your own disposable objects here.
1241
1242                 }
1243
1244                 //Release your own unmanaged resources here.
1245                 //You should not access any managed member here except static instance.
1246                 //Because the execution order of Finalizes is non-deterministic.
1247
1248                 if (swigCPtr.Handle != IntPtr.Zero)
1249                 {
1250                     if (swigCMemOwn)
1251                     {
1252                         swigCMemOwn = false;
1253                         NDalicManualPINVOKE.delete_InputMethodContext_CallbackData(swigCPtr);
1254                     }
1255                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
1256                 }
1257
1258                 disposed = true;
1259             }
1260         }
1261
1262         /// <summary>
1263         /// InputMethodContext activated event arguments.
1264         /// </summary>
1265         /// <since_tizen> 5 </since_tizen>
1266         public class ActivatedEventArgs : EventArgs
1267         {
1268             /// <summary>
1269             /// InputMethodContext
1270             /// </summary>
1271             /// <since_tizen> 5 </since_tizen>
1272             public InputMethodContext InputMethodContext
1273             {
1274                 get;
1275                 set;
1276             }
1277         }
1278
1279         /// <summary>
1280         /// InputMethodContext event receives event arguments.
1281         /// </summary>
1282         /// <since_tizen> 5 </since_tizen>
1283         public class EventReceivedEventArgs : EventArgs
1284         {
1285             /// <summary>
1286             /// InputMethodContext
1287             /// </summary>
1288             /// <since_tizen> 5 </since_tizen>
1289             public InputMethodContext InputMethodContext
1290             {
1291                 get;
1292                 set;
1293             }
1294
1295             /// <summary>
1296             /// EventData.
1297             /// </summary>
1298             /// <since_tizen> 5 </since_tizen>
1299             public EventData EventData
1300             {
1301                 get;
1302                 set;
1303             }
1304         }
1305
1306         /// <summary>
1307         /// InputMethodContext status changed event arguments.
1308         /// </summary>
1309         /// <since_tizen> 5 </since_tizen>
1310         public class StatusChangedEventArgs : EventArgs
1311         {
1312             /// <summary>
1313             /// InputMethodContext status.
1314             /// </summary>
1315             /// <since_tizen> 5 </since_tizen>
1316             public bool StatusChanged
1317             {
1318                 get;
1319                 set;
1320             }
1321         }
1322
1323         /// <summary>
1324         /// InputMethodContext resized event arguments.
1325         /// </summary>
1326         /// <since_tizen> 5 </since_tizen>
1327         public class ResizedEventArgs : EventArgs
1328         {
1329             /// <summary>
1330             /// resized.
1331             /// </summary>
1332             /// <since_tizen> 5 </since_tizen>
1333             public int Resized
1334             {
1335                 get;
1336                 set;
1337             }
1338         }
1339
1340         /// <summary>
1341         /// InputMethodContext language changed event arguments.
1342         /// </summary>
1343         /// <since_tizen> 5 </since_tizen>
1344         public class LanguageChangedEventArgs : EventArgs
1345         {
1346             /// <summary>
1347             /// Language changed.
1348             /// </summary>
1349             /// <since_tizen> 5 </since_tizen>
1350             public int LanguageChanged
1351             {
1352                 get;
1353                 set;
1354             }
1355         }
1356
1357         /// <summary>
1358         /// InputMethodContext keyboard type changed event arguments.
1359         /// </summary>
1360         /// <since_tizen> 5 </since_tizen>
1361         public class KeyboardTypeChangedEventArgs : EventArgs
1362         {
1363             /// <summary>
1364             /// InputMethodContext keyboard type.
1365             /// </summary>
1366             /// <since_tizen> 5 </since_tizen>
1367             public KeyboardType KeyboardType
1368             {
1369                 get;
1370                 set;
1371             }
1372         }
1373     }
1374 }