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();
864 /// ImfManager activated event arguments.
866 [Obsolete("Please do not use! this will be deprecated")]
867 public class ImfManagerActivatedEventArgs : EventArgs
869 public ImfManager ImfManager
876 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
877 private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
878 private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
879 private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
882 /// ImfManager activated event.
884 [Obsolete("Please do not use! this will be deprecated")]
885 public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
889 if (_imfManagerActivatedEventHandler == null)
891 _imfManagerActivatedEventCallback = OnImfManagerActivated;
892 ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
895 _imfManagerActivatedEventHandler += value;
899 _imfManagerActivatedEventHandler -= value;
901 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
903 ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
908 private void OnImfManagerActivated(global::System.IntPtr data)
910 ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
914 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
917 if (_imfManagerActivatedEventHandler != null)
919 _imfManagerActivatedEventHandler(this, e);
924 /// ImfManager activated event arguments.
926 public class ActivatedEventArgs : EventArgs
928 public ImfManager ImfManager
935 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
936 private delegate void ActivatedEventCallbackType(IntPtr data);
937 private ActivatedEventCallbackType _activatedEventCallback;
938 private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
941 /// ImfManager activated.
943 public event EventHandler<ActivatedEventArgs> Activated
947 if (_activatedEventHandler == null)
949 _activatedEventCallback = OnActivated;
950 ActivatedSignal().Connect(_activatedEventCallback);
953 _activatedEventHandler += value;
957 _activatedEventHandler -= value;
959 if (_activatedEventHandler == null && _activatedEventCallback != null)
961 ActivatedSignal().Disconnect(_activatedEventCallback);
966 private void OnActivated(IntPtr data)
968 ActivatedEventArgs e = new ActivatedEventArgs();
972 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
975 if (_activatedEventHandler != null)
977 _activatedEventHandler(this, e);
982 /// ImfManager activated signal.
984 [Obsolete("Please do not use! this will be internal")]
985 public ActivatedSignalType ActivatedSignal()
987 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
988 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
993 /// ImfManager event received event arguments.
995 [Obsolete("Please do not use! this will be deprecated")]
996 public class ImfManagerEventReceivedEventArgs : EventArgs
998 public ImfManager ImfManager
1005 private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
1006 private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
1007 private event EventHandler<ImfManagerEventReceivedEventArgs> _imfManagerEventReceivedEventHandler;
1010 /// ImfManager event received.
1012 [Obsolete("Please do not use! this will be deprecated")]
1013 public event EventHandler<ImfManagerEventReceivedEventArgs> ImfManagerEventReceived
1017 if (_imfManagerEventReceivedEventHandler == null)
1019 _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
1020 EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
1023 _imfManagerEventReceivedEventHandler += value;
1027 _imfManagerEventReceivedEventHandler -= value;
1029 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
1031 EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
1036 private void OnImfManagerEventReceived(global::System.IntPtr data)
1038 ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
1042 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1045 if (_imfManagerEventReceivedEventHandler != null)
1047 _imfManagerEventReceivedEventHandler(this, e);
1052 /// ImfManager event received event arguments.
1054 public class EventReceivedEventArgs : EventArgs
1056 public ImfManager ImfManager
1062 public ImfEventData ImfEventData
1069 private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
1070 private EventReceivedEventCallbackType _eventReceivedEventCallback;
1071 private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
1074 /// ImfManager event received.
1076 public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
1080 if (_eventReceivedEventHandler == null)
1082 _eventReceivedEventCallback = OnEventReceived;
1083 EventReceivedSignal().Connect(_eventReceivedEventCallback);
1086 _eventReceivedEventHandler += value;
1090 _eventReceivedEventHandler -= value;
1092 if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
1094 EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
1099 private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
1101 ImfCallbackData imfCallbackData = null;
1103 EventReceivedEventArgs e = new EventReceivedEventArgs();
1105 if (imfManager != null)
1107 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
1109 if (imfEventData != null)
1111 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
1114 if (_eventReceivedEventHandler != null)
1116 imfCallbackData = _eventReceivedEventHandler(this, e);
1118 if (imfCallbackData != null)
1120 return imfCallbackData.GetImfCallbackDataPtr();
1124 return new ImfCallbackData().GetImfCallbackDataPtr();
1129 /// ImfManager event received signal.
1131 [Obsolete("Please do not use! this will be internal")]
1132 public ImfEventSignalType EventReceivedSignal()
1134 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
1135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1140 /// ImfManager status changed event arguments.
1142 [Obsolete("Please do not use! this will be deprecated")]
1143 public class ImfManagerStatusChangedEventArgs : EventArgs
1145 public ImfManager ImfManager
1152 private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data);
1153 private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
1154 private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
1157 /// ImfManager status changed.
1159 [Obsolete("Please do not use! this will be deprecated")]
1160 public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
1164 if (_imfManagerStatusChangedEventHandler == null)
1166 _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
1167 StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
1170 _imfManagerStatusChangedEventHandler += value;
1174 _imfManagerStatusChangedEventHandler -= value;
1176 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
1178 StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
1183 private void OnImfManagerStatusChanged(global::System.IntPtr data)
1185 ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
1189 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1192 if (_imfManagerStatusChangedEventHandler != null)
1194 _imfManagerStatusChangedEventHandler(this, e);
1199 /// ImfManager status changed event arguments.
1201 public class StatusChangedEventArgs : EventArgs
1203 public bool StatusChanged
1210 private delegate void StatusChangedEventCallbackType(bool statusChanged);
1211 private StatusChangedEventCallbackType _statusChangedEventCallback;
1212 private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
1215 /// ImfManager status changed.
1217 public event EventHandler<StatusChangedEventArgs> StatusChanged
1221 if (_statusChangedEventHandler == null)
1223 _statusChangedEventCallback = OnStatusChanged;
1224 StatusChangedSignal().Connect(_statusChangedEventCallback);
1227 _statusChangedEventHandler += value;
1231 _statusChangedEventHandler -= value;
1233 if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
1235 StatusChangedSignal().Disconnect(_statusChangedEventCallback);
1240 private void OnStatusChanged(bool statusChanged)
1242 StatusChangedEventArgs e = new StatusChangedEventArgs();
1244 e.StatusChanged = statusChanged;
1246 if (_statusChangedEventHandler != null)
1248 _statusChangedEventHandler(this, e);
1253 /// ImfManager status changed signal.
1255 [Obsolete("Please do not use! this will be internal")]
1256 public StatusSignalType StatusChangedSignal()
1258 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
1259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1264 /// ImfManager resized event arguments.
1266 [Obsolete("Please do not use! this will be deprecated")]
1267 public class ImfManagerResizedEventArgs : EventArgs
1269 public ImfManager ImfManager
1276 private delegate void ImfManagerResizedEventCallbackType(IntPtr data);
1277 private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
1278 private event EventHandler<ImfManagerResizedEventArgs> _imfManagerResizedEventHandler;
1281 /// ImfManager resized event.
1283 [Obsolete("Please do not use! this will be deprecated")]
1284 public event EventHandler<ImfManagerResizedEventArgs> ImfManagerResized
1288 if (_imfManagerResizedEventHandler == null)
1290 _imfManagerResizedEventCallback = OnImfManagerResized;
1291 ResizedSignal().Connect(_imfManagerResizedEventCallback);
1294 _imfManagerResizedEventHandler += value;
1298 _imfManagerResizedEventHandler -= value;
1300 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
1302 ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
1307 private void OnImfManagerResized(IntPtr data)
1309 ImfManagerResizedEventArgs e = new ImfManagerResizedEventArgs();
1313 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1316 if (_imfManagerResizedEventHandler != null)
1318 _imfManagerResizedEventHandler(this, e);
1322 private delegate void ResizedEventCallbackType();
1323 private ResizedEventCallbackType _resizedEventCallback;
1324 private event EventHandler _resizedEventHandler;
1327 /// ImfManager resized.
1329 public event EventHandler Resized
1333 if (_resizedEventHandler == null)
1335 _resizedEventCallback = OnResized;
1336 ResizedSignal().Connect(_resizedEventCallback);
1339 _resizedEventHandler += value;
1343 _resizedEventHandler -= value;
1345 if (_resizedEventHandler == null && _resizedEventCallback != null)
1347 ResizedSignal().Disconnect(_resizedEventCallback);
1352 private void OnResized()
1354 if (_resizedEventHandler != null)
1356 _resizedEventHandler(this, null);
1361 /// ImfManager resized signal.
1363 [Obsolete("Please do not use! this will be internal")]
1364 public ImfVoidSignalType ResizedSignal()
1366 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), false);
1367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1372 /// ImfManager language changed event arguments.
1374 [Obsolete("Please do not use! this will be deprecated")]
1375 public class ImfManagerLanguageChangedEventArgs : EventArgs
1377 public ImfManager ImfManager
1384 private delegate void ImfManagerLanguageChangedEventCallbackType(IntPtr data);
1385 private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
1386 private event EventHandler<ImfManagerLanguageChangedEventArgs> _imfManagerLanguageChangedEventHandler;
1389 /// ImfManager language changed event.
1391 [Obsolete("Please do not use! this will be deprecated")]
1392 public event EventHandler<ImfManagerLanguageChangedEventArgs> ImfManagerLanguageChanged
1396 if (_imfManagerLanguageChangedEventHandler == null)
1398 _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
1399 LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
1402 _imfManagerLanguageChangedEventHandler += value;
1406 _imfManagerLanguageChangedEventHandler -= value;
1408 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
1410 LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
1415 private void OnImfManagerLanguageChanged(IntPtr data)
1417 ImfManagerLanguageChangedEventArgs e = new ImfManagerLanguageChangedEventArgs();
1421 e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
1424 if (_imfManagerLanguageChangedEventHandler != null)
1426 _imfManagerLanguageChangedEventHandler(this, e);
1430 private delegate void LanguageChangedEventCallbackType();
1431 private LanguageChangedEventCallbackType _languageChangedEventCallback;
1432 private event EventHandler _languageChangedEventHandler;
1435 /// ImfManager language changed.
1437 public event EventHandler LanguageChanged
1441 if (_languageChangedEventHandler == null)
1443 _languageChangedEventCallback = OnLanguageChanged;
1444 LanguageChangedSignal().Connect(_languageChangedEventCallback);
1447 _languageChangedEventHandler += value;
1451 _languageChangedEventHandler -= value;
1453 if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
1455 LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
1460 private void OnLanguageChanged()
1462 if (_languageChangedEventHandler != null)
1464 _languageChangedEventHandler(this, null);
1469 /// ImfManager language changed signal.
1471 [Obsolete("Please do not use! this will be internal")]
1472 public ImfVoidSignalType LanguageChangedSignal()
1474 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), false);
1475 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1480 /// ImfManager keyboard type changed event arguments.
1482 public class KeyboardTypeChangedEventArgs : EventArgs
1484 public KeyboardType KeyboardType
1491 private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
1492 private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
1493 private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
1496 /// ImfManager keyboard type changed.
1498 public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
1502 if (_keyboardTypeChangedEventHandler == null)
1504 _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
1505 KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
1508 _keyboardTypeChangedEventHandler += value;
1512 _keyboardTypeChangedEventHandler -= value;
1514 if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
1516 KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
1521 private void OnKeyboardTypeChanged(KeyboardType type)
1523 KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
1525 e.KeyboardType = type;
1527 if (_keyboardTypeChangedEventHandler != null)
1529 _keyboardTypeChangedEventHandler(this, e);
1533 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1535 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1541 /// The direction of text.
1543 public enum TextDirection
1556 /// Events that are generated by the IMF.
1558 public enum ImfEvent
1565 /// Pre-Edit changed.
1569 /// Commit recieved.
1573 /// Event to delete a range of characters from the string.
1577 /// Event to query string and cursor position.
1581 /// Private command sent from the input panel.
1587 /// Enumeration for state of the input panel.
1596 /// Input panel is shown.
1600 /// Input panel is hidden.
1604 /// Input panel in process of being shown.
1610 /// Enumeration for the type of Keyboard.
1612 public enum KeyboardType
1615 /// Software keyboard (Virtual keyboard) is default.
1619 /// Hardware keyboard.