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(global::System.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, global::System.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, global::System.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(global::System.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, global::System.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 != global::System.IntPtr.Zero)
180 NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
182 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
188 internal static ImfEventData GetImfEventDataFromPtr(global::System.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 public string PredictiveString
222 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 /// The name of the event from the IMF.
236 public ImfManager.ImfEvent EventName
240 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 /// Start position from the current cursor position to start deleting characters.
254 public int CursorOffset
258 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 /// Number of characters to delete from the cursorOffset.
272 public int NumberOfChars
276 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 /// Data required by IMF from the callback.
292 public class ImfCallbackData : global::System.IDisposable
294 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
295 protected bool swigCMemOwn;
297 internal IntPtr GetImfCallbackDataPtr()
299 return (IntPtr)swigCPtr;
302 internal ImfCallbackData(global::System.IntPtr cPtr, bool cMemoryOwn)
304 swigCMemOwn = cMemoryOwn;
305 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
308 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
310 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
313 //A Flag to check who called Dispose(). (By User or DisposeQueue)
314 private bool isDisposeQueued = false;
315 //A Flat to check if it is already disposed.
316 protected bool disposed = false;
321 if (!isDisposeQueued)
323 isDisposeQueued = true;
324 DisposeQueue.Instance.Add(this);
331 public void Dispose()
333 //Throw excpetion if Dispose() is called in separate thread.
334 if (!Window.IsInstalled())
336 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
341 Dispose(DisposeTypes.Implicit);
345 Dispose(DisposeTypes.Explicit);
346 System.GC.SuppressFinalize(this);
350 protected virtual void Dispose(DisposeTypes type)
357 if (type == DisposeTypes.Explicit)
360 //Release your own managed resources here.
361 //You should release all of your own disposable objects here.
365 //Release your own unmanaged resources here.
366 //You should not access any managed member here except static instance.
367 //because the execution order of Finalizes is non-deterministic.
369 if (swigCPtr.Handle != global::System.IntPtr.Zero)
374 NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
376 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
382 internal static ImfCallbackData GetImfCallbackDataFromPtr(global::System.IntPtr cPtr)
384 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390 /// Default Constructor
392 public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
394 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 /// <param name="aUpdate">True if cursor position needs to be updated.</param>
401 /// <param name="aCursorPosition">New position of cursor.</param>
402 /// <param name="aCurrentText">Current text string.</param>
403 /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
404 public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
406 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410 /// Current text string.
412 public string CurrentText
416 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
421 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
422 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428 /// Current text string.
430 public int CursorPosition
434 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
435 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 /// If cursor position needs to be updated.
452 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
453 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
457 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
458 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464 /// Flag if preedit reset is required.
466 public bool PreeditResetRequired
470 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
471 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
475 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
476 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
484 /// Retrieve a handle to the instance of ImfManager.
486 /// <returns>A handle to the ImfManager.</returns>
487 public static ImfManager Get()
489 ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495 /// Activate the IMF.<br/>
496 /// It means that the text editing is started at somewhere.<br/>
497 /// If the H/W keyboard isn't connected then it will show the virtual keyboard.
499 public void Activate()
501 NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
506 /// Deactivate the IMF.<br/>
507 /// It means that the text editing is finished at somewhere.
509 public void Deactivate()
511 NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
512 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516 /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.<br/>
517 /// If true then keyboard will be restored (activated) after focus is regained.
519 /// <returns>Restoration status.</returns>
520 public bool RestoreAfterFocusLost()
522 bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
523 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
528 /// Set status whether the IMF has to restore the keyboard after losing focus.
530 /// <param name="toggle">True means that keyboard should be restored after focus lost and regained.</param>
531 public void SetRestoreAfterFocusLost(bool toggle)
533 NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
534 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538 /// Send message reset the pred-edit state / imf module.
540 public new void Reset()
542 NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
543 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547 /// Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation.
549 public void NotifyCursorPosition()
551 NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
552 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
556 /// Sets cursor position stored in VirtualKeyboard, this is required by the IMF context.
558 /// <param name="cursorPosition">Position of cursor.</param>
559 public void SetCursorPosition(uint cursorPosition)
561 NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 /// Gets cursor position stored in VirtualKeyboard, this is required by the IMF context.
568 /// <returns>Current position of cursor</returns>
569 public uint GetCursorPosition()
571 uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
577 /// Method to store the string required by the IMF, this is used to provide predictive word suggestions.
579 /// <param name="text">The text string surrounding the current cursor point.</param>
580 public void SetSurroundingText(string text)
582 NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587 /// Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
589 /// <returns>Surrounding text.</returns>
590 public string GetSurroundingText()
592 string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
593 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598 /// Notifies IMF context that text input is set to multi line or not.
600 /// <param name="multiLine">True if multiline text input is used.</param>
601 public void NotifyTextInputMultiLine(bool multiLine)
603 NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
604 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
608 /// Returns text direction of the keyboard's current input language.
610 /// <returns>The direction of the text.</returns>
611 public ImfManager.TextDirection GetTextDirection()
613 ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619 /// Provides size and position of keyboard.<br/>
620 /// Position is relative to whether keyboard is visible or not.<br/>
621 /// If keyboard is not visible then position will be off the screen.<br/>
622 /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get<br/>
623 /// the values then taken down. So ideally GetInputMethodArea() should be called after Show().
625 /// <returns>Rectangle which is keyboard panel x, y, width, height</returns>
626 public Rectangle GetInputMethodArea()
628 Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
629 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633 internal void ApplyOptions(InputMethodOptions options)
635 NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 /// Sets up the input-panel specific data.
642 /// <param name="text">The specific data to be set to the input panel.</param>
643 public void SetInputPanelUserData(string text)
645 NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
646 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
650 /// Gets the specific data of the current active input panel.
652 /// <param name="text">The specific data to be got from the input panel.</param>
653 public void GetInputPanelUserData(out string text)
655 NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
656 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
660 /// Gets the state of the current active input panel.
662 /// <returns>The state of the input panel.</returns>
663 public ImfManager.State GetInputPanelState()
665 ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
666 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671 /// Sets the return key on the input panel to be visible or invisible.<br/>
672 /// The default is true.
674 /// <param name="visible">True if the return key is visible(enabled), false otherwise.</param>
675 public void SetReturnKeyState(bool visible)
677 NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
678 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
682 /// Enable to show the input panel automatically when focused.
684 /// <param name="enabled">If true, the input panel will be shown when focused.</param>
685 public void AutoEnableInputPanel(bool enabled)
687 NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 /// Shows the input panel.
694 public void ShowInputPanel()
696 NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
697 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
701 /// Hides the input panel.
703 public void HideInputPanel()
705 NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
706 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 /// Gets the keyboard type.<br/>
711 /// The default keyboard type is SoftwareKeyboard.
713 /// <returns>The keyboard type</returns>
714 public ImfManager.KeyboardType GetKeyboardType()
716 ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
717 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
722 /// Gets the current language locale of the input panel.<br/>
723 /// Ex) en_US, en_GB, en_PH, fr_FR, ...
725 /// <returns>The current language locale of the input panel.</returns>
726 public string GetInputPanelLocale()
728 string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
729 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
736 public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
738 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
741 internal static ImfManager GetImfManagerFromPtr(global::System.IntPtr cPtr)
743 ImfManager ret = new ImfManager(cPtr, false);
744 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
749 /// ImfManager activated event arguments.
751 public class ImfManagerActivatedEventArgs : EventArgs
753 public ImfManager ImfManager
760 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
761 private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
762 private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
764 private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
767 /// ImfManager activated.
769 public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
773 if (_imfManagerActivatedEventHandler == null)
775 _imfManagerActivatedEventCallback = OnImfManagerActivated;
776 ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
779 _imfManagerActivatedEventHandler += value;
783 _imfManagerActivatedEventHandler -= value;
785 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
787 ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
792 private void OnImfManagerActivated(global::System.IntPtr data)
794 ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
796 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
798 if (_imfManagerActivatedEventHandler != null)
800 _imfManagerActivatedEventHandler(this, e);
804 internal ActivatedSignalType ActivatedSignal()
806 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
807 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
812 /// ImfManager event received event arguments.
814 public class ImfManagerEventReceivedEventArgs : EventArgs
816 public ImfManager ImfManager
822 public ImfEventData ImfEventData
829 private delegate global::System.IntPtr ImfManagerEventReceivedEventCallbackType(global::System.IntPtr imfManager, global::System.IntPtr imfEventData);
830 private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
832 private event EventHandlerWithReturnType<object, ImfManagerEventReceivedEventArgs, ImfCallbackData> _imfManagerEventReceivedEventHandler;
834 /// ImfManager event received.
836 public event EventHandlerWithReturnType<object, ImfManagerEventReceivedEventArgs, ImfCallbackData> ImfManagerEventReceived
840 if (_imfManagerEventReceivedEventHandler == null)
842 _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
843 EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
846 _imfManagerEventReceivedEventHandler += value;
850 _imfManagerEventReceivedEventHandler -= value;
852 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
854 EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
859 private global::System.IntPtr OnImfManagerEventReceived(global::System.IntPtr imfManager, global::System.IntPtr imfEventData)
861 ImfCallbackData imfCallbackData = null;
863 ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
865 e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager);
866 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
868 if (_imfManagerEventReceivedEventHandler != null)
870 imfCallbackData = _imfManagerEventReceivedEventHandler(this, e);
872 if (imfCallbackData != null)
874 return imfCallbackData.GetImfCallbackDataPtr();
878 return new ImfCallbackData().GetImfCallbackDataPtr();
882 internal ImfEventSignalType EventReceivedSignal()
884 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
885 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
890 /// ImfManager status changed event arguments.
892 public class ImfManagerStatusChangedEventArgs : EventArgs
894 public bool StatusChanged
901 private delegate void ImfManagerStatusChangedEventCallbackType(bool statusChanged);
902 private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
904 private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
906 /// ImfManager status changed.
908 public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
912 if (_imfManagerStatusChangedEventHandler == null)
914 _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
915 StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
918 _imfManagerStatusChangedEventHandler += value;
922 _imfManagerStatusChangedEventHandler -= value;
924 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
926 StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
931 private void OnImfManagerStatusChanged(bool statusChanged)
933 ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
935 e.StatusChanged = statusChanged;
937 if (_imfManagerStatusChangedEventHandler != null)
939 _imfManagerStatusChangedEventHandler(this, e);
943 internal StatusSignalType StatusChangedSignal()
945 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
946 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
950 private delegate void ImfManagerResizedEventCallbackType();
951 private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
953 private event EventHandler _imfManagerResizedEventHandler;
955 /// ImfManager resized.
957 public event EventHandler ImfManagerResized
961 if (_imfManagerResizedEventHandler == null)
963 _imfManagerResizedEventCallback = OnImfManagerResized;
964 ResizedSignal().Connect(_imfManagerResizedEventCallback);
967 _imfManagerResizedEventHandler += value;
971 _imfManagerResizedEventHandler -= value;
973 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
975 ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
980 private void OnImfManagerResized()
982 if (_imfManagerResizedEventHandler != null)
984 _imfManagerResizedEventHandler(this, null);
988 internal ImfVoidSignalType ResizedSignal()
990 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), true);
991 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
995 private delegate void ImfManagerLanguageChangedEventCallbackType();
996 private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
998 private event EventHandler _imfManagerLanguageChangedEventHandler;
1000 /// ImfManager language changed.
1002 public event EventHandler ImfManagerLanguageChanged
1006 if (_imfManagerLanguageChangedEventHandler == null)
1008 _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
1009 LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
1012 _imfManagerLanguageChangedEventHandler += value;
1016 _imfManagerLanguageChangedEventHandler -= value;
1018 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
1020 LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
1025 private void OnImfManagerLanguageChanged()
1027 if (_imfManagerLanguageChangedEventHandler != null)
1029 _imfManagerLanguageChangedEventHandler(this, null);
1033 internal ImfVoidSignalType LanguageChangedSignal()
1035 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), true);
1036 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1041 /// ImfManager keyboard type changed event arguments.
1043 public class ImfKeyboardTypeChangedEventArgs : EventArgs
1045 public KeyboardType KeyboardType
1052 private delegate void ImfKeyboardTypeChangedEventCallbackType(KeyboardType type);
1053 private ImfKeyboardTypeChangedEventCallbackType _imfKeyboardTypeChangedEventCallback;
1055 private event EventHandler<ImfKeyboardTypeChangedEventArgs> _imfKeyboardTypeChangedEventHandler;
1057 /// ImfManager keyboard type changed.
1059 public event EventHandler<ImfKeyboardTypeChangedEventArgs> ImfKeyboardTypeChanged
1063 if (_imfKeyboardTypeChangedEventHandler == null)
1065 _imfKeyboardTypeChangedEventCallback = OnImfKeyboardTypeChanged;
1066 KeyboardTypeChangedSignal().Connect(_imfKeyboardTypeChangedEventCallback);
1069 _imfKeyboardTypeChangedEventHandler += value;
1073 _imfKeyboardTypeChangedEventHandler -= value;
1075 if (_imfKeyboardTypeChangedEventHandler == null && _imfKeyboardTypeChangedEventCallback != null)
1077 KeyboardTypeChangedSignal().Disconnect(_imfKeyboardTypeChangedEventCallback);
1082 private void OnImfKeyboardTypeChanged(KeyboardType type)
1084 ImfKeyboardTypeChangedEventArgs e = new ImfKeyboardTypeChangedEventArgs();
1086 e.KeyboardType = type;
1088 if (_imfKeyboardTypeChangedEventHandler != null)
1090 _imfKeyboardTypeChangedEventHandler(this, e);
1094 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1096 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1097 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1102 /// The direction of text.
1104 public enum TextDirection
1117 /// Events that are generated by the IMF.
1119 public enum ImfEvent
1126 /// Pre-Edit changed.
1130 /// Commit recieved.
1134 /// Event to delete a range of characters from the string.
1138 /// Event to query string and cursor position.
1142 /// Private command sent from the input panel.
1148 /// Enumeration for state of the input panel.
1157 /// Input panel is shown.
1161 /// Input panel is hidden.
1165 /// Input panel in process of being shown.
1171 /// Enumeration for the type of Keyboard.
1173 public enum KeyboardType
1176 /// Software keyboard (Virtual keyboard) is default.
1180 /// Hardware keyboard.