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 public static ImfManager Instance
59 /// <param name="type">Dispose Type</param>
60 /// <since_tizen> 3 </since_tizen>
61 /// Please DO NOT use! This will be deprecated!
62 /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
63 /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
64 [Obsolete("Please do not use! This will be deprecated!")]
65 [EditorBrowsable(EditorBrowsableState.Never)]
66 protected override void Dispose(DisposeTypes type)
73 if (type == DisposeTypes.Explicit)
76 //Release your own managed resources here.
77 //You should release all of your own disposable objects here.
81 //Release your own unmanaged resources here.
82 //You should not access any managed member here except static instance.
83 //because the execution order of Finalizes is non-deterministic.
85 if (_keyboardTypeChangedEventCallback != null)
87 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
90 if (swigCPtr.Handle != global::System.IntPtr.Zero)
95 NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
97 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
104 /// This structure is used to pass on data from the IMF regarding predictive text.
106 /// <since_tizen> 3 </since_tizen>
107 public class ImfEventData : global::System.IDisposable
109 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
113 /// <since_tizen> 3 </since_tizen>
114 protected bool swigCMemOwn;
116 internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
118 swigCMemOwn = cMemoryOwn;
119 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
122 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
124 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
127 //A Flag to check who called Dispose(). (By User or DisposeQueue)
128 private bool isDisposeQueued = false;
130 /// A Flat to check if it is already disposed.
132 /// <since_tizen> 3 </since_tizen>
133 protected bool disposed = false;
138 /// <since_tizen> 3 </since_tizen>
141 if (!isDisposeQueued)
143 isDisposeQueued = true;
144 DisposeQueue.Instance.Add(this);
149 /// The dispose pattern.
151 /// <since_tizen> 3 </since_tizen>
152 public void Dispose()
154 //Throw excpetion if Dispose() is called in separate thread.
155 if (!Window.IsInstalled())
157 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
162 Dispose(DisposeTypes.Implicit);
166 Dispose(DisposeTypes.Explicit);
167 System.GC.SuppressFinalize(this);
174 /// <since_tizen> 3 </since_tizen>
175 protected virtual void Dispose(DisposeTypes type)
182 if (type == DisposeTypes.Explicit)
185 //Release your own managed resources here.
186 //You should release all of your own disposable objects here.
190 //Release your own unmanaged resources here.
191 //You should not access any managed member here except static instance.
192 //because the execution order of Finalizes is non-deterministic.
194 if (swigCPtr.Handle != IntPtr.Zero)
199 NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
201 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
207 internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
209 ImfEventData ret = new ImfEventData(cPtr, false);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 /// The default constructor.
217 /// <since_tizen> 3 </since_tizen>
218 public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 /// <param name="aEventName">The name of the event from the IMF.</param>
227 /// <param name="aPredictiveString">The pre-edit or the commit string.</param>
228 /// <param name="aCursorOffset">Start the position from the current cursor position to start deleting characters.</param>
229 /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
230 /// <since_tizen> 3 </since_tizen>
231 public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237 /// The pre-edit or the commit string.
239 /// <since_tizen> 4 </since_tizen>
240 public string PredictiveString
244 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256 /// The name of the event from the IMF.
258 /// <since_tizen> 4 </since_tizen>
259 public ImfManager.ImfEvent EventName
263 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 /// The start position from the current cursor position to start deleting characters.
277 /// <since_tizen> 4 </since_tizen>
278 public int CursorOffset
282 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 /// The number of characters to delete from the cursorOffset.
296 /// <since_tizen> 4 </since_tizen>
297 public int NumberOfChars
301 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
302 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
307 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 /// Data required by the IMF from the callback.
317 /// <since_tizen> 3 </since_tizen>
318 public class ImfCallbackData : global::System.IDisposable
320 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
324 /// <since_tizen> 3 </since_tizen>
325 protected bool swigCMemOwn;
327 internal IntPtr GetImfCallbackDataPtr()
329 return (IntPtr)swigCPtr;
332 internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
334 swigCMemOwn = cMemoryOwn;
335 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
338 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
340 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
343 //A Flag to check who called Dispose(). (By User or DisposeQueue)
344 private bool isDisposeQueued = false;
346 /// A Flat to check if it is already disposed.
348 /// <since_tizen> 3 </since_tizen>
349 protected bool disposed = false;
355 /// <since_tizen> 3 </since_tizen>
358 if (!isDisposeQueued)
360 isDisposeQueued = true;
361 DisposeQueue.Instance.Add(this);
366 /// The dispose pattern.
368 /// <since_tizen> 3 </since_tizen>
369 public void Dispose()
371 //Throw excpetion if Dispose() is called in separate thread.
372 if (!Window.IsInstalled())
374 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
379 Dispose(DisposeTypes.Implicit);
383 Dispose(DisposeTypes.Explicit);
384 System.GC.SuppressFinalize(this);
391 /// <since_tizen> 3 </since_tizen>
392 protected virtual void Dispose(DisposeTypes type)
399 if (type == DisposeTypes.Explicit)
402 //Release your own managed resources here.
403 //You should release all of your own disposable objects here.
407 //Release your own unmanaged resources here.
408 //You should not access any managed member here except static instance.
409 //because the execution order of Finalizes is non-deterministic.
411 if (swigCPtr.Handle != IntPtr.Zero)
416 NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
418 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
424 internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
426 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
432 /// The default constructor.
434 /// <since_tizen> 3 </since_tizen>
435 public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
443 /// <param name="aUpdate">True if the cursor position needs to be updated.</param>
444 /// <param name="aCursorPosition">The new position of the cursor.</param>
445 /// <param name="aCurrentText">The current text string.</param>
446 /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
447 /// <since_tizen> 3 </since_tizen>
448 public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
450 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 /// The current text string.
456 /// <since_tizen> 4 </since_tizen>
457 public string CurrentText
461 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
462 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
467 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473 /// The current text string.
475 /// <since_tizen> 4 </since_tizen>
476 public int CursorPosition
480 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
481 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
486 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492 /// If the cursor position needs to be updated.
494 /// <since_tizen> 4 </since_tizen>
499 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
500 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
505 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511 /// Flags if preedit reset is required.
513 /// <since_tizen> 4 </since_tizen>
514 public bool PreeditResetRequired
518 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
532 /// Destroy the context of the IMF.<br/>
534 /// <since_tizen> 5 </since_tizen>
535 public void DestroyContext()
537 NDalicManualPINVOKE.ImfManager_Finalize(swigCPtr);
538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542 /// Destroy the context of the IMF.<br/>
544 /// <since_tizen> 4 </since_tizen>
545 /// Please do not use! This will be deprecated, instead please USE Tizen.NUI.ImfManager.Instance.DestroyContext()!
546 [Obsolete("Please do not use! This will be deprecated! Please use ImfManager.Instance.DestroyContext() instead!")]
547 [EditorBrowsable(EditorBrowsableState.Never)]
548 public void Finalize()
554 /// Retrieves a handle to the instance of the ImfManager.
556 /// <returns>A handle to the ImfManager.</returns>
557 /// <since_tizen> 3 </since_tizen>
558 public static ImfManager Get()
560 ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
561 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 /// Activates the IMF.<br/>
567 /// It means that the text editing is started somewhere.<br/>
568 /// If the hardware keyboard isn't connected, then it will show the virtual keyboard.
570 /// <since_tizen> 3 </since_tizen>
571 public void Activate()
573 NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578 /// Deactivates the IMF.<br/>
579 /// It means that the text editing is finished somewhere.
581 /// <since_tizen> 3 </since_tizen>
582 public void Deactivate()
584 NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
585 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589 /// Gets the restoration status which controls if the keyboard is restored after the focus is lost and then regained.<br/>
590 /// If true, then the keyboard will be restored (activated) after focus is regained.
592 /// <returns>The restoration status.</returns>
593 /// <since_tizen> 3 </since_tizen>
594 public bool RestoreAfterFocusLost()
596 bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
597 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 /// Sets the status whether the IMF has to restore the keyboard after losing focus.
604 /// <param name="toggle">True means that keyboard should be restored after the focus is lost and regained.</param>
605 /// <since_tizen> 3 </since_tizen>
606 public void SetRestoreAfterFocusLost(bool toggle)
608 NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 /// Sends a message reset to the preedit state or the IMF module.
615 /// <since_tizen> 3 </since_tizen>
616 public new void Reset()
618 NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
619 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 /// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization.
625 /// <since_tizen> 3 </since_tizen>
626 public void NotifyCursorPosition()
628 NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
629 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633 /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
635 /// <param name="cursorPosition">The position of the cursor.</param>
636 /// <since_tizen> 3 </since_tizen>
637 public void SetCursorPosition(uint cursorPosition)
639 NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
640 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
644 /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
646 /// <returns>The current position of the cursor.</returns>
647 /// <since_tizen> 3 </since_tizen>
648 public uint GetCursorPosition()
650 uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
656 /// A method to store the string required by the IMF, this is used to provide predictive word suggestions.
658 /// <param name="text">The text string surrounding the current cursor point.</param>
659 /// <since_tizen> 3 </since_tizen>
660 public void SetSurroundingText(string text)
662 NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
663 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.
669 /// <returns>The surrounding text.</returns>
670 /// <since_tizen> 3 </since_tizen>
671 public string GetSurroundingText()
673 string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
674 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679 /// Notifies the IMF context that text input is set to multiline or not.
681 /// <param name="multiLine">True if multiline text input is used.</param>
682 /// <since_tizen> 3 </since_tizen>
683 public void NotifyTextInputMultiLine(bool multiLine)
685 NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690 /// Returns the text direction of the keyboard's current input language.
692 /// <returns>The direction of the text.</returns>
693 /// <since_tizen> 3 </since_tizen>
694 public ImfManager.TextDirection GetTextDirection()
696 ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
697 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702 /// Provides the size and the position of the keyboard.<br/>
703 /// The position is relative to whether the keyboard is visible or not.<br/>
704 /// If the keyboard is not visible, then the position will be off the screen.<br/>
705 /// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/>
706 /// the values then taken down. So ideally, GetInputMethodArea() should be called after Show().
708 /// <returns>Rectangle which is keyboard panel x, y, width, height.</returns>
709 /// <since_tizen> 3 </since_tizen>
710 public Rectangle GetInputMethodArea()
712 Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
717 internal void ApplyOptions(InputMethodOptions options)
719 NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
720 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
724 /// Sets up the input-panel specific data.
726 /// <param name="text">The specific data to be set to the input panel.</param>
727 /// <since_tizen> 3 </since_tizen>
728 public void SetInputPanelUserData(string text)
730 NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
731 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735 /// Gets the specific data of the current active input panel.
737 /// <param name="text">The specific data to be received from the input panel.</param>
738 /// <since_tizen> 4 </since_tizen>
739 public void GetInputPanelUserData(out string text)
741 NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 /// Gets the state of the current active input panel.
748 /// <returns>The state of the input panel.</returns>
749 /// <since_tizen> 3 </since_tizen>
750 public ImfManager.State GetInputPanelState()
752 ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
758 /// Sets the return key on the input panel to be visible or invisible.<br/>
759 /// The default is true.
761 /// <param name="visible">True if the return key is visible (enabled), false otherwise.</param>
762 /// <since_tizen> 3 </since_tizen>
763 public void SetReturnKeyState(bool visible)
765 NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
766 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
770 /// Enables to show the input panel automatically when focused.
772 /// <param name="enabled">If true, the input panel will be shown when focused.</param>
773 /// <since_tizen> 3 </since_tizen>
774 public void AutoEnableInputPanel(bool enabled)
776 NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 /// Shows the input panel.
783 /// <since_tizen> 3 </since_tizen>
784 public void ShowInputPanel()
786 NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
787 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
791 /// Hides the input panel.
793 /// <since_tizen> 3 </since_tizen>
794 public void HideInputPanel()
796 NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
797 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801 /// Gets the keyboard type.<br/>
802 /// The default keyboard type is SoftwareKeyboard.
804 /// <returns>The keyboard type.</returns>
805 /// <since_tizen> 4 </since_tizen>
806 public ImfManager.KeyboardType GetKeyboardType()
808 ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
809 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
814 /// Gets the current language locale of the input panel.<br/>
815 /// For example, en_US, en_GB, en_PH, fr_FR, ...
817 /// <returns>The current language locale of the input panel.</returns>
818 /// <since_tizen> 4 </since_tizen>
819 public string GetInputPanelLocale()
821 string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
822 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
829 /// <since_tizen> 3 </since_tizen>
830 public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
836 /// ImfManager activated event arguments.
838 /// <since_tizen> 4 </since_tizen>
839 public class ActivatedEventArgs : EventArgs
844 /// <since_tizen> 4 </since_tizen>
845 public ImfManager ImfManager
852 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
853 private delegate void ActivatedEventCallbackType(IntPtr data);
854 private ActivatedEventCallbackType _activatedEventCallback;
855 private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
858 /// ImfManager activated.
860 /// <since_tizen> 4 </since_tizen>
861 public event EventHandler<ActivatedEventArgs> Activated
865 if (_activatedEventHandler == null)
867 _activatedEventCallback = OnActivated;
868 ActivatedSignal().Connect(_activatedEventCallback);
871 _activatedEventHandler += value;
875 _activatedEventHandler -= value;
877 if (_activatedEventHandler == null && _activatedEventCallback != null)
879 ActivatedSignal().Disconnect(_activatedEventCallback);
884 private void OnActivated(IntPtr data)
886 ActivatedEventArgs e = new ActivatedEventArgs();
890 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
893 if (_activatedEventHandler != null)
895 _activatedEventHandler(this, e);
899 internal ActivatedSignalType ActivatedSignal()
901 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
902 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907 /// ImfManager event received event arguments.
909 /// <since_tizen> 4 </since_tizen>
910 public class EventReceivedEventArgs : EventArgs
915 /// <since_tizen> 4 </since_tizen>
916 public ImfManager ImfManager
925 /// <since_tizen> 4 </since_tizen>
926 public ImfEventData ImfEventData
933 private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
934 private EventReceivedEventCallbackType _eventReceivedEventCallback;
935 private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
938 /// ImfManager event received.
940 /// <since_tizen> 4 </since_tizen>
941 public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
945 if (_eventReceivedEventHandler == null)
947 _eventReceivedEventCallback = OnEventReceived;
948 EventReceivedSignal().Connect(_eventReceivedEventCallback);
951 _eventReceivedEventHandler += value;
955 _eventReceivedEventHandler -= value;
957 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
959 EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
964 private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
966 ImfCallbackData imfCallbackData = null;
968 EventReceivedEventArgs e = new EventReceivedEventArgs();
970 if (imfManager != null)
972 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
974 if (imfEventData != null)
976 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
979 if (_eventReceivedEventHandler != null)
981 imfCallbackData = _eventReceivedEventHandler(this, e);
983 if (imfCallbackData != null)
985 return imfCallbackData.GetImfCallbackDataPtr();
989 return new ImfCallbackData().GetImfCallbackDataPtr();
993 internal ImfEventSignalType EventReceivedSignal()
995 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
996 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1001 /// ImfManager status changed event arguments.
1003 /// <since_tizen> 4 </since_tizen>
1004 public class StatusChangedEventArgs : EventArgs
1007 /// ImfManager status
1009 /// <since_tizen> 4 </since_tizen>
1010 public bool StatusChanged
1017 private delegate void StatusChangedEventCallbackType(bool statusChanged);
1018 private StatusChangedEventCallbackType _statusChangedEventCallback;
1019 private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1022 /// ImfManager status changed.
1024 /// <since_tizen> 4 </since_tizen>
1025 public event EventHandler<StatusChangedEventArgs> StatusChanged
1029 if (_statusChangedEventHandler == null)
1031 _statusChangedEventCallback = OnStatusChanged;
1032 StatusChangedSignal().Connect(_statusChangedEventCallback);
1035 _statusChangedEventHandler += value;
1039 _statusChangedEventHandler -= value;
1041 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1043 StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1048 private void OnStatusChanged(bool statusChanged)
1050 StatusChangedEventArgs e = new StatusChangedEventArgs();
1052 e.StatusChanged = statusChanged;
1054 if (_statusChangedEventHandler != null)
1056 _statusChangedEventHandler(this, e);
1060 internal StatusSignalType StatusChangedSignal()
1062 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
1063 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1068 /// ImfManager resized event.
1070 /// <since_tizen> 4 </since_tizen>
1071 public class ResizedEventArgs : EventArgs
1076 /// <since_tizen> 4 </since_tizen>
1084 private delegate void ResizedEventCallbackType(int resized);
1085 private ResizedEventCallbackType _resizedEventCallback;
1086 private event EventHandler<ResizedEventArgs> _resizedEventHandler;
1089 /// ImfManager resized.
1091 /// <since_tizen> 4 </since_tizen>
1092 public event EventHandler<ResizedEventArgs> Resized
1096 if (_resizedEventHandler == null)
1098 _resizedEventCallback = OnResized;
1099 ResizedSignal().Connect(_resizedEventCallback);
1102 _resizedEventHandler += value;
1106 _resizedEventHandler -= value;
1108 if (_resizedEventHandler == null && _resizedEventCallback != null)
1110 ResizedSignal().Disconnect(_resizedEventCallback);
1115 private void OnResized(int resized)
1117 ResizedEventArgs e = new ResizedEventArgs();
1118 e.Resized = resized;
1120 if (_resizedEventHandler != null)
1122 _resizedEventHandler(this, e);
1126 internal KeyboardResizedSignalType ResizedSignal()
1128 KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), false);
1129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1134 /// ImfManager language changed event args.
1136 /// <since_tizen> 4 </since_tizen>
1137 public class LanguageChangedEventArgs : EventArgs
1140 /// language changed.
1142 /// <since_tizen> 4 </since_tizen>
1143 public int LanguageChanged
1150 private delegate void LanguageChangedEventCallbackType(int languageChanged);
1151 private LanguageChangedEventCallbackType _languageChangedEventCallback;
1152 private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
1155 /// ImfManager language changed.
1157 /// <since_tizen> 4 </since_tizen>
1158 public event EventHandler<LanguageChangedEventArgs> LanguageChanged
1162 if (_languageChangedEventHandler == null)
1164 _languageChangedEventCallback = OnLanguageChanged;
1165 LanguageChangedSignal().Connect(_languageChangedEventCallback);
1168 _languageChangedEventHandler += value;
1172 _languageChangedEventHandler -= value;
1174 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1176 LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1181 private void OnLanguageChanged(int languageChanged)
1183 LanguageChangedEventArgs e = new LanguageChangedEventArgs();
1184 e.LanguageChanged = languageChanged;
1186 if (_languageChangedEventHandler != null)
1188 _languageChangedEventHandler(this, e);
1192 internal LanguageChangedSignalType LanguageChangedSignal()
1194 LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), false);
1195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1200 /// ImfManager keyboard type changed event arguments.
1202 /// <since_tizen> 4 </since_tizen>
1203 public class KeyboardTypeChangedEventArgs : EventArgs
1206 /// ImfManager keyboard type
1208 /// <since_tizen> 4 </since_tizen>
1209 public KeyboardType KeyboardType
1216 private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1217 private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1218 private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1221 /// ImfManager keyboard type changed.
1223 /// <since_tizen> 4 </since_tizen>
1224 public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1228 if (_keyboardTypeChangedEventHandler == null)
1230 _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1231 KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1234 _keyboardTypeChangedEventHandler += value;
1238 _keyboardTypeChangedEventHandler -= value;
1240 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1242 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1247 private void OnKeyboardTypeChanged(KeyboardType type)
1249 KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1251 e.KeyboardType = type;
1253 if (_keyboardTypeChangedEventHandler != null)
1255 _keyboardTypeChangedEventHandler(this, e);
1259 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1261 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1267 /// The direction of the text.
1269 /// <since_tizen> 3 </since_tizen>
1270 public enum TextDirection
1283 /// Events that are generated by the IMF.
1285 /// <since_tizen> 3 </since_tizen>
1286 public enum ImfEvent
1291 /// <since_tizen> 4 </since_tizen>
1294 /// Pre-Edit changed.
1296 /// <since_tizen> 4 </since_tizen>
1299 /// Commit received.
1301 /// <since_tizen> 4 </since_tizen>
1304 /// An event to delete a range of characters from the string.
1306 /// <since_tizen> 4 </since_tizen>
1309 /// An event to query string and the cursor position.
1311 /// <since_tizen> 4 </since_tizen>
1314 /// Private command sent from the input panel.
1316 /// <since_tizen> 4 </since_tizen>
1321 /// Enumeration for the state of the input panel.
1323 /// <since_tizen> 3 </since_tizen>
1329 /// <since_tizen> 4 </since_tizen>
1332 /// Input panel is shown.
1334 /// <since_tizen> 4 </since_tizen>
1337 /// Input panel is hidden.
1339 /// <since_tizen> 4 </since_tizen>
1342 /// Input panel in process of being shown.
1344 /// <since_tizen> 4 </since_tizen>
1349 /// Enumeration for the types of keyboard.
1351 /// <since_tizen> 4 </since_tizen>
1352 public enum KeyboardType
1355 /// Software keyboard (virtual keyboard) is default.
1357 /// <since_tizen> 4 </since_tizen>
1360 /// Hardware keyboard.
1362 /// <since_tizen> 4 </since_tizen>