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