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