[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / InputMethodContext.cs
1 /*
2  * Copyright(c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System;
19 using System.Runtime.InteropServices;
20 using System.ComponentModel;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// Specifically manages the input method framework (IMF) that enables the virtual or hardware keyboards.
26     /// </summary>
27     /// <since_tizen> 5 </since_tizen>
28     public class InputMethodContext : BaseHandle
29     {
30         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31
32         private ActivatedEventCallbackType _activatedEventCallback;
33         private EventReceivedEventCallbackType _eventReceivedEventCallback;
34         private StatusChangedEventCallbackType _statusChangedEventCallback;
35         private ResizedEventCallbackType _resizedEventCallback;
36         private LanguageChangedEventCallbackType _languageChangedEventCallback;
37         private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
38         private ContentReceivedCallbackType _contentReceivedEventCallback;
39
40         /// <summary>
41         /// Constructor.<br/>
42         /// </summary>
43         /// <since_tizen> 5 </since_tizen>
44         public InputMethodContext() : this(Interop.InputMethodContext.InputMethodContext_New(), true)
45         {
46             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47
48         }
49
50         internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(Interop.InputMethodContext.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn)
51         {
52             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
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         /// Gets or sets whether the IM context allows to use the text prediction.
364         /// </summary>
365         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
366         [EditorBrowsable(EditorBrowsableState.Never)]
367         public bool TextPrediction
368         {
369             get
370             {
371                 return IsTextPredictionAllowed();
372             }
373             set
374             {
375                 AllowTextPrediction(value);
376             }
377         }
378
379         /// <summary>
380         /// Destroys the context of the IMF.<br/>
381         /// </summary>
382         /// <since_tizen> 5 </since_tizen>
383         public void DestroyContext()
384         {
385             Interop.InputMethodContext.InputMethodContext_Finalize(swigCPtr);
386             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387         }
388
389         /// <summary>
390         /// Activates the IMF.<br/>
391         /// It means that the text editing has started.<br/>
392         /// If the hardware keyboard is not connected, then it shows the virtual keyboard.
393         /// </summary>
394         /// <since_tizen> 5 </since_tizen>
395         public void Activate()
396         {
397             Interop.InputMethodContext.InputMethodContext_Activate(swigCPtr);
398             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399         }
400
401         /// <summary>
402         /// Deactivates the IMF.<br/>
403         /// It means that the text editing is complete.
404         /// </summary>
405         /// <since_tizen> 5 </since_tizen>
406         public void Deactivate()
407         {
408             Interop.InputMethodContext.InputMethodContext_Deactivate(swigCPtr);
409             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410         }
411
412         /// <summary>
413         /// Gets the restoration status, which controls if the keyboard is restored after the focus is lost and then regained.<br/>
414         /// If true, then the keyboard will be restored (activated) after the focus is regained.
415         /// </summary>
416         /// <returns>The restoration status.</returns>
417         /// <since_tizen> 5 </since_tizen>
418         public bool RestoreAfterFocusLost()
419         {
420             bool ret = Interop.InputMethodContext.InputMethodContext_RestoreAfterFocusLost(swigCPtr);
421             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422             return ret;
423         }
424
425         /// <summary>
426         /// Sets the status whether the IMF has to restore the keyboard after losing focus.
427         /// </summary>
428         /// <param name="toggle">True means that keyboard must be restored after the focus is lost and regained.</param>
429         /// <since_tizen> 5 </since_tizen>
430         public void SetRestoreAfterFocusLost(bool toggle)
431         {
432             Interop.InputMethodContext.InputMethodContext_SetRestoreAfterFocusLost(swigCPtr, toggle);
433             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434         }
435
436         /// <summary>
437         /// Sends a message reset to the pre-edit state or the IMF module.
438         /// </summary>
439         /// <since_tizen> 5 </since_tizen>
440         public new void Reset()
441         {
442             Interop.InputMethodContext.InputMethodContext_Reset(swigCPtr);
443             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444         }
445
446         /// <summary>
447         /// Notifies the IMF context that the cursor position has changed, required for features such as auto-capitalization.
448         /// </summary>
449         /// <since_tizen> 5 </since_tizen>
450         public void NotifyCursorPosition()
451         {
452             Interop.InputMethodContext.InputMethodContext_NotifyCursorPosition(swigCPtr);
453             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454         }
455
456         /// <summary>
457         /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
458         /// </summary>
459         /// <param name="cursorPosition">The position of the cursor.</param>
460         /// <since_tizen> 5 </since_tizen>
461         public void SetCursorPosition(uint cursorPosition)
462         {
463             Interop.InputMethodContext.InputMethodContext_SetCursorPosition(swigCPtr, cursorPosition);
464             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465         }
466
467         /// <summary>
468         /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
469         /// </summary>
470         /// <returns>The current position of the cursor.</returns>
471         /// <since_tizen> 5 </since_tizen>
472         public uint GetCursorPosition()
473         {
474             uint ret = Interop.InputMethodContext.InputMethodContext_GetCursorPosition(swigCPtr);
475             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476             return ret;
477         }
478
479         /// <summary>
480         /// A method to store the string required by the IMF, this is used to provide predictive word suggestions.
481         /// </summary>
482         /// <param name="text">The text string surrounding the current cursor point.</param>
483         /// <since_tizen> 5 </since_tizen>
484         public void SetSurroundingText(string text)
485         {
486             Interop.InputMethodContext.InputMethodContext_SetSurroundingText(swigCPtr, text);
487             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
488         }
489
490         /// <summary>
491         /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.
492         /// </summary>
493         /// <returns>The surrounding text.</returns>
494         /// <since_tizen> 5 </since_tizen>
495         public string GetSurroundingText()
496         {
497             string ret = Interop.InputMethodContext.InputMethodContext_GetSurroundingText(swigCPtr);
498             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499             return ret;
500         }
501
502         /// <summary>
503         /// Notifies the IMF context that text input is set to multiline or not.
504         /// </summary>
505         /// <param name="multiLine">True if multiline text input is used.</param>
506         /// <since_tizen> 5 </since_tizen>
507         public void NotifyTextInputMultiLine(bool multiLine)
508         {
509             Interop.InputMethodContext.InputMethodContext_NotifyTextInputMultiLine(swigCPtr, multiLine);
510             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511         }
512
513         /// <summary>
514         /// Returns the text direction of the current input language of the keyboard.
515         /// </summary>
516         /// <returns>The direction of the text.</returns>
517         /// <since_tizen> 5 </since_tizen>
518         public InputMethodContext.TextDirection GetTextDirection()
519         {
520             InputMethodContext.TextDirection ret = (InputMethodContext.TextDirection)Interop.InputMethodContext.InputMethodContext_GetTextDirection(swigCPtr);
521             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522             return ret;
523         }
524
525         /// <summary>
526         /// Provides the size and the position of the keyboard.<br/>
527         /// The position is relative to whether the keyboard is visible or not.<br/>
528         /// If the keyboard is not visible, then the position will be off the screen.<br/>
529         /// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/>
530         /// the values then taken down. So ideally, GetInputMethodArea() must be called after Show().
531         /// </summary>
532         /// <returns>Rectangle which is keyboard panel x, y, width, and height.</returns>
533         /// <since_tizen> 5 </since_tizen>
534         public Rectangle GetInputMethodArea()
535         {
536             Rectangle ret = new Rectangle(Interop.InputMethodContext.InputMethodContext_GetInputMethodArea(swigCPtr), true);
537             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538             return ret;
539         }
540
541         /// <summary>
542         /// Sets up the input panel specific data.
543         /// </summary>
544         /// <param name="text">The specific data to be set to the input panel.</param>
545         /// <since_tizen> 5 </since_tizen>
546         public void SetInputPanelUserData(string text)
547         {
548             Interop.InputMethodContext.InputMethodContext_SetInputPanelUserData(swigCPtr, text);
549             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
550         }
551
552         /// <summary>
553         /// Gets the specific data of the current active input panel.
554         /// </summary>
555         /// <param name="text">The specific data to be received from the input panel.</param>
556         /// <since_tizen> 5 </since_tizen>
557         public void GetInputPanelUserData(out string text)
558         {
559             Interop.InputMethodContext.InputMethodContext_GetInputPanelUserData(swigCPtr, out text);
560             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561         }
562
563         /// <summary>
564         /// Gets the state of the current active input panel.
565         /// </summary>
566         /// <returns>The state of the input panel.</returns>
567         /// <since_tizen> 5 </since_tizen>
568         public InputMethodContext.State GetInputPanelState()
569         {
570             InputMethodContext.State ret = (InputMethodContext.State)Interop.InputMethodContext.InputMethodContext_GetInputPanelState(swigCPtr);
571             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572             return ret;
573         }
574
575         /// <summary>
576         /// Sets the return key on the input panel to be visible or invisible.<br/>
577         /// The default value is true.
578         /// </summary>
579         /// <param name="visible">True if the return key is visible (enabled), false otherwise.</param>
580         /// <since_tizen> 5 </since_tizen>
581         public void SetReturnKeyState(bool visible)
582         {
583             Interop.InputMethodContext.InputMethodContext_SetReturnKeyState(swigCPtr, visible);
584             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585         }
586
587         /// <summary>
588         /// Enables to show the input panel automatically when focused.
589         /// </summary>
590         /// <param name="enabled">If true, the input panel will be shown when focused.</param>
591         /// <since_tizen> 5 </since_tizen>
592         public void AutoEnableInputPanel(bool enabled)
593         {
594             Interop.InputMethodContext.InputMethodContext_AutoEnableInputPanel(swigCPtr, enabled);
595             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
596         }
597
598         /// <summary>
599         /// Shows the input panel.
600         /// </summary>
601         /// <since_tizen> 5 </since_tizen>
602         public void ShowInputPanel()
603         {
604             Interop.InputMethodContext.InputMethodContext_ShowInputPanel(swigCPtr);
605             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606         }
607
608         /// <summary>
609         /// Hides the input panel.
610         /// </summary>
611         /// <since_tizen> 5 </since_tizen>
612         public void HideInputPanel()
613         {
614             Interop.InputMethodContext.InputMethodContext_HideInputPanel(swigCPtr);
615             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
616         }
617
618         /// <summary>
619         /// Gets the keyboard type.<br/>
620         /// The default keyboard type is SoftwareKeyboard.
621         /// </summary>
622         /// <returns>The keyboard type.</returns>
623         /// <since_tizen> 5 </since_tizen>
624         public InputMethodContext.KeyboardType GetKeyboardType()
625         {
626             InputMethodContext.KeyboardType ret = (InputMethodContext.KeyboardType)Interop.InputMethodContext.InputMethodContext_GetKeyboardType(swigCPtr);
627             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
628             return ret;
629         }
630
631         /// <summary>
632         /// Gets the current language locale of the input panel.<br/>
633         /// For example, en_US, en_GB, en_PH, fr_FR, and so on.
634         /// </summary>
635         /// <returns>The current language locale of the input panel.</returns>
636         /// <since_tizen> 5 </since_tizen>
637         public string GetInputPanelLocale()
638         {
639             string ret = Interop.InputMethodContext.InputMethodContext_GetInputPanelLocale(swigCPtr);
640             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641             return ret;
642         }
643
644         /// <summary>
645         /// Sets the allowed MIME Type to deliver to the input panel. <br/>
646         /// For example, string mimeType = "text/plain,image/png,image/gif,application/pdf";
647         /// </summary>
648         /// <param name="mimeType">The allowed MIME type.</param>
649         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
650         [EditorBrowsable(EditorBrowsableState.Never)]
651         public void SetMIMEType(string mimeType)
652         {
653             Interop.InputMethodContext.InputMethodContext_SetMIMEType(swigCPtr, mimeType);
654             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
655         }
656
657         /// <summary>
658         /// Sets the x,y coordinates of the input panel.
659         /// </summary>
660         /// <param name="x">The top-left x coordinate of the input panel.</param>
661         /// <param name="y">The top-left y coordinate of the input panel.</param>
662         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
663         [EditorBrowsable(EditorBrowsableState.Never)]
664         public void SetInputPanelPosition(uint x, uint y)
665         {
666             Interop.InputMethodContext.InputMethodContext_SetInputPanelPosition(swigCPtr, x, y);
667             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
668         }
669
670         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(InputMethodContext obj)
671         {
672             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
673         }
674
675         internal InputMethodContext(InputMethodContext inputMethodContext) : this(Interop.InputMethodContext.new_InputMethodContext__SWIG_1(InputMethodContext.getCPtr(inputMethodContext)), true)
676         {
677             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
678         }
679
680         internal InputMethodContext Assign(InputMethodContext inputMethodContext)
681         {
682             InputMethodContext ret = new InputMethodContext(Interop.InputMethodContext.InputMethodContext_Assign(swigCPtr, InputMethodContext.getCPtr(inputMethodContext)), false);
683             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684             return ret;
685         }
686
687         internal static InputMethodContext DownCast(BaseHandle handle)
688         {
689             InputMethodContext ret = new InputMethodContext(Interop.InputMethodContext.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true);
690             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691             return ret;
692         }
693
694         internal void ApplyOptions(InputMethodOptions options)
695         {
696             Interop.InputMethodContext.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
697             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698         }
699
700         internal void AllowTextPrediction(bool prediction)
701         {
702             Interop.InputMethodContext.InputMethodContext_AllowTextPrediction(swigCPtr, prediction);
703             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
704         }
705
706         internal bool IsTextPredictionAllowed()
707         {
708             bool ret = Interop.InputMethodContext.InputMethodContext_IsTextPredictionAllowed(swigCPtr);
709             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710             return ret;
711         }
712
713         internal ActivatedSignalType ActivatedSignal()
714         {
715             ActivatedSignalType ret = new ActivatedSignalType(Interop.InputMethodContext.InputMethodContext_ActivatedSignal(swigCPtr), false);
716             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
717             return ret;
718         }
719
720         internal KeyboardEventSignalType EventReceivedSignal()
721         {
722             KeyboardEventSignalType ret = new KeyboardEventSignalType(Interop.InputMethodContext.InputMethodContext_EventReceivedSignal(swigCPtr), false);
723             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
724             return ret;
725         }
726
727         internal StatusSignalType StatusChangedSignal()
728         {
729             StatusSignalType ret = new StatusSignalType(Interop.InputMethodContext.InputMethodContext_StatusChangedSignal(swigCPtr), false);
730             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
731             return ret;
732         }
733
734         internal KeyboardResizedSignalType ResizedSignal()
735         {
736             KeyboardResizedSignalType ret = new KeyboardResizedSignalType(Interop.InputMethodContext.InputMethodContext_ResizedSignal(swigCPtr), false);
737             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
738             return ret;
739         }
740
741         internal LanguageChangedSignalType LanguageChangedSignal()
742         {
743             LanguageChangedSignalType ret = new LanguageChangedSignalType(Interop.InputMethodContext.InputMethodContext_LanguageChangedSignal(swigCPtr), false);
744             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745             return ret;
746         }
747
748         internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
749         {
750             KeyboardTypeSignalType ret = new KeyboardTypeSignalType(Interop.InputMethodContext.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false);
751             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
752             return ret;
753         }
754
755         internal ContentReceivedSignalType ContentReceivedSignal()
756         {
757             ContentReceivedSignalType ret = new ContentReceivedSignalType(Interop.InputMethodContext.InputMethodContext_ContentReceivedSignal(swigCPtr), false);
758             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
759             return ret;
760         }
761
762         /// <summary>
763         /// You can override it to clean-up your own resources.
764         /// </summary>
765         /// <param name="type">Dispose Type</param>
766         /// <since_tizen> 5 </since_tizen>
767         /// Please do not use! This will be deprecated!
768         /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, InputMethodContext, TtsPlayer, Window) is not required.
769         [EditorBrowsable(EditorBrowsableState.Never)]
770         protected override void Dispose(DisposeTypes type)
771         {
772             if (disposed)
773             {
774                 return;
775             }
776
777             //Release your own unmanaged resources here.
778             //You should not access any managed member here except static instance
779             //because the execution order of Finalizes is non-deterministic.
780
781             if (_keyboardTypeChangedEventCallback != null)
782             {
783                 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
784             }
785
786             if (swigCPtr.Handle != global::System.IntPtr.Zero)
787             {
788                 if (swigCMemOwn)
789                 {
790                     swigCMemOwn = false;
791                     Interop.InputMethodContext.delete_InputMethodContext(swigCPtr);
792                 }
793                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
794             }
795
796             base.Dispose(type);
797         }
798
799         private void OnActivated(IntPtr data)
800         {
801             ActivatedEventArgs e = new ActivatedEventArgs();
802
803             if (data != null)
804             {
805                 e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(data) as InputMethodContext;
806             }
807
808             if (_activatedEventHandler != null)
809             {
810                 _activatedEventHandler(this, e);
811             }
812         }
813
814         private IntPtr OnEventReceived(IntPtr inputMethodContext, IntPtr eventData)
815         {
816             CallbackData callbackData = null;
817
818             EventReceivedEventArgs e = new EventReceivedEventArgs();
819
820             if (inputMethodContext != null)
821             {
822                 e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(inputMethodContext) as InputMethodContext;
823             }
824             if (eventData != null)
825             {
826                 e.EventData = EventData.GetEventDataFromPtr(eventData);
827             }
828
829             if (_eventReceivedEventHandler != null)
830             {
831                 callbackData = _eventReceivedEventHandler(this, e);
832             }
833             if (callbackData != null)
834             {
835                 return callbackData.GetCallbackDataPtr();
836             }
837             else
838             {
839                 return new CallbackData().GetCallbackDataPtr();
840             }
841         }
842
843         private void OnStatusChanged(bool statusChanged)
844         {
845             StatusChangedEventArgs e = new StatusChangedEventArgs();
846
847             e.StatusChanged = statusChanged;
848
849             if (_statusChangedEventHandler != null)
850             {
851                 _statusChangedEventHandler(this, e);
852             }
853         }
854
855         private void OnResized(int resized)
856         {
857             ResizedEventArgs e = new ResizedEventArgs();
858             e.Resized = resized;
859
860             if (_resizedEventHandler != null)
861             {
862                 _resizedEventHandler(this, e);
863             }
864         }
865
866         private void OnLanguageChanged(int languageChanged)
867         {
868             LanguageChangedEventArgs e = new LanguageChangedEventArgs();
869             e.LanguageChanged = languageChanged;
870
871             if (_languageChangedEventHandler != null)
872             {
873                 _languageChangedEventHandler(this, e);
874             }
875         }
876
877         private void OnKeyboardTypeChanged(KeyboardType type)
878         {
879             KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
880
881             e.KeyboardType = type;
882
883             if (_keyboardTypeChangedEventHandler != null)
884             {
885                 _keyboardTypeChangedEventHandler(this, e);
886             }
887         }
888
889         private void OnContentReceived(string content, string description, string mimeType)
890         {
891             ContentReceivedEventArgs e = new ContentReceivedEventArgs();
892             e.Content = content;
893             e.Description = description;
894             e.MimeType = mimeType;
895
896             if (_contentReceivedEventHandler != null)
897             {
898                 _contentReceivedEventHandler(this, e);
899             }
900         }
901
902         /// <summary>
903         /// This structure is used to pass on data from the IMF regarding predictive text.
904         /// </summary>
905         /// <since_tizen> 5 </since_tizen>
906         public class EventData : global::System.IDisposable
907         {
908             /// <summary>
909             /// The state if it owns memory
910             /// </summary>
911             /// <since_tizen> 5 </since_tizen>
912             protected bool swigCMemOwn;
913
914             /// <summary>
915             /// A flag to check if it is already disposed.
916             /// </summary>
917             /// <since_tizen> 5 </since_tizen>
918             protected bool disposed = false;
919
920             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
921
922             //A flag to check who called Dispose(). (By User or DisposeQueue)
923             private bool isDisposeQueued = false;
924
925             /// <summary>
926             /// The default constructor.
927             /// </summary>
928             /// <since_tizen> 5 </since_tizen>
929             public EventData() : this(Interop.InputMethodContext.new_InputMethodContext_EventData__SWIG_0(), true)
930             {
931                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
932             }
933
934             /// <summary>
935             /// The constructor.
936             /// </summary>
937             /// <param name="aEventName">The name of the event from the IMF.</param>
938             /// <param name="aPredictiveString">The pre-edit or the commit string.</param>
939             /// <param name="aCursorOffset">Start the position from the current cursor position to start deleting characters.</param>
940             /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
941             /// <since_tizen> 5 </since_tizen>
942             public EventData(InputMethodContext.EventType aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(Interop.InputMethodContext.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
943             {
944                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
945             }
946
947             internal EventData(IntPtr cPtr, bool cMemoryOwn)
948             {
949                 swigCMemOwn = cMemoryOwn;
950                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
951             }
952
953             /// <summary>
954             /// Releases the resource.
955             /// </summary>
956             /// <since_tizen> 5 </since_tizen>
957             ~EventData()
958             {
959                 if (!isDisposeQueued)
960                 {
961                     isDisposeQueued = true;
962                     DisposeQueue.Instance.Add(this);
963                 }
964             }
965
966             /// <summary>
967             /// The pre-edit or the commit string.
968             /// </summary>
969             /// <since_tizen> 5 </since_tizen>
970             public string PredictiveString
971             {
972                 set
973                 {
974                     Interop.InputMethodContext.InputMethodContext_EventData_predictiveString_set(swigCPtr, value);
975                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
976                 }
977                 get
978                 {
979                     string ret = Interop.InputMethodContext.InputMethodContext_EventData_predictiveString_get(swigCPtr);
980                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
981                     return ret;
982                 }
983             }
984
985             /// <summary>
986             /// The name of the event from the IMF.
987             /// </summary>
988             /// <since_tizen> 5 </since_tizen>
989             public InputMethodContext.EventType EventName
990             {
991                 set
992                 {
993                     Interop.InputMethodContext.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value);
994                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
995                 }
996                 get
997                 {
998                     InputMethodContext.EventType ret = (InputMethodContext.EventType)Interop.InputMethodContext.InputMethodContext_EventData_eventName_get(swigCPtr);
999                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1000                     return ret;
1001                 }
1002             }
1003
1004             /// <summary>
1005             /// The start position from the current cursor position to start deleting characters.
1006             /// </summary>
1007             /// <since_tizen> 5 </since_tizen>
1008             public int CursorOffset
1009             {
1010                 set
1011                 {
1012                     Interop.InputMethodContext.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value);
1013                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1014                 }
1015                 get
1016                 {
1017                     int ret = Interop.InputMethodContext.InputMethodContext_EventData_cursorOffset_get(swigCPtr);
1018                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1019                     return ret;
1020                 }
1021             }
1022
1023             /// <summary>
1024             /// The number of characters to delete from the cursorOffset.
1025             /// </summary>
1026             /// <since_tizen> 5 </since_tizen>
1027             public int NumberOfChars
1028             {
1029                 set
1030                 {
1031                     Interop.InputMethodContext.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value);
1032                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1033                 }
1034                 get
1035                 {
1036                     int ret = Interop.InputMethodContext.InputMethodContext_EventData_numberOfChars_get(swigCPtr);
1037                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1038                     return ret;
1039                 }
1040             }
1041
1042             /// <summary>
1043             /// The dispose pattern.
1044             /// </summary>
1045             /// <since_tizen> 5 </since_tizen>
1046             public void Dispose()
1047             {
1048                 //Throw excpetion if Dispose() is called in separate thread.
1049                 if (!Window.IsInstalled())
1050                 {
1051                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
1052                 }
1053
1054                 if (isDisposeQueued)
1055                 {
1056                     Dispose(DisposeTypes.Implicit);
1057                 }
1058                 else
1059                 {
1060                     Dispose(DisposeTypes.Explicit);
1061                     System.GC.SuppressFinalize(this);
1062                 }
1063             }
1064
1065             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventData obj)
1066             {
1067                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
1068             }
1069
1070             internal static EventData GetEventDataFromPtr(IntPtr cPtr)
1071             {
1072                 EventData ret = new EventData(cPtr, false);
1073                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1074                 return ret;
1075             }
1076
1077             /// <summary>
1078             /// You can override it to clean-up your own resources.
1079             /// </summary>
1080             /// <since_tizen> 5 </since_tizen>
1081             protected virtual void Dispose(DisposeTypes type)
1082             {
1083                 if (disposed)
1084                 {
1085                     return;
1086                 }
1087
1088                 if (type == DisposeTypes.Explicit)
1089                 {
1090                     //Called by User.
1091                     //Release your own managed resources here.
1092                     //You should release all of your own disposable objects here.
1093
1094                 }
1095
1096                 //Release your own unmanaged resources here.
1097                 //You should not access any managed member here except static instance.
1098                 //because the execution order of Finalizes is non-deterministic.
1099
1100                 if (swigCPtr.Handle != IntPtr.Zero)
1101                 {
1102                     if (swigCMemOwn)
1103                     {
1104                         swigCMemOwn = false;
1105                         Interop.InputMethodContext.delete_InputMethodContext_EventData(swigCPtr);
1106                     }
1107                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
1108                 }
1109
1110                 disposed = true;
1111             }
1112         }
1113
1114         /// <summary>
1115         /// Data required by the IMF from the callback.
1116         /// </summary>
1117         /// <since_tizen> 5 </since_tizen>
1118         public class CallbackData : global::System.IDisposable
1119         {
1120             /// <summary>
1121             /// The state if it owns memory
1122             /// </summary>
1123             /// <since_tizen> 5 </since_tizen>
1124             protected bool swigCMemOwn;
1125
1126             /// <summary>
1127             /// A Flag to check if it is already disposed.
1128             /// </summary>
1129             /// <since_tizen> 5 </since_tizen>
1130             protected bool disposed = false;
1131
1132             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
1133
1134             //A flag to check who called Dispose(). (By User or DisposeQueue)
1135             private bool isDisposeQueued = false;
1136
1137             /// <summary>
1138             /// The default constructor.
1139             /// </summary>
1140             /// <since_tizen> 5 </since_tizen>
1141             public CallbackData() : this(Interop.InputMethodContext.new_InputMethodContext_CallbackData__SWIG_0(), true)
1142             {
1143                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1144             }
1145
1146             /// <summary>
1147             /// The constructor.
1148             /// </summary>
1149             /// <param name="aUpdate">True if the cursor position needs to be updated.</param>
1150             /// <param name="aCursorPosition">The new position of the cursor.</param>
1151             /// <param name="aCurrentText">The current text string.</param>
1152             /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
1153             /// <since_tizen> 5 </since_tizen>
1154             public CallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(Interop.InputMethodContext.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
1155             {
1156                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1157             }
1158
1159             /// <summary>
1160             /// Releases the resource.
1161             /// </summary>
1162             /// <since_tizen> 5 </since_tizen>
1163             ~CallbackData()
1164             {
1165                 if (!isDisposeQueued)
1166                 {
1167                     isDisposeQueued = true;
1168                     DisposeQueue.Instance.Add(this);
1169                 }
1170             }
1171
1172             /// <summary>
1173             /// The current text string.
1174             /// </summary>
1175             /// <since_tizen> 5 </since_tizen>
1176             public string CurrentText
1177             {
1178                 set
1179                 {
1180                     Interop.InputMethodContext.InputMethodContext_CallbackData_currentText_set(swigCPtr, value);
1181                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1182                 }
1183                 get
1184                 {
1185                     string ret = Interop.InputMethodContext.InputMethodContext_CallbackData_currentText_get(swigCPtr);
1186                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1187                     return ret;
1188                 }
1189             }
1190
1191             /// <summary>
1192             /// The current cursor position.
1193             /// </summary>
1194             /// <since_tizen> 5 </since_tizen>
1195             public int CursorPosition
1196             {
1197                 set
1198                 {
1199                     Interop.InputMethodContext.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value);
1200                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1201                 }
1202                 get
1203                 {
1204                     int ret = Interop.InputMethodContext.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr);
1205                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1206                     return ret;
1207                 }
1208             }
1209
1210             /// <summary>
1211             /// The state if the cursor position needs to be updated.
1212             /// </summary>
1213             /// <since_tizen> 5 </since_tizen>
1214             public bool Update
1215             {
1216                 set
1217                 {
1218                     Interop.InputMethodContext.InputMethodContext_CallbackData_update_set(swigCPtr, value);
1219                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1220                 }
1221                 get
1222                 {
1223                     bool ret = Interop.InputMethodContext.InputMethodContext_CallbackData_update_get(swigCPtr);
1224                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1225                     return ret;
1226                 }
1227             }
1228
1229             /// <summary>
1230             /// Flags if the pre-edit reset is required.
1231             /// </summary>
1232             /// <since_tizen> 5 </since_tizen>
1233             public bool PreeditResetRequired
1234             {
1235                 set
1236                 {
1237                     Interop.InputMethodContext.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value);
1238                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1239                 }
1240                 get
1241                 {
1242                     bool ret = Interop.InputMethodContext.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr);
1243                     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1244                     return ret;
1245                 }
1246             }
1247
1248             /// <summary>
1249             /// The dispose pattern.
1250             /// </summary>
1251             /// <since_tizen> 5 </since_tizen>
1252             public void Dispose()
1253             {
1254                 //Throw excpetion if Dispose() is called in separate thread.
1255                 if (!Window.IsInstalled())
1256                 {
1257                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
1258                 }
1259
1260                 if (isDisposeQueued)
1261                 {
1262                     Dispose(DisposeTypes.Implicit);
1263                 }
1264                 else
1265                 {
1266                     Dispose(DisposeTypes.Explicit);
1267                     System.GC.SuppressFinalize(this);
1268                 }
1269             }
1270
1271             internal IntPtr GetCallbackDataPtr()
1272             {
1273                 return (IntPtr)swigCPtr;
1274             }
1275
1276             internal CallbackData(IntPtr cPtr, bool cMemoryOwn)
1277             {
1278                 swigCMemOwn = cMemoryOwn;
1279                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1280             }
1281
1282             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CallbackData obj)
1283             {
1284                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
1285             }
1286
1287             internal static CallbackData GetCallbackDataFromPtr(IntPtr cPtr)
1288             {
1289                 CallbackData ret = new CallbackData(cPtr, false);
1290                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1291                 return ret;
1292             }
1293
1294             /// <summary>
1295             /// You can override it to clean-up your own resources.
1296             /// </summary>
1297             /// <since_tizen> 5 </since_tizen>
1298             protected virtual void Dispose(DisposeTypes type)
1299             {
1300                 if (disposed)
1301                 {
1302                     return;
1303                 }
1304
1305                 if (type == DisposeTypes.Explicit)
1306                 {
1307                     //Called by User.
1308                     //Release your own managed resources here.
1309                     //You should release all of your own disposable objects here.
1310
1311                 }
1312
1313                 //Release your own unmanaged resources here.
1314                 //You should not access any managed member here except static instance.
1315                 //Because the execution order of Finalizes is non-deterministic.
1316
1317                 if (swigCPtr.Handle != IntPtr.Zero)
1318                 {
1319                     if (swigCMemOwn)
1320                     {
1321                         swigCMemOwn = false;
1322                         Interop.InputMethodContext.delete_InputMethodContext_CallbackData(swigCPtr);
1323                     }
1324                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
1325                 }
1326
1327                 disposed = true;
1328             }
1329         }
1330
1331         /// <summary>
1332         /// InputMethodContext activated event arguments.
1333         /// </summary>
1334         /// <since_tizen> 5 </since_tizen>
1335         public class ActivatedEventArgs : EventArgs
1336         {
1337             /// <summary>
1338             /// The instance of InputMethodContext
1339             /// </summary>
1340             /// <since_tizen> 5 </since_tizen>
1341             public InputMethodContext InputMethodContext
1342             {
1343                 get;
1344                 set;
1345             }
1346         }
1347
1348         /// <summary>
1349         /// InputMethodContext event receives event arguments.
1350         /// </summary>
1351         /// <since_tizen> 5 </since_tizen>
1352         public class EventReceivedEventArgs : EventArgs
1353         {
1354             /// <summary>
1355             /// The instance of InputMethodContext
1356             /// </summary>
1357             /// <since_tizen> 5 </since_tizen>
1358             public InputMethodContext InputMethodContext
1359             {
1360                 get;
1361                 set;
1362             }
1363
1364             /// <summary>
1365             /// The event data of IMF
1366             /// </summary>
1367             /// <since_tizen> 5 </since_tizen>
1368             public EventData EventData
1369             {
1370                 get;
1371                 set;
1372             }
1373         }
1374
1375         /// <summary>
1376         /// InputMethodContext status changed event arguments.
1377         /// </summary>
1378         /// <since_tizen> 5 </since_tizen>
1379         public class StatusChangedEventArgs : EventArgs
1380         {
1381             /// <summary>
1382             /// InputMethodContext status.
1383             /// </summary>
1384             /// <since_tizen> 5 </since_tizen>
1385             public bool StatusChanged
1386             {
1387                 get;
1388                 set;
1389             }
1390         }
1391
1392         /// <summary>
1393         /// InputMethodContext resized event arguments.
1394         /// </summary>
1395         /// <since_tizen> 5 </since_tizen>
1396         public class ResizedEventArgs : EventArgs
1397         {
1398             /// <summary>
1399             /// The state if the IMF resized.
1400             /// </summary>
1401             /// <since_tizen> 5 </since_tizen>
1402             public int Resized
1403             {
1404                 get;
1405                 set;
1406             }
1407         }
1408
1409         /// <summary>
1410         /// InputMethodContext language changed event arguments.
1411         /// </summary>
1412         /// <since_tizen> 5 </since_tizen>
1413         public class LanguageChangedEventArgs : EventArgs
1414         {
1415             /// <summary>
1416             /// Language changed.
1417             /// </summary>
1418             /// <since_tizen> 5 </since_tizen>
1419             public int LanguageChanged
1420             {
1421                 get;
1422                 set;
1423             }
1424         }
1425
1426         /// <summary>
1427         /// InputMethodContext keyboard type changed event arguments.
1428         /// </summary>
1429         /// <since_tizen> 5 </since_tizen>
1430         public class KeyboardTypeChangedEventArgs : EventArgs
1431         {
1432             /// <summary>
1433             /// InputMethodContext keyboard type.
1434             /// </summary>
1435             /// <since_tizen> 5 </since_tizen>
1436             public KeyboardType KeyboardType
1437             {
1438                 get;
1439                 set;
1440             }
1441         }
1442
1443         /// <summary>
1444         /// InputMethodContext content received event arguments.
1445         /// </summary>
1446         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1447         [EditorBrowsable(EditorBrowsableState.Never)]
1448         public class ContentReceivedEventArgs : EventArgs
1449         {
1450             /// <summary>
1451             /// The content, such as images, of input method
1452             /// </summary>
1453             /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1454             [EditorBrowsable(EditorBrowsableState.Never)]
1455             public string Content
1456             {
1457                 get;
1458                 set;
1459             }
1460             /// <summary>
1461             /// The description of content
1462             /// </summary>
1463             /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1464             [EditorBrowsable(EditorBrowsableState.Never)]
1465             public string Description
1466             {
1467                 get;
1468                 set;
1469             }
1470             /// <summary>
1471             /// The mime type of content, such as jpg, png, and so on
1472             /// </summary>
1473             /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1474             [EditorBrowsable(EditorBrowsableState.Never)]
1475             public string MimeType
1476             {
1477                 get;
1478                 set;
1479             }
1480         }
1481     }
1482 }