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