2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.Runtime.InteropServices;
20 using System.ComponentModel;
25 /// Specifically manages the input method framework which enables the virtual or hardware keyboards.
27 /// <since_tizen> 3 </since_tizen>
28 public class ImfManager : BaseHandle
30 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
32 internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ImfManager_SWIGUpcast(cPtr), cMemoryOwn)
34 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj)
39 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
42 private static readonly ImfManager instance = ImfManager.Get();
45 /// Gets the singleton of the ImfManager object.
47 /// <since_tizen> 5 </since_tizen>
48 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 public static ImfManager Instance
61 /// <param name="type">Dispose Type</param>
62 /// <since_tizen> 3 </since_tizen>
63 /// Please DO NOT use! This will be deprecated!
64 /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
65 /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
66 [Obsolete("Please do not use! This will be deprecated!")]
67 [EditorBrowsable(EditorBrowsableState.Never)]
68 protected override void Dispose(DisposeTypes type)
75 if (type == DisposeTypes.Explicit)
78 //Release your own managed resources here.
79 //You should release all of your own disposable objects here.
83 //Release your own unmanaged resources here.
84 //You should not access any managed member here except static instance.
85 //because the execution order of Finalizes is non-deterministic.
87 if (_keyboardTypeChangedEventCallback != null)
89 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
92 if (swigCPtr.Handle != global::System.IntPtr.Zero)
97 NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
99 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
106 /// This structure is used to pass on data from the IMF regarding predictive text.
108 /// <since_tizen> 3 </since_tizen>
109 public class ImfEventData : global::System.IDisposable
111 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
115 /// <since_tizen> 3 </since_tizen>
116 protected bool swigCMemOwn;
118 internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
120 swigCMemOwn = cMemoryOwn;
121 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
124 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
126 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
129 //A Flag to check who called Dispose(). (By User or DisposeQueue)
130 private bool isDisposeQueued = false;
132 /// A Flat to check if it is already disposed.
134 /// <since_tizen> 3 </since_tizen>
135 protected bool disposed = false;
140 /// <since_tizen> 3 </since_tizen>
143 if (!isDisposeQueued)
145 isDisposeQueued = true;
146 DisposeQueue.Instance.Add(this);
151 /// The dispose pattern.
153 /// <since_tizen> 3 </since_tizen>
154 public void Dispose()
156 //Throw excpetion if Dispose() is called in separate thread.
157 if (!Window.IsInstalled())
159 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
164 Dispose(DisposeTypes.Implicit);
168 Dispose(DisposeTypes.Explicit);
169 System.GC.SuppressFinalize(this);
176 /// <since_tizen> 3 </since_tizen>
177 protected virtual void Dispose(DisposeTypes type)
184 if (type == DisposeTypes.Explicit)
187 //Release your own managed resources here.
188 //You should release all of your own disposable objects here.
192 //Release your own unmanaged resources here.
193 //You should not access any managed member here except static instance.
194 //because the execution order of Finalizes is non-deterministic.
196 if (swigCPtr.Handle != IntPtr.Zero)
201 NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
203 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
209 internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
211 ImfEventData ret = new ImfEventData(cPtr, false);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 /// The default constructor.
219 /// <since_tizen> 3 </since_tizen>
220 public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 /// <param name="aEventName">The name of the event from the IMF.</param>
229 /// <param name="aPredictiveString">The pre-edit or the commit string.</param>
230 /// <param name="aCursorOffset">Start the position from the current cursor position to start deleting characters.</param>
231 /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
232 /// <since_tizen> 3 </since_tizen>
233 public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 /// The pre-edit or the commit string.
241 /// <since_tizen> 4 </since_tizen>
242 public string PredictiveString
246 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 /// The name of the event from the IMF.
260 /// <since_tizen> 4 </since_tizen>
261 public ImfManager.ImfEvent EventName
265 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 /// The start position from the current cursor position to start deleting characters.
279 /// <since_tizen> 4 </since_tizen>
280 public int CursorOffset
284 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
296 /// The number of characters to delete from the cursorOffset.
298 /// <since_tizen> 4 </since_tizen>
299 public int NumberOfChars
303 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
317 /// Data required by the IMF from the callback.
319 /// <since_tizen> 3 </since_tizen>
320 public class ImfCallbackData : global::System.IDisposable
322 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
326 /// <since_tizen> 3 </since_tizen>
327 protected bool swigCMemOwn;
329 internal IntPtr GetImfCallbackDataPtr()
331 return (IntPtr)swigCPtr;
334 internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
336 swigCMemOwn = cMemoryOwn;
337 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
340 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
342 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
345 //A Flag to check who called Dispose(). (By User or DisposeQueue)
346 private bool isDisposeQueued = false;
348 /// A Flat to check if it is already disposed.
350 /// <since_tizen> 3 </since_tizen>
351 protected bool disposed = false;
357 /// <since_tizen> 3 </since_tizen>
360 if (!isDisposeQueued)
362 isDisposeQueued = true;
363 DisposeQueue.Instance.Add(this);
368 /// The dispose pattern.
370 /// <since_tizen> 3 </since_tizen>
371 public void Dispose()
373 //Throw excpetion if Dispose() is called in separate thread.
374 if (!Window.IsInstalled())
376 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
381 Dispose(DisposeTypes.Implicit);
385 Dispose(DisposeTypes.Explicit);
386 System.GC.SuppressFinalize(this);
393 /// <since_tizen> 3 </since_tizen>
394 protected virtual void Dispose(DisposeTypes type)
401 if (type == DisposeTypes.Explicit)
404 //Release your own managed resources here.
405 //You should release all of your own disposable objects here.
409 //Release your own unmanaged resources here.
410 //You should not access any managed member here except static instance.
411 //because the execution order of Finalizes is non-deterministic.
413 if (swigCPtr.Handle != IntPtr.Zero)
418 NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
420 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
426 internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
428 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
429 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 /// The default constructor.
436 /// <since_tizen> 3 </since_tizen>
437 public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
445 /// <param name="aUpdate">True if the cursor position needs to be updated.</param>
446 /// <param name="aCursorPosition">The new position of the cursor.</param>
447 /// <param name="aCurrentText">The current text string.</param>
448 /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
449 /// <since_tizen> 3 </since_tizen>
450 public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
452 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
456 /// The current text string.
458 /// <since_tizen> 4 </since_tizen>
459 public string CurrentText
463 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
464 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
468 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
475 /// The current text string.
477 /// <since_tizen> 4 </since_tizen>
478 public int CursorPosition
482 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
483 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
487 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 /// If the cursor position needs to be updated.
496 /// <since_tizen> 4 </since_tizen>
501 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
506 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
507 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
513 /// Flags if preedit reset is required.
515 /// <since_tizen> 4 </since_tizen>
516 public bool PreeditResetRequired
520 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
521 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 /// Destroy the context of the IMF.<br/>
536 /// <since_tizen> 5 </since_tizen>
537 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
538 [EditorBrowsable(EditorBrowsableState.Never)]
539 public void DestroyContext()
541 NDalicManualPINVOKE.ImfManager_Finalize(swigCPtr);
542 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
546 /// Destroy the context of the IMF.<br/>
548 /// <since_tizen> 4 </since_tizen>
549 /// Please do not use! This will be deprecated, instead please USE Tizen.NUI.ImfManager.Instance.DestroyContext()!
550 [Obsolete("Please do not use! This will be deprecated! Please use ImfManager.Instance.DestroyContext() instead!")]
551 [EditorBrowsable(EditorBrowsableState.Never)]
552 public void Finalize()
558 /// Retrieves a handle to the instance of the ImfManager.
560 /// <returns>A handle to the ImfManager.</returns>
561 /// <since_tizen> 3 </since_tizen>
562 public static ImfManager Get()
564 ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
565 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
570 /// Activates the IMF.<br/>
571 /// It means that the text editing is started somewhere.<br/>
572 /// If the hardware keyboard isn't connected, then it will show the virtual keyboard.
574 /// <since_tizen> 3 </since_tizen>
575 public void Activate()
577 NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
578 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582 /// Deactivates the IMF.<br/>
583 /// It means that the text editing is finished somewhere.
585 /// <since_tizen> 3 </since_tizen>
586 public void Deactivate()
588 NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
589 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593 /// Gets the restoration status which controls if the keyboard is restored after the focus is lost and then regained.<br/>
594 /// If true, then the keyboard will be restored (activated) after focus is regained.
596 /// <returns>The restoration status.</returns>
597 /// <since_tizen> 3 </since_tizen>
598 public bool RestoreAfterFocusLost()
600 bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606 /// Sets the status whether the IMF has to restore the keyboard after losing focus.
608 /// <param name="toggle">True means that keyboard should be restored after the focus is lost and regained.</param>
609 /// <since_tizen> 3 </since_tizen>
610 public void SetRestoreAfterFocusLost(bool toggle)
612 NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
613 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617 /// Sends a message reset to the preedit state or the IMF module.
619 /// <since_tizen> 3 </since_tizen>
620 public new void Reset()
622 NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
623 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627 /// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization.
629 /// <since_tizen> 3 </since_tizen>
630 public void NotifyCursorPosition()
632 NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
633 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
637 /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
639 /// <param name="cursorPosition">The position of the cursor.</param>
640 /// <since_tizen> 3 </since_tizen>
641 public void SetCursorPosition(uint cursorPosition)
643 NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
644 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648 /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
650 /// <returns>The current position of the cursor.</returns>
651 /// <since_tizen> 3 </since_tizen>
652 public uint GetCursorPosition()
654 uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
655 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
660 /// A method to store the string required by the IMF, this is used to provide predictive word suggestions.
662 /// <param name="text">The text string surrounding the current cursor point.</param>
663 /// <since_tizen> 3 </since_tizen>
664 public void SetSurroundingText(string text)
666 NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
667 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671 /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.
673 /// <returns>The surrounding text.</returns>
674 /// <since_tizen> 3 </since_tizen>
675 public string GetSurroundingText()
677 string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
678 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
683 /// Notifies the IMF context that text input is set to multiline or not.
685 /// <param name="multiLine">True if multiline text input is used.</param>
686 /// <since_tizen> 3 </since_tizen>
687 public void NotifyTextInputMultiLine(bool multiLine)
689 NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
690 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
694 /// Returns the text direction of the keyboard's current input language.
696 /// <returns>The direction of the text.</returns>
697 /// <since_tizen> 3 </since_tizen>
698 public ImfManager.TextDirection GetTextDirection()
700 ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
701 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706 /// Provides the size and the position of the keyboard.<br/>
707 /// The position is relative to whether the keyboard is visible or not.<br/>
708 /// If the keyboard is not visible, then the position will be off the screen.<br/>
709 /// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/>
710 /// the values then taken down. So ideally, GetInputMethodArea() should be called after Show().
712 /// <returns>Rectangle which is keyboard panel x, y, width, height.</returns>
713 /// <since_tizen> 3 </since_tizen>
714 public Rectangle GetInputMethodArea()
716 Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
717 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
721 internal void ApplyOptions(InputMethodOptions options)
723 NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
724 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
728 /// Sets up the input-panel specific data.
730 /// <param name="text">The specific data to be set to the input panel.</param>
731 /// <since_tizen> 3 </since_tizen>
732 public void SetInputPanelUserData(string text)
734 NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
735 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
739 /// Gets the specific data of the current active input panel.
741 /// <param name="text">The specific data to be received from the input panel.</param>
742 /// <since_tizen> 4 </since_tizen>
743 public void GetInputPanelUserData(out string text)
745 NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
746 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
750 /// Gets the state of the current active input panel.
752 /// <returns>The state of the input panel.</returns>
753 /// <since_tizen> 3 </since_tizen>
754 public ImfManager.State GetInputPanelState()
756 ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
757 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
762 /// Sets the return key on the input panel to be visible or invisible.<br/>
763 /// The default is true.
765 /// <param name="visible">True if the return key is visible (enabled), false otherwise.</param>
766 /// <since_tizen> 3 </since_tizen>
767 public void SetReturnKeyState(bool visible)
769 NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
770 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
774 /// Enables to show the input panel automatically when focused.
776 /// <param name="enabled">If true, the input panel will be shown when focused.</param>
777 /// <since_tizen> 3 </since_tizen>
778 public void AutoEnableInputPanel(bool enabled)
780 NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
781 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785 /// Shows the input panel.
787 /// <since_tizen> 3 </since_tizen>
788 public void ShowInputPanel()
790 NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
791 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
795 /// Hides the input panel.
797 /// <since_tizen> 3 </since_tizen>
798 public void HideInputPanel()
800 NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
801 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
805 /// Gets the keyboard type.<br/>
806 /// The default keyboard type is SoftwareKeyboard.
808 /// <returns>The keyboard type.</returns>
809 /// <since_tizen> 4 </since_tizen>
810 public ImfManager.KeyboardType GetKeyboardType()
812 ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
813 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
818 /// Gets the current language locale of the input panel.<br/>
819 /// For example, en_US, en_GB, en_PH, fr_FR, ...
821 /// <returns>The current language locale of the input panel.</returns>
822 /// <since_tizen> 4 </since_tizen>
823 public string GetInputPanelLocale()
825 string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
826 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833 /// <since_tizen> 3 </since_tizen>
834 public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
836 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840 /// ImfManager activated event arguments.
842 /// <since_tizen> 4 </since_tizen>
843 public class ActivatedEventArgs : EventArgs
848 /// <since_tizen> 4 </since_tizen>
849 public ImfManager ImfManager
856 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
857 private delegate void ActivatedEventCallbackType(IntPtr data);
858 private ActivatedEventCallbackType _activatedEventCallback;
859 private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
862 /// ImfManager activated.
864 /// <since_tizen> 4 </since_tizen>
865 public event EventHandler<ActivatedEventArgs> Activated
869 if (_activatedEventHandler == null)
871 _activatedEventCallback = OnActivated;
872 ActivatedSignal().Connect(_activatedEventCallback);
875 _activatedEventHandler += value;
879 _activatedEventHandler -= value;
881 if (_activatedEventHandler == null && _activatedEventCallback != null)
883 ActivatedSignal().Disconnect(_activatedEventCallback);
888 private void OnActivated(IntPtr data)
890 ActivatedEventArgs e = new ActivatedEventArgs();
894 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
897 if (_activatedEventHandler != null)
899 _activatedEventHandler(this, e);
903 internal ActivatedSignalType ActivatedSignal()
905 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
906 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
911 /// ImfManager event received event arguments.
913 /// <since_tizen> 4 </since_tizen>
914 public class EventReceivedEventArgs : EventArgs
919 /// <since_tizen> 4 </since_tizen>
920 public ImfManager ImfManager
929 /// <since_tizen> 4 </since_tizen>
930 public ImfEventData ImfEventData
937 private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
938 private EventReceivedEventCallbackType _eventReceivedEventCallback;
939 private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
942 /// ImfManager event received.
944 /// <since_tizen> 4 </since_tizen>
945 public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
949 if (_eventReceivedEventHandler == null)
951 _eventReceivedEventCallback = OnEventReceived;
952 EventReceivedSignal().Connect(_eventReceivedEventCallback);
955 _eventReceivedEventHandler += value;
959 _eventReceivedEventHandler -= value;
961 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
963 EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
968 private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
970 ImfCallbackData imfCallbackData = null;
972 EventReceivedEventArgs e = new EventReceivedEventArgs();
974 if (imfManager != null)
976 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
978 if (imfEventData != null)
980 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
983 if (_eventReceivedEventHandler != null)
985 imfCallbackData = _eventReceivedEventHandler(this, e);
987 if (imfCallbackData != null)
989 return imfCallbackData.GetImfCallbackDataPtr();
993 return new ImfCallbackData().GetImfCallbackDataPtr();
997 internal ImfEventSignalType EventReceivedSignal()
999 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
1000 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1005 /// ImfManager status changed event arguments.
1007 /// <since_tizen> 4 </since_tizen>
1008 public class StatusChangedEventArgs : EventArgs
1011 /// ImfManager status
1013 /// <since_tizen> 4 </since_tizen>
1014 public bool StatusChanged
1021 private delegate void StatusChangedEventCallbackType(bool statusChanged);
1022 private StatusChangedEventCallbackType _statusChangedEventCallback;
1023 private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1026 /// ImfManager status changed.
1028 /// <since_tizen> 4 </since_tizen>
1029 public event EventHandler<StatusChangedEventArgs> StatusChanged
1033 if (_statusChangedEventHandler == null)
1035 _statusChangedEventCallback = OnStatusChanged;
1036 StatusChangedSignal().Connect(_statusChangedEventCallback);
1039 _statusChangedEventHandler += value;
1043 _statusChangedEventHandler -= value;
1045 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1047 StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1052 private void OnStatusChanged(bool statusChanged)
1054 StatusChangedEventArgs e = new StatusChangedEventArgs();
1056 e.StatusChanged = statusChanged;
1058 if (_statusChangedEventHandler != null)
1060 _statusChangedEventHandler(this, e);
1064 internal StatusSignalType StatusChangedSignal()
1066 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
1067 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072 /// ImfManager resized event.
1074 /// <since_tizen> 4 </since_tizen>
1075 public class ResizedEventArgs : EventArgs
1080 /// <since_tizen> 4 </since_tizen>
1088 private delegate void ResizedEventCallbackType(int resized);
1089 private ResizedEventCallbackType _resizedEventCallback;
1090 private event EventHandler<ResizedEventArgs> _resizedEventHandler;
1093 /// ImfManager resized.
1095 /// <since_tizen> 4 </since_tizen>
1096 public event EventHandler<ResizedEventArgs> Resized
1100 if (_resizedEventHandler == null)
1102 _resizedEventCallback = OnResized;
1103 ResizedSignal().Connect(_resizedEventCallback);
1106 _resizedEventHandler += value;
1110 _resizedEventHandler -= value;
1112 if (_resizedEventHandler == null && _resizedEventCallback != null)
1114 ResizedSignal().Disconnect(_resizedEventCallback);
1119 private void OnResized(int resized)
1121 ResizedEventArgs e = new ResizedEventArgs();
1122 e.Resized = resized;
1124 if (_resizedEventHandler != null)
1126 _resizedEventHandler(this, e);
1130 internal KeyboardResizedSignalType ResizedSignal()
1132 KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), false);
1133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1138 /// ImfManager language changed event args.
1140 /// <since_tizen> 4 </since_tizen>
1141 public class LanguageChangedEventArgs : EventArgs
1144 /// language changed.
1146 /// <since_tizen> 4 </since_tizen>
1147 public int LanguageChanged
1154 private delegate void LanguageChangedEventCallbackType(int languageChanged);
1155 private LanguageChangedEventCallbackType _languageChangedEventCallback;
1156 private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
1159 /// ImfManager language changed.
1161 /// <since_tizen> 4 </since_tizen>
1162 public event EventHandler<LanguageChangedEventArgs> LanguageChanged
1166 if (_languageChangedEventHandler == null)
1168 _languageChangedEventCallback = OnLanguageChanged;
1169 LanguageChangedSignal().Connect(_languageChangedEventCallback);
1172 _languageChangedEventHandler += value;
1176 _languageChangedEventHandler -= value;
1178 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1180 LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1185 private void OnLanguageChanged(int languageChanged)
1187 LanguageChangedEventArgs e = new LanguageChangedEventArgs();
1188 e.LanguageChanged = languageChanged;
1190 if (_languageChangedEventHandler != null)
1192 _languageChangedEventHandler(this, e);
1196 internal LanguageChangedSignalType LanguageChangedSignal()
1198 LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), false);
1199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1204 /// ImfManager keyboard type changed event arguments.
1206 /// <since_tizen> 4 </since_tizen>
1207 public class KeyboardTypeChangedEventArgs : EventArgs
1210 /// ImfManager keyboard type
1212 /// <since_tizen> 4 </since_tizen>
1213 public KeyboardType KeyboardType
1220 private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1221 private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1222 private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1225 /// ImfManager keyboard type changed.
1227 /// <since_tizen> 4 </since_tizen>
1228 public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1232 if (_keyboardTypeChangedEventHandler == null)
1234 _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1235 KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1238 _keyboardTypeChangedEventHandler += value;
1242 _keyboardTypeChangedEventHandler -= value;
1244 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1246 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1251 private void OnKeyboardTypeChanged(KeyboardType type)
1253 KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1255 e.KeyboardType = type;
1257 if (_keyboardTypeChangedEventHandler != null)
1259 _keyboardTypeChangedEventHandler(this, e);
1263 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1265 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1271 /// The direction of the text.
1273 /// <since_tizen> 3 </since_tizen>
1274 public enum TextDirection
1287 /// Events that are generated by the IMF.
1289 /// <since_tizen> 3 </since_tizen>
1290 public enum ImfEvent
1295 /// <since_tizen> 4 </since_tizen>
1298 /// Pre-Edit changed.
1300 /// <since_tizen> 4 </since_tizen>
1303 /// Commit received.
1305 /// <since_tizen> 4 </since_tizen>
1308 /// An event to delete a range of characters from the string.
1310 /// <since_tizen> 4 </since_tizen>
1313 /// An event to query string and the cursor position.
1315 /// <since_tizen> 4 </since_tizen>
1318 /// Private command sent from the input panel.
1320 /// <since_tizen> 4 </since_tizen>
1325 /// Enumeration for the state of the input panel.
1327 /// <since_tizen> 3 </since_tizen>
1333 /// <since_tizen> 4 </since_tizen>
1336 /// Input panel is shown.
1338 /// <since_tizen> 4 </since_tizen>
1341 /// Input panel is hidden.
1343 /// <since_tizen> 4 </since_tizen>
1346 /// Input panel in process of being shown.
1348 /// <since_tizen> 4 </since_tizen>
1353 /// Enumeration for the types of keyboard.
1355 /// <since_tizen> 4 </since_tizen>
1356 public enum KeyboardType
1359 /// Software keyboard (virtual keyboard) is default.
1361 /// <since_tizen> 4 </since_tizen>
1364 /// Hardware keyboard.
1366 /// <since_tizen> 4 </since_tizen>