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 (swigCPtr.Handle != IntPtr.Zero)
62 NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
64 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
71 /// This structure is used to pass on data from the IMF regarding predictive text.
73 public class ImfEventData : global::System.IDisposable
75 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
76 protected bool swigCMemOwn;
78 internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
80 swigCMemOwn = cMemoryOwn;
81 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
84 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
86 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
89 //A Flag to check who called Dispose(). (By User or DisposeQueue)
90 private bool isDisposeQueued = false;
91 //A Flat to check if it is already disposed.
92 protected bool disposed = false;
99 isDisposeQueued = true;
100 DisposeQueue.Instance.Add(this);
107 public void Dispose()
109 //Throw excpetion if Dispose() is called in separate thread.
110 if (!Window.IsInstalled())
112 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
117 Dispose(DisposeTypes.Implicit);
121 Dispose(DisposeTypes.Explicit);
122 System.GC.SuppressFinalize(this);
126 protected virtual void Dispose(DisposeTypes type)
133 if (type == DisposeTypes.Explicit)
136 //Release your own managed resources here.
137 //You should release all of your own disposable objects here.
141 //Release your own unmanaged resources here.
142 //You should not access any managed member here except static instance.
143 //because the execution order of Finalizes is non-deterministic.
145 if (swigCPtr.Handle != IntPtr.Zero)
150 NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
152 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
158 internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
160 ImfEventData ret = new ImfEventData(cPtr, false);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 /// Default Constructor
168 public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176 /// <param name="aEventName">The name of the event from the IMF.</param>
177 /// <param name="aPredictiveString">The pre-edit or commit string.</param>
178 /// <param name="aCursorOffset">Start position from the current cursor position to start deleting characters.</param>
179 /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
180 public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 /// The pre-edit or commit string.
188 [Obsolete("Please do not use! this will be deprecated")]
189 public string predictiveString
193 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 /// The pre-edit or commit string.
207 public string PredictiveString
211 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// The name of the event from the IMF.
225 [Obsolete("Please do not use! this will be deprecated")]
226 public ImfManager.ImfEvent eventName
230 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 /// The name of the event from the IMF.
244 public ImfManager.ImfEvent EventName
248 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 /// Start position from the current cursor position to start deleting characters.
262 [Obsolete("Please do not use! this will be deprecated")]
263 public int cursorOffset
267 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 /// Start position from the current cursor position to start deleting characters.
281 public int CursorOffset
285 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
297 /// Number of characters to delete from the cursorOffset.
299 [Obsolete("Please do not use! this will be deprecated")]
300 public int numberOfChars
304 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 /// Number of characters to delete from the cursorOffset.
318 public int NumberOfChars
322 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
323 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
328 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 /// Data required by IMF from the callback.
338 public class ImfCallbackData : global::System.IDisposable
340 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
341 protected bool swigCMemOwn;
343 internal IntPtr GetImfCallbackDataPtr()
345 return (IntPtr)swigCPtr;
348 internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
350 swigCMemOwn = cMemoryOwn;
351 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
354 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
356 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
359 //A Flag to check who called Dispose(). (By User or DisposeQueue)
360 private bool isDisposeQueued = false;
361 //A Flat to check if it is already disposed.
362 protected bool disposed = false;
367 if (!isDisposeQueued)
369 isDisposeQueued = true;
370 DisposeQueue.Instance.Add(this);
377 public void Dispose()
379 //Throw excpetion if Dispose() is called in separate thread.
380 if (!Window.IsInstalled())
382 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
387 Dispose(DisposeTypes.Implicit);
391 Dispose(DisposeTypes.Explicit);
392 System.GC.SuppressFinalize(this);
396 protected virtual void Dispose(DisposeTypes type)
403 if (type == DisposeTypes.Explicit)
406 //Release your own managed resources here.
407 //You should release all of your own disposable objects here.
411 //Release your own unmanaged resources here.
412 //You should not access any managed member here except static instance.
413 //because the execution order of Finalizes is non-deterministic.
415 if (swigCPtr.Handle != IntPtr.Zero)
420 NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
422 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
428 internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
430 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436 /// Default Constructor
438 public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 /// <param name="aUpdate">True if cursor position needs to be updated.</param>
447 /// <param name="aCursorPosition">New position of cursor.</param>
448 /// <param name="aCurrentText">Current text string.</param>
449 /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
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 /// Current text string.
458 [Obsolete("Please do not use! this will be deprecated")]
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 /// Current text string.
477 public string CurrentText
481 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
482 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
487 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
493 /// Current text string.
495 [Obsolete("Please do not use! this will be deprecated")]
496 public int cursorPosition
500 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
505 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
506 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
512 /// Current text string.
514 public int CursorPosition
518 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530 /// If cursor position needs to be updated.
532 [Obsolete("Please do not use! this will be deprecated")]
537 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
543 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549 /// If cursor position needs to be updated.
555 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
556 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
560 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
561 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567 /// Flag if preedit reset is required.
569 [Obsolete("Please do not use! this will be deprecated")]
570 public bool preeditResetRequired
574 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
579 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
580 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 /// Flag if preedit reset is required.
588 public bool PreeditResetRequired
592 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
593 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
597 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606 /// Retrieve a handle to the instance of ImfManager.
608 /// <returns>A handle to the ImfManager.</returns>
609 public static ImfManager Get()
611 ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
612 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
617 /// Activate the IMF.<br/>
618 /// It means that the text editing is started at somewhere.<br/>
619 /// If the H/W keyboard isn't connected then it will show the virtual keyboard.
621 public void Activate()
623 NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
624 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
628 /// Deactivate the IMF.<br/>
629 /// It means that the text editing is finished at somewhere.
631 public void Deactivate()
633 NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
634 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638 /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.<br/>
639 /// If true then keyboard will be restored (activated) after focus is regained.
641 /// <returns>Restoration status.</returns>
642 public bool RestoreAfterFocusLost()
644 bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
645 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
650 /// Set status whether the IMF has to restore the keyboard after losing focus.
652 /// <param name="toggle">True means that keyboard should be restored after focus lost and regained.</param>
653 public void SetRestoreAfterFocusLost(bool toggle)
655 NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
656 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
660 /// Send message reset the pred-edit state / imf module.
662 public new void Reset()
664 NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
665 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
669 /// Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation.
671 public void NotifyCursorPosition()
673 NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
674 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
678 /// Sets cursor position stored in VirtualKeyboard, this is required by the IMF context.
680 /// <param name="cursorPosition">Position of cursor.</param>
681 public void SetCursorPosition(uint cursorPosition)
683 NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
684 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
688 /// Gets cursor position stored in VirtualKeyboard, this is required by the IMF context.
690 /// <returns>Current position of cursor</returns>
691 public uint GetCursorPosition()
693 uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
694 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
699 /// Method to store the string required by the IMF, this is used to provide predictive word suggestions.
701 /// <param name="text">The text string surrounding the current cursor point.</param>
702 public void SetSurroundingText(string text)
704 NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
705 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
709 /// Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
711 /// <returns>Surrounding text.</returns>
712 public string GetSurroundingText()
714 string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
715 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
720 /// Notifies IMF context that text input is set to multi line or not.
722 /// <param name="multiLine">True if multiline text input is used.</param>
723 public void NotifyTextInputMultiLine(bool multiLine)
725 NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
726 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
730 /// Returns text direction of the keyboard's current input language.
732 /// <returns>The direction of the text.</returns>
733 public ImfManager.TextDirection GetTextDirection()
735 ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
741 /// Provides size and position of keyboard.<br/>
742 /// Position is relative to whether keyboard is visible or not.<br/>
743 /// If keyboard is not visible then position will be off the screen.<br/>
744 /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get<br/>
745 /// the values then taken down. So ideally GetInputMethodArea() should be called after Show().
747 /// <returns>Rectangle which is keyboard panel x, y, width, height</returns>
748 public Rectangle GetInputMethodArea()
750 Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
751 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
755 internal void ApplyOptions(InputMethodOptions options)
757 NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
758 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
762 /// Sets up the input-panel specific data.
764 /// <param name="text">The specific data to be set to the input panel.</param>
765 public void SetInputPanelUserData(string text)
767 NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
768 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
772 /// Gets the specific data of the current active input panel.
774 /// <param name="text">The specific data to be got from the input panel.</param>
775 public void GetInputPanelUserData(out string text)
777 NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
778 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
782 /// Gets the state of the current active input panel.
784 /// <returns>The state of the input panel.</returns>
785 public ImfManager.State GetInputPanelState()
787 ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
788 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
793 /// Sets the return key on the input panel to be visible or invisible.<br/>
794 /// The default is true.
796 /// <param name="visible">True if the return key is visible(enabled), false otherwise.</param>
797 public void SetReturnKeyState(bool visible)
799 NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
800 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
804 /// Enable to show the input panel automatically when focused.
806 /// <param name="enabled">If true, the input panel will be shown when focused.</param>
807 public void AutoEnableInputPanel(bool enabled)
809 NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
810 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
814 /// Shows the input panel.
816 public void ShowInputPanel()
818 NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
819 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
823 /// Hides the input panel.
825 public void HideInputPanel()
827 NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
828 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
832 /// Gets the keyboard type.<br/>
833 /// The default keyboard type is SoftwareKeyboard.
835 /// <returns>The keyboard type</returns>
836 public ImfManager.KeyboardType GetKeyboardType()
838 ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
839 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
844 /// Gets the current language locale of the input panel.<br/>
845 /// Ex) en_US, en_GB, en_PH, fr_FR, ...
847 /// <returns>The current language locale of the input panel.</returns>
848 public string GetInputPanelLocale()
850 string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
851 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
858 public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
860 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
863 internal static ImfManager GetImfManagerFromPtr(IntPtr cPtr)
865 ImfManager ret = new ImfManager(cPtr, false);
866 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
871 /// ImfManager activated event arguments.
873 [Obsolete("Please do not use! this will be deprecated")]
874 public class ImfManagerActivatedEventArgs : EventArgs
876 public ImfManager ImfManager
883 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
884 private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
885 private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
886 private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
889 /// ImfManager activated event.
891 [Obsolete("Please do not use! this will be deprecated")]
892 public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
896 if (_imfManagerActivatedEventHandler == null)
898 _imfManagerActivatedEventCallback = OnImfManagerActivated;
899 ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
902 _imfManagerActivatedEventHandler += value;
906 _imfManagerActivatedEventHandler -= value;
908 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
910 ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
915 private void OnImfManagerActivated(global::System.IntPtr data)
917 ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
919 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
921 if (_imfManagerActivatedEventHandler != null)
923 _imfManagerActivatedEventHandler(this, e);
928 /// ImfManager activated event arguments.
930 public class ActivatedEventArgs : EventArgs
932 public ImfManager ImfManager
939 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
940 private delegate void ActivatedEventCallbackType(IntPtr data);
941 private ActivatedEventCallbackType _activatedEventCallback;
942 private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
945 /// ImfManager activated.
947 public event EventHandler<ActivatedEventArgs> Activated
951 if (_activatedEventHandler == null)
953 _activatedEventCallback = OnActivated;
954 ActivatedSignal().Connect(_activatedEventCallback);
957 _activatedEventHandler += value;
961 _activatedEventHandler -= value;
963 if (_activatedEventHandler == null && _activatedEventCallback != null)
965 ActivatedSignal().Disconnect(_activatedEventCallback);
970 private void OnActivated(IntPtr data)
972 ActivatedEventArgs e = new ActivatedEventArgs();
974 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
976 if (_activatedEventHandler != null)
978 _activatedEventHandler(this, e);
983 /// ImfManager activated signal.
985 [Obsolete("Please do not use! this will be internal")]
986 public ActivatedSignalType ActivatedSignal()
988 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
989 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
994 /// ImfManager event received event arguments.
996 [Obsolete("Please do not use! this will be deprecated")]
997 public class ImfManagerEventReceivedEventArgs : EventArgs
999 public ImfManager ImfManager
1006 private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
1007 private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
1008 private event EventHandler<ImfManagerEventReceivedEventArgs> _imfManagerEventReceivedEventHandler;
1011 /// ImfManager event received.
1013 [Obsolete("Please do not use! this will be deprecated")]
1014 public event EventHandler<ImfManagerEventReceivedEventArgs> ImfManagerEventReceived
1018 if (_imfManagerEventReceivedEventHandler == null)
1020 _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
1021 EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
1024 _imfManagerEventReceivedEventHandler += value;
1028 _imfManagerEventReceivedEventHandler -= value;
1030 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
1032 EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
1037 private void OnImfManagerEventReceived(global::System.IntPtr data)
1039 ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
1041 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1043 if (_imfManagerEventReceivedEventHandler != null)
1045 _imfManagerEventReceivedEventHandler(this, e);
1050 /// ImfManager event received event arguments.
1052 public class EventReceivedEventArgs : EventArgs
1054 public ImfManager ImfManager
1060 public ImfEventData ImfEventData
1067 private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
1068 private EventReceivedEventCallbackType _eventReceivedEventCallback;
1069 private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
1072 /// ImfManager event received.
1074 public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
1078 if (_eventReceivedEventHandler == null)
1080 _eventReceivedEventCallback = OnEventReceived;
1081 EventReceivedSignal().Connect(_eventReceivedEventCallback);
1084 _eventReceivedEventHandler += value;
1088 _eventReceivedEventHandler -= value;
1090 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
1092 EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
1097 private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
1099 ImfCallbackData imfCallbackData = null;
1101 EventReceivedEventArgs e = new EventReceivedEventArgs();
1103 e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager);
1104 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
1106 if (_eventReceivedEventHandler != null)
1108 imfCallbackData = _eventReceivedEventHandler(this, e);
1110 if (imfCallbackData != null)
1112 return imfCallbackData.GetImfCallbackDataPtr();
1116 return new ImfCallbackData().GetImfCallbackDataPtr();
1121 /// ImfManager event received signal.
1123 [Obsolete("Please do not use! this will be internal")]
1124 public ImfEventSignalType EventReceivedSignal()
1126 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
1127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1132 /// ImfManager status changed event arguments.
1134 [Obsolete("Please do not use! this will be deprecated")]
1135 public class ImfManagerStatusChangedEventArgs : EventArgs
1137 public ImfManager ImfManager
1144 private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data);
1145 private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
1146 private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
1149 /// ImfManager status changed.
1151 [Obsolete("Please do not use! this will be deprecated")]
1152 public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
1156 if (_imfManagerStatusChangedEventHandler == null)
1158 _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
1159 StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
1162 _imfManagerStatusChangedEventHandler += value;
1166 _imfManagerStatusChangedEventHandler -= value;
1168 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
1170 StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
1175 private void OnImfManagerStatusChanged(global::System.IntPtr data)
1177 ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
1179 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1181 if (_imfManagerStatusChangedEventHandler != null)
1183 _imfManagerStatusChangedEventHandler(this, e);
1188 /// ImfManager status changed event arguments.
1190 public class StatusChangedEventArgs : EventArgs
1192 public bool StatusChanged
1199 private delegate void StatusChangedEventCallbackType(bool statusChanged);
1200 private StatusChangedEventCallbackType _statusChangedEventCallback;
1201 private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1204 /// ImfManager status changed.
1206 public event EventHandler<StatusChangedEventArgs> StatusChanged
1210 if (_statusChangedEventHandler == null)
1212 _statusChangedEventCallback = OnStatusChanged;
1213 StatusChangedSignal().Connect(_statusChangedEventCallback);
1216 _statusChangedEventHandler += value;
1220 _statusChangedEventHandler -= value;
1222 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1224 StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1229 private void OnStatusChanged(bool statusChanged)
1231 StatusChangedEventArgs e = new StatusChangedEventArgs();
1233 e.StatusChanged = statusChanged;
1235 if (_statusChangedEventHandler != null)
1237 _statusChangedEventHandler(this, e);
1242 /// ImfManager status changed signal.
1244 [Obsolete("Please do not use! this will be internal")]
1245 public StatusSignalType StatusChangedSignal()
1247 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
1248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1253 /// ImfManager resized event arguments.
1255 [Obsolete("Please do not use! this will be deprecated")]
1256 public class ImfManagerResizedEventArgs : EventArgs
1258 public ImfManager ImfManager
1265 private delegate void ImfManagerResizedEventCallbackType(IntPtr data);
1266 private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
1267 private event EventHandler<ImfManagerResizedEventArgs> _imfManagerResizedEventHandler;
1270 /// ImfManager resized event.
1272 [Obsolete("Please do not use! this will be deprecated")]
1273 public event EventHandler<ImfManagerResizedEventArgs> ImfManagerResized
1277 if (_imfManagerResizedEventHandler == null)
1279 _imfManagerResizedEventCallback = OnImfManagerResized;
1280 ResizedSignal().Connect(_imfManagerResizedEventCallback);
1283 _imfManagerResizedEventHandler += value;
1287 _imfManagerResizedEventHandler -= value;
1289 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
1291 ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
1296 private void OnImfManagerResized(IntPtr data)
1298 ImfManagerResizedEventArgs e = new ImfManagerResizedEventArgs();
1300 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1302 if (_imfManagerResizedEventHandler != null)
1304 _imfManagerResizedEventHandler(this, e);
1308 private delegate void ResizedEventCallbackType();
1309 private ResizedEventCallbackType _resizedEventCallback;
1310 private event EventHandler _resizedEventHandler;
1313 /// ImfManager resized.
1315 public event EventHandler Resized
1319 if (_resizedEventHandler == null)
1321 _resizedEventCallback = OnResized;
1322 ResizedSignal().Connect(_resizedEventCallback);
1325 _resizedEventHandler += value;
1329 _resizedEventHandler -= value;
1331 if (_resizedEventHandler == null && _resizedEventCallback != null)
1333 ResizedSignal().Disconnect(_resizedEventCallback);
1338 private void OnResized()
1340 if (_resizedEventHandler != null)
1342 _resizedEventHandler(this, null);
1347 /// ImfManager resized signal.
1349 [Obsolete("Please do not use! this will be internal")]
1350 public ImfVoidSignalType ResizedSignal()
1352 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), true);
1353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1358 /// ImfManager language changed event arguments.
1360 [Obsolete("Please do not use! this will be deprecated")]
1361 public class ImfManagerLanguageChangedEventArgs : EventArgs
1363 public ImfManager ImfManager
1370 private delegate void ImfManagerLanguageChangedEventCallbackType(IntPtr data);
1371 private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
1372 private event EventHandler<ImfManagerLanguageChangedEventArgs> _imfManagerLanguageChangedEventHandler;
1375 /// ImfManager language changed event.
1377 [Obsolete("Please do not use! this will be deprecated")]
1378 public event EventHandler<ImfManagerLanguageChangedEventArgs> ImfManagerLanguageChanged
1382 if (_imfManagerLanguageChangedEventHandler == null)
1384 _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
1385 LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
1388 _imfManagerLanguageChangedEventHandler += value;
1392 _imfManagerLanguageChangedEventHandler -= value;
1394 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
1396 LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
1401 private void OnImfManagerLanguageChanged(IntPtr data)
1403 ImfManagerLanguageChangedEventArgs e = new ImfManagerLanguageChangedEventArgs();
1405 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
1407 if (_imfManagerLanguageChangedEventHandler != null)
1409 _imfManagerLanguageChangedEventHandler(this, e);
1413 private delegate void LanguageChangedEventCallbackType();
1414 private LanguageChangedEventCallbackType _languageChangedEventCallback;
1415 private event EventHandler _languageChangedEventHandler;
1418 /// ImfManager language changed.
1420 public event EventHandler LanguageChanged
1424 if (_languageChangedEventHandler == null)
1426 _languageChangedEventCallback = OnLanguageChanged;
1427 LanguageChangedSignal().Connect(_languageChangedEventCallback);
1430 _languageChangedEventHandler += value;
1434 _languageChangedEventHandler -= value;
1436 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1438 LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1443 private void OnLanguageChanged()
1445 if (_languageChangedEventHandler != null)
1447 _languageChangedEventHandler(this, null);
1452 /// ImfManager language changed signal.
1454 [Obsolete("Please do not use! this will be internal")]
1455 public ImfVoidSignalType LanguageChangedSignal()
1457 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), true);
1458 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1463 /// ImfManager keyboard type changed event arguments.
1465 public class KeyboardTypeChangedEventArgs : EventArgs
1467 public KeyboardType KeyboardType
1474 private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1475 private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1476 private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1479 /// ImfManager keyboard type changed.
1481 public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1485 if (_keyboardTypeChangedEventHandler == null)
1487 _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1488 KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1491 _keyboardTypeChangedEventHandler += value;
1495 _keyboardTypeChangedEventHandler -= value;
1497 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1499 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1504 private void OnKeyboardTypeChanged(KeyboardType type)
1506 KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1508 e.KeyboardType = type;
1510 if (_keyboardTypeChangedEventHandler != null)
1512 _keyboardTypeChangedEventHandler(this, e);
1516 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1518 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1524 /// The direction of text.
1526 public enum TextDirection
1539 /// Events that are generated by the IMF.
1541 public enum ImfEvent
1548 /// Pre-Edit changed.
1552 /// Commit recieved.
1556 /// Event to delete a range of characters from the string.
1560 /// Event to query string and cursor position.
1564 /// Private command sent from the input panel.
1570 /// Enumeration for state of the input panel.
1579 /// Input panel is shown.
1583 /// Input panel is hidden.
1587 /// Input panel in process of being shown.
1593 /// Enumeration for the type of Keyboard.
1595 public enum KeyboardType
1598 /// Software keyboard (Virtual keyboard) is default.
1602 /// Hardware keyboard.