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