1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 using System.Runtime.InteropServices;
22 /// Specifically manages the ecore input method framework which enables the virtual or hardware keyboards.
24 public class ImfManager : BaseHandle
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28 internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ImfManager_SWIGUpcast(cPtr), cMemoryOwn)
30 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj)
35 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
38 protected override void Dispose(DisposeTypes type)
45 if (type == DisposeTypes.Explicit)
48 //Release your own managed resources here.
49 //You should release all of your own disposable objects here.
53 //Release your own unmanaged resources here.
54 //You should not access any managed member here except static instance.
55 //because the execution order of Finalizes is non-deterministic.
57 if (_imfKeyboardTypeChangedEventCallback != null)
59 KeyboardTypeChangedSignal().Disconnect(_imfKeyboardTypeChangedEventCallback);
62 if (_imfManagerLanguageChangedEventCallback != null)
64 LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
67 if (_imfManagerResizedEventCallback != null)
69 ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
72 if (_imfManagerStatusChangedEventCallback != null)
74 StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
77 if (_imfManagerEventReceivedEventCallback != null)
79 EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
82 if (_imfManagerActivatedEventCallback != null)
84 ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
87 if (swigCPtr.Handle != global::System.IntPtr.Zero)
92 NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
94 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
101 /// This structure is used to pass on data from the IMF regarding predictive text.
103 public class ImfEventData : global::System.IDisposable
105 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
106 protected bool swigCMemOwn;
108 internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
110 swigCMemOwn = cMemoryOwn;
111 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
114 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
116 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
119 //A Flag to check who called Dispose(). (By User or DisposeQueue)
120 private bool isDisposeQueued = false;
121 //A Flat to check if it is already disposed.
122 protected bool disposed = false;
127 if (!isDisposeQueued)
129 isDisposeQueued = true;
130 DisposeQueue.Instance.Add(this);
137 public void Dispose()
139 //Throw excpetion if Dispose() is called in separate thread.
140 if (!Window.IsInstalled())
142 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
147 Dispose(DisposeTypes.Implicit);
151 Dispose(DisposeTypes.Explicit);
152 System.GC.SuppressFinalize(this);
156 protected virtual void Dispose(DisposeTypes type)
163 if (type == DisposeTypes.Explicit)
166 //Release your own managed resources here.
167 //You should release all of your own disposable objects here.
171 //Release your own unmanaged resources here.
172 //You should not access any managed member here except static instance.
173 //because the execution order of Finalizes is non-deterministic.
175 if (swigCPtr.Handle != IntPtr.Zero)
180 NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
182 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
188 internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
190 ImfEventData ret = new ImfEventData(cPtr, false);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 /// Default Constructor
198 public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 /// <param name="aEventName">The name of the event from the IMF.</param>
207 /// <param name="aPredictiveString">The pre-edit or commit string.</param>
208 /// <param name="aCursorOffset">Start position from the current cursor position to start deleting characters.</param>
209 /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
210 public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216 /// The pre-edit or commit string.
218 [Obsolete("Please do not use! this will be deprecated")]
219 public string predictiveString
223 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 /// The pre-edit or commit string.
237 public string PredictiveString
241 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 /// The name of the event from the IMF.
255 [Obsolete("Please do not use! this will be deprecated")]
256 public ImfManager.ImfEvent eventName
260 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 /// The name of the event from the IMF.
274 public ImfManager.ImfEvent EventName
278 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 /// Start position from the current cursor position to start deleting characters.
292 [Obsolete("Please do not use! this will be deprecated")]
293 public int cursorOffset
297 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 /// Start position from the current cursor position to start deleting characters.
311 public int CursorOffset
315 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 /// Number of characters to delete from the cursorOffset.
329 [Obsolete("Please do not use! this will be deprecated")]
330 public int numberOfChars
334 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 /// Number of characters to delete from the cursorOffset.
348 public int NumberOfChars
352 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
358 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 /// Data required by IMF from the callback.
368 public class ImfCallbackData : global::System.IDisposable
370 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
371 protected bool swigCMemOwn;
373 internal IntPtr GetImfCallbackDataPtr()
375 return (IntPtr)swigCPtr;
378 internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
380 swigCMemOwn = cMemoryOwn;
381 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
384 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
386 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
389 //A Flag to check who called Dispose(). (By User or DisposeQueue)
390 private bool isDisposeQueued = false;
391 //A Flat to check if it is already disposed.
392 protected bool disposed = false;
397 if (!isDisposeQueued)
399 isDisposeQueued = true;
400 DisposeQueue.Instance.Add(this);
407 public void Dispose()
409 //Throw excpetion if Dispose() is called in separate thread.
410 if (!Window.IsInstalled())
412 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
417 Dispose(DisposeTypes.Implicit);
421 Dispose(DisposeTypes.Explicit);
422 System.GC.SuppressFinalize(this);
426 protected virtual void Dispose(DisposeTypes type)
433 if (type == DisposeTypes.Explicit)
436 //Release your own managed resources here.
437 //You should release all of your own disposable objects here.
441 //Release your own unmanaged resources here.
442 //You should not access any managed member here except static instance.
443 //because the execution order of Finalizes is non-deterministic.
445 if (swigCPtr.Handle != IntPtr.Zero)
450 NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
452 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
458 internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
460 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
461 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466 /// Default Constructor
468 public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
470 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 /// <param name="aUpdate">True if cursor position needs to be updated.</param>
477 /// <param name="aCursorPosition">New position of cursor.</param>
478 /// <param name="aCurrentText">Current text string.</param>
479 /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
480 public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
482 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486 /// Current text string.
488 [Obsolete("Please do not use! this will be deprecated")]
489 public string currentText
493 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
494 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
499 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
505 /// Current text string.
507 public string CurrentText
511 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
512 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
517 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523 /// Current text string.
525 [Obsolete("Please do not use! this will be deprecated")]
526 public int cursorPosition
530 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
531 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542 /// Current text string.
544 public int CursorPosition
548 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
549 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
553 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
554 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
560 /// If cursor position needs to be updated.
562 [Obsolete("Please do not use! this will be deprecated")]
567 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
568 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
573 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579 /// If cursor position needs to be updated.
585 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
591 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
597 /// Flag if preedit reset is required.
599 [Obsolete("Please do not use! this will be deprecated")]
600 public bool preeditResetRequired
604 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
616 /// Flag if preedit reset is required.
618 public bool PreeditResetRequired
622 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
623 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
628 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636 /// Retrieve a handle to the instance of ImfManager.
638 /// <returns>A handle to the ImfManager.</returns>
639 public static ImfManager Get()
641 ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
642 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647 /// Activate the IMF.<br/>
648 /// It means that the text editing is started at somewhere.<br/>
649 /// If the H/W keyboard isn't connected then it will show the virtual keyboard.
651 public void Activate()
653 NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
654 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658 /// Deactivate the IMF.<br/>
659 /// It means that the text editing is finished at somewhere.
661 public void Deactivate()
663 NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
668 /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.<br/>
669 /// If true then keyboard will be restored (activated) after focus is regained.
671 /// <returns>Restoration status.</returns>
672 public bool RestoreAfterFocusLost()
674 bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
675 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 /// Set status whether the IMF has to restore the keyboard after losing focus.
682 /// <param name="toggle">True means that keyboard should be restored after focus lost and regained.</param>
683 public void SetRestoreAfterFocusLost(bool toggle)
685 NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690 /// Send message reset the pred-edit state / imf module.
692 public new void Reset()
694 NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
695 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
699 /// Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation.
701 public void NotifyCursorPosition()
703 NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
704 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708 /// Sets cursor position stored in VirtualKeyboard, this is required by the IMF context.
710 /// <param name="cursorPosition">Position of cursor.</param>
711 public void SetCursorPosition(uint cursorPosition)
713 NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
714 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718 /// Gets cursor position stored in VirtualKeyboard, this is required by the IMF context.
720 /// <returns>Current position of cursor</returns>
721 public uint GetCursorPosition()
723 uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
724 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
729 /// Method to store the string required by the IMF, this is used to provide predictive word suggestions.
731 /// <param name="text">The text string surrounding the current cursor point.</param>
732 public void SetSurroundingText(string text)
734 NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
735 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
739 /// Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
741 /// <returns>Surrounding text.</returns>
742 public string GetSurroundingText()
744 string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
745 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
750 /// Notifies IMF context that text input is set to multi line or not.
752 /// <param name="multiLine">True if multiline text input is used.</param>
753 public void NotifyTextInputMultiLine(bool multiLine)
755 NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
756 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
760 /// Returns text direction of the keyboard's current input language.
762 /// <returns>The direction of the text.</returns>
763 public ImfManager.TextDirection GetTextDirection()
765 ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
766 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
771 /// Provides size and position of keyboard.<br/>
772 /// Position is relative to whether keyboard is visible or not.<br/>
773 /// If keyboard is not visible then position will be off the screen.<br/>
774 /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get<br/>
775 /// the values then taken down. So ideally GetInputMethodArea() should be called after Show().
777 /// <returns>Rectangle which is keyboard panel x, y, width, height</returns>
778 public Rectangle GetInputMethodArea()
780 Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
781 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785 internal void ApplyOptions(InputMethodOptions options)
787 NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
792 /// Sets up the input-panel specific data.
794 /// <param name="text">The specific data to be set to the input panel.</param>
795 public void SetInputPanelUserData(string text)
797 NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
798 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
802 /// Gets the specific data of the current active input panel.
804 /// <param name="text">The specific data to be got from the input panel.</param>
805 public void GetInputPanelUserData(out string text)
807 NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
808 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
812 /// Gets the state of the current active input panel.
814 /// <returns>The state of the input panel.</returns>
815 public ImfManager.State GetInputPanelState()
817 ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
818 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 /// Sets the return key on the input panel to be visible or invisible.<br/>
824 /// The default is true.
826 /// <param name="visible">True if the return key is visible(enabled), false otherwise.</param>
827 public void SetReturnKeyState(bool visible)
829 NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
830 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
834 /// Enable to show the input panel automatically when focused.
836 /// <param name="enabled">If true, the input panel will be shown when focused.</param>
837 public void AutoEnableInputPanel(bool enabled)
839 NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
840 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
844 /// Shows the input panel.
846 public void ShowInputPanel()
848 NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
849 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
853 /// Hides the input panel.
855 public void HideInputPanel()
857 NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
858 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
862 /// Gets the keyboard type.<br/>
863 /// The default keyboard type is SoftwareKeyboard.
865 /// <returns>The keyboard type</returns>
866 public ImfManager.KeyboardType GetKeyboardType()
868 ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
869 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
874 /// Gets the current language locale of the input panel.<br/>
875 /// Ex) en_US, en_GB, en_PH, fr_FR, ...
877 /// <returns>The current language locale of the input panel.</returns>
878 public string GetInputPanelLocale()
880 string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
881 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
888 public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
890 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
893 internal static ImfManager GetImfManagerFromPtr(IntPtr cPtr)
895 ImfManager ret = new ImfManager(cPtr, false);
896 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
901 /// ImfManager activated event arguments.
903 [Obsolete("Please do not use! this will be deprecated")]
904 public class ImfManagerActivatedEventArgs : EventArgs
906 public ImfManager ImfManager
913 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
914 private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
915 private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
916 private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
919 /// ImfManager activated event.
921 [Obsolete("Please do not use! this will be deprecated")]
922 public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
926 if (_imfManagerActivatedEventHandler == null)
928 _imfManagerActivatedEventCallback = OnImfManagerActivated;
929 ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
932 _imfManagerActivatedEventHandler += value;
936 _imfManagerActivatedEventHandler -= value;
938 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
940 ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
945 private void OnImfManagerActivated(global::System.IntPtr data)
947 ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
949 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
951 if (_imfManagerActivatedEventHandler != null)
953 _imfManagerActivatedEventHandler(this, e);
958 /// ImfManager activated event arguments.
960 public class ActivatedEventArgs : EventArgs
962 public ImfManager ImfManager
969 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
970 private delegate void ActivatedEventCallbackType(IntPtr data);
971 private ActivatedEventCallbackType _activatedEventCallback;
972 private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
975 /// ImfManager activated.
977 public event EventHandler<ActivatedEventArgs> Activated
981 if (_activatedEventHandler == null)
983 _activatedEventCallback = OnActivated;
984 ActivatedSignal().Connect(_activatedEventCallback);
987 _activatedEventHandler += value;
991 _activatedEventHandler -= value;
993 if (_activatedEventHandler == null && _activatedEventCallback != null)
995 ActivatedSignal().Disconnect(_activatedEventCallback);
1000 private void OnActivated(IntPtr data)
1002 ActivatedEventArgs e = new ActivatedEventArgs();
1004 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1006 if (_activatedEventHandler != null)
1008 _activatedEventHandler(this, e);
1013 /// ImfManager activated signal.
1015 [Obsolete("Please do not use! this will be internal")]
1016 public ActivatedSignalType ActivatedSignal()
1018 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
1019 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1024 /// ImfManager event received event arguments.
1026 [Obsolete("Please do not use! this will be deprecated")]
1027 public class ImfManagerEventReceivedEventArgs : EventArgs
1029 public ImfManager ImfManager
1036 private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
1037 private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
1038 private event EventHandler<ImfManagerEventReceivedEventArgs> _imfManagerEventReceivedEventHandler;
1041 /// ImfManager event received.
1043 [Obsolete("Please do not use! this will be deprecated")]
1044 public event EventHandler<ImfManagerEventReceivedEventArgs> ImfManagerEventReceived
1048 if (_imfManagerEventReceivedEventHandler == null)
1050 _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
1051 EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
1054 _imfManagerEventReceivedEventHandler += value;
1058 _imfManagerEventReceivedEventHandler -= value;
1060 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
1062 EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
1067 private void OnImfManagerEventReceived(global::System.IntPtr data)
1069 ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
1071 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1073 if (_imfManagerEventReceivedEventHandler != null)
1075 _imfManagerEventReceivedEventHandler(this, e);
1080 /// ImfManager event received event arguments.
1082 public class EventReceivedEventArgs : EventArgs
1084 public ImfManager ImfManager
1090 public ImfEventData ImfEventData
1097 private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
1098 private EventReceivedEventCallbackType _eventReceivedEventCallback;
1099 private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
1102 /// ImfManager event received.
1104 public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
1108 if (_eventReceivedEventHandler == null)
1110 _eventReceivedEventCallback = OnEventReceived;
1111 EventReceivedSignal().Connect(_eventReceivedEventCallback);
1114 _eventReceivedEventHandler += value;
1118 _eventReceivedEventHandler -= value;
1120 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
1122 EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
1127 private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
1129 ImfCallbackData imfCallbackData = null;
1131 EventReceivedEventArgs e = new EventReceivedEventArgs();
1133 e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager);
1134 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
1136 if (_eventReceivedEventHandler != null)
1138 imfCallbackData = _eventReceivedEventHandler(this, e);
1140 if (imfCallbackData != null)
1142 return imfCallbackData.GetImfCallbackDataPtr();
1146 return new ImfCallbackData().GetImfCallbackDataPtr();
1151 /// ImfManager event received signal.
1153 [Obsolete("Please do not use! this will be internal")]
1154 public ImfEventSignalType EventReceivedSignal()
1156 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
1157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1162 /// ImfManager status changed event arguments.
1164 [Obsolete("Please do not use! this will be deprecated")]
1165 public class ImfManagerStatusChangedEventArgs : EventArgs
1167 public ImfManager ImfManager
1174 private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data);
1175 private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
1176 private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
1179 /// ImfManager status changed.
1181 [Obsolete("Please do not use! this will be deprecated")]
1182 public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
1186 if (_imfManagerStatusChangedEventHandler == null)
1188 _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
1189 StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
1192 _imfManagerStatusChangedEventHandler += value;
1196 _imfManagerStatusChangedEventHandler -= value;
1198 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
1200 StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
1205 private void OnImfManagerStatusChanged(global::System.IntPtr data)
1207 ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
1209 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1211 if (_imfManagerStatusChangedEventHandler != null)
1213 _imfManagerStatusChangedEventHandler(this, e);
1218 /// ImfManager status changed event arguments.
1220 public class StatusChangedEventArgs : EventArgs
1222 public bool StatusChanged
1229 private delegate void StatusChangedEventCallbackType(bool statusChanged);
1230 private StatusChangedEventCallbackType _statusChangedEventCallback;
1231 private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1234 /// ImfManager status changed.
1236 public event EventHandler<StatusChangedEventArgs> StatusChanged
1240 if (_statusChangedEventHandler == null)
1242 _statusChangedEventCallback = OnStatusChanged;
1243 StatusChangedSignal().Connect(_statusChangedEventCallback);
1246 _statusChangedEventHandler += value;
1250 _statusChangedEventHandler -= value;
1252 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1254 StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1259 private void OnStatusChanged(bool statusChanged)
1261 StatusChangedEventArgs e = new StatusChangedEventArgs();
1263 e.StatusChanged = statusChanged;
1265 if (_statusChangedEventHandler != null)
1267 _statusChangedEventHandler(this, e);
1272 /// ImfManager status changed signal.
1274 [Obsolete("Please do not use! this will be internal")]
1275 public StatusSignalType StatusChangedSignal()
1277 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
1278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1283 /// ImfManager resized event arguments.
1285 [Obsolete("Please do not use! this will be deprecated")]
1286 public class ImfManagerResizedEventArgs : EventArgs
1288 public ImfManager ImfManager
1295 private delegate void ImfManagerResizedEventCallbackType(IntPtr data);
1296 private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
1297 private event EventHandler<ImfManagerResizedEventArgs> _imfManagerResizedEventHandler;
1300 /// ImfManager resized event.
1302 [Obsolete("Please do not use! this will be deprecated")]
1303 public event EventHandler<ImfManagerResizedEventArgs> ImfManagerResized
1307 if (_imfManagerResizedEventHandler == null)
1309 _imfManagerResizedEventCallback = OnImfManagerResized;
1310 ResizedSignal().Connect(_imfManagerResizedEventCallback);
1313 _imfManagerResizedEventHandler += value;
1317 _imfManagerResizedEventHandler -= value;
1319 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
1321 ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
1326 private void OnImfManagerResized(IntPtr data)
1328 ImfManagerResizedEventArgs e = new ImfManagerResizedEventArgs();
1330 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1332 if (_imfManagerResizedEventHandler != null)
1334 _imfManagerResizedEventHandler(this, e);
1338 private delegate void ResizedEventCallbackType();
1339 private ResizedEventCallbackType _resizedEventCallback;
1340 private event EventHandler _resizedEventHandler;
1343 /// ImfManager resized.
1345 public event EventHandler Resized
1349 if (_resizedEventHandler == null)
1351 _resizedEventCallback = OnResized;
1352 ResizedSignal().Connect(_resizedEventCallback);
1355 _resizedEventHandler += value;
1359 _resizedEventHandler -= value;
1361 if (_resizedEventHandler == null && _resizedEventCallback != null)
1363 ResizedSignal().Disconnect(_resizedEventCallback);
1368 private void OnResized()
1370 if (_resizedEventHandler != null)
1372 _resizedEventHandler(this, null);
1377 /// ImfManager resized signal.
1379 [Obsolete("Please do not use! this will be internal")]
1380 public ImfVoidSignalType ResizedSignal()
1382 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), true);
1383 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1388 /// ImfManager language changed event arguments.
1390 [Obsolete("Please do not use! this will be deprecated")]
1391 public class ImfManagerLanguageChangedEventArgs : EventArgs
1393 public ImfManager ImfManager
1400 private delegate void ImfManagerLanguageChangedEventCallbackType(IntPtr data);
1401 private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
1402 private event EventHandler<ImfManagerLanguageChangedEventArgs> _imfManagerLanguageChangedEventHandler;
1405 /// ImfManager language changed event.
1407 [Obsolete("Please do not use! this will be deprecated")]
1408 public event EventHandler<ImfManagerLanguageChangedEventArgs> ImfManagerLanguageChanged
1412 if (_imfManagerLanguageChangedEventHandler == null)
1414 _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
1415 LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
1418 _imfManagerLanguageChangedEventHandler += value;
1422 _imfManagerLanguageChangedEventHandler -= value;
1424 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
1426 LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
1431 private void OnImfManagerLanguageChanged(IntPtr data)
1433 ImfManagerLanguageChangedEventArgs e = new ImfManagerLanguageChangedEventArgs();
1435 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1437 if (_imfManagerLanguageChangedEventHandler != null)
1439 _imfManagerLanguageChangedEventHandler(this, e);
1443 private delegate void LanguageChangedEventCallbackType();
1444 private LanguageChangedEventCallbackType _languageChangedEventCallback;
1445 private event EventHandler _languageChangedEventHandler;
1448 /// ImfManager language changed.
1450 public event EventHandler LanguageChanged
1454 if (_languageChangedEventHandler == null)
1456 _languageChangedEventCallback = OnLanguageChanged;
1457 LanguageChangedSignal().Connect(_languageChangedEventCallback);
1460 _languageChangedEventHandler += value;
1464 _languageChangedEventHandler -= value;
1466 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1468 LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1473 private void OnLanguageChanged()
1475 if (_languageChangedEventHandler != null)
1477 _languageChangedEventHandler(this, null);
1482 /// ImfManager language changed signal.
1484 [Obsolete("Please do not use! this will be internal")]
1485 public ImfVoidSignalType LanguageChangedSignal()
1487 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), true);
1488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1493 /// ImfManager keyboard type changed event arguments.
1495 public class KeyboardTypeChangedEventArgs : EventArgs
1497 public KeyboardType KeyboardType
1504 private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1505 private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1506 private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1509 /// ImfManager keyboard type changed.
1511 public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1515 if (_keyboardTypeChangedEventHandler == null)
1517 _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1518 KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1521 _keyboardTypeChangedEventHandler += value;
1525 _keyboardTypeChangedEventHandler -= value;
1527 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1529 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1534 private void OnKeyboardTypeChanged(KeyboardType type)
1536 KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1538 e.KeyboardType = type;
1540 if (_keyboardTypeChangedEventHandler != null)
1542 _keyboardTypeChangedEventHandler(this, e);
1546 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1548 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1549 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1554 /// The direction of text.
1556 public enum TextDirection
1569 /// Events that are generated by the IMF.
1571 public enum ImfEvent
1578 /// Pre-Edit changed.
1582 /// Commit recieved.
1586 /// Event to delete a range of characters from the string.
1590 /// Event to query string and cursor position.
1594 /// Private command sent from the input panel.
1600 /// Enumeration for state of the input panel.
1609 /// Input panel is shown.
1613 /// Input panel is hidden.
1617 /// Input panel in process of being shown.
1623 /// Enumeration for the type of Keyboard.
1625 public enum KeyboardType
1628 /// Software keyboard (Virtual keyboard) is default.
1632 /// Hardware keyboard.