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 (swigCPtr.Handle != global::System.IntPtr.Zero)
63 //Unreference this instance from Registry.
64 Registry.Unregister(this);
66 NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
68 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
75 /// This structure is used to pass on data from the IMF regarding predictive text.
77 public class ImfEventData : global::System.IDisposable
79 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
80 protected bool swigCMemOwn;
82 internal ImfEventData(global::System.IntPtr cPtr, bool cMemoryOwn)
84 swigCMemOwn = cMemoryOwn;
85 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
88 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
90 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
93 //A Flag to check who called Dispose(). (By User or DisposeQueue)
94 private bool isDisposeQueued = false;
95 //A Flat to check if it is already disposed.
96 protected bool disposed = false;
101 if (!isDisposeQueued)
103 isDisposeQueued = true;
104 DisposeQueue.Instance.Add(this);
111 public void Dispose()
113 //Throw excpetion if Dispose() is called in separate thread.
114 if (!Window.IsInstalled())
116 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
121 Dispose(DisposeTypes.Implicit);
125 Dispose(DisposeTypes.Explicit);
126 System.GC.SuppressFinalize(this);
130 protected virtual void Dispose(DisposeTypes type)
137 if (type == DisposeTypes.Explicit)
140 //Release your own managed resources here.
141 //You should release all of your own disposable objects here.
145 //Release your own unmanaged resources here.
146 //You should not access any managed member here except static instance.
147 //because the execution order of Finalizes is non-deterministic.
149 if (swigCPtr.Handle != global::System.IntPtr.Zero)
154 NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
156 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
162 internal static ImfEventData GetImfEventDataFromPtr(global::System.IntPtr cPtr)
164 ImfEventData ret = new ImfEventData(cPtr, false);
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 /// Default Constructor
172 public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 /// <param name="aEventName">The name of the event from the IMF.</param>
181 /// <param name="aPredictiveString">The pre-edit or commit string.</param>
182 /// <param name="aCursorOffset">Start position from the current cursor position to start deleting characters.</param>
183 /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
184 public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 /// The pre-edit or commit string.
192 public string PredictiveString
196 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 /// The name of the event from the IMF.
210 public ImfManager.ImfEvent EventName
214 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 /// Start position from the current cursor position to start deleting characters.
228 public int CursorOffset
232 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 /// Number of characters to delete from the cursorOffset.
246 public int NumberOfChars
250 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 /// Data required by IMF from the callback.
266 public class ImfCallbackData : global::System.IDisposable
268 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
269 protected bool swigCMemOwn;
271 internal ImfCallbackData(global::System.IntPtr cPtr, bool cMemoryOwn)
273 swigCMemOwn = cMemoryOwn;
274 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
277 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
279 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
282 //A Flag to check who called Dispose(). (By User or DisposeQueue)
283 private bool isDisposeQueued = false;
284 //A Flat to check if it is already disposed.
285 protected bool disposed = false;
290 if (!isDisposeQueued)
292 isDisposeQueued = true;
293 DisposeQueue.Instance.Add(this);
300 public void Dispose()
302 //Throw excpetion if Dispose() is called in separate thread.
303 if (!Window.IsInstalled())
305 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
310 Dispose(DisposeTypes.Implicit);
314 Dispose(DisposeTypes.Explicit);
315 System.GC.SuppressFinalize(this);
319 protected virtual void Dispose(DisposeTypes type)
326 if (type == DisposeTypes.Explicit)
329 //Release your own managed resources here.
330 //You should release all of your own disposable objects here.
334 //Release your own unmanaged resources here.
335 //You should not access any managed member here except static instance.
336 //because the execution order of Finalizes is non-deterministic.
338 if (swigCPtr.Handle != global::System.IntPtr.Zero)
343 NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
345 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
351 internal static ImfCallbackData GetImfCallbackDataFromPtr(global::System.IntPtr cPtr)
353 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
359 /// Default Constructor
361 public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
369 /// <param name="aUpdate">True if cursor position needs to be updated.</param>
370 /// <param name="aCursorPosition">New position of cursor.</param>
371 /// <param name="aCurrentText">Current text string.</param>
372 /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
373 public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 /// Current text string.
381 public string CurrentText
385 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
397 /// Current text string.
399 public int CursorPosition
403 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
404 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
409 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415 /// If cursor position needs to be updated.
421 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
422 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
426 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433 /// Flag if preedit reset is required.
435 public bool PreeditResetRequired
439 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
445 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453 /// Retrieve a handle to the instance of ImfManager.
455 /// <returns>A handle to the ImfManager.</returns>
456 public static ImfManager Get()
458 ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
459 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464 /// Activate the IMF.<br/>
465 /// It means that the text editing is started at somewhere.<br/>
466 /// If the H/W keyboard isn't connected then it will show the virtual keyboard.
468 public void Activate()
470 NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
471 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
475 /// Deactivate the IMF.<br/>
476 /// It means that the text editing is finished at somewhere.
478 public void Deactivate()
480 NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
481 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485 /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.<br/>
486 /// If true then keyboard will be restored (activated) after focus is regained.
488 /// <returns>Restoration status.</returns>
489 public bool RestoreAfterFocusLost()
491 bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
492 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497 /// Set status whether the IMF has to restore the keyboard after losing focus.
499 /// <param name="toggle">True means that keyboard should be restored after focus lost and regained.</param>
500 public void SetRestoreAfterFocusLost(bool toggle)
502 NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
503 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
507 /// Send message reset the pred-edit state / imf module.
509 public new void Reset()
511 NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
512 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
516 /// Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation.
518 public void NotifyCursorPosition()
520 NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
521 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525 /// Sets cursor position stored in VirtualKeyboard, this is required by the IMF context.
527 /// <param name="cursorPosition">Position of cursor.</param>
528 public void SetCursorPosition(uint cursorPosition)
530 NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
531 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535 /// Gets cursor position stored in VirtualKeyboard, this is required by the IMF context.
537 /// <returns>Current position of cursor</returns>
538 public uint GetCursorPosition()
540 uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
546 /// Method to store the string required by the IMF, this is used to provide predictive word suggestions.
548 /// <param name="text">The text string surrounding the current cursor point.</param>
549 public void SetSurroundingText(string text)
551 NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
552 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
556 /// Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
558 /// <returns>Surrounding text.</returns>
559 public string GetSurroundingText()
561 string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567 /// Notifies IMF context that text input is set to multi line or not.
569 /// <param name="multiLine">True if multiline text input is used.</param>
570 public void NotifyTextInputMultiLine(bool multiLine)
572 NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
573 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
577 /// Returns text direction of the keyboard's current input language.
579 /// <returns>The direction of the text.</returns>
580 public ImfManager.TextDirection GetTextDirection()
582 ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
588 /// Provides size and position of keyboard.<br/>
589 /// Position is relative to whether keyboard is visible or not.<br/>
590 /// If keyboard is not visible then position will be off the screen.<br/>
591 /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get<br/>
592 /// the values then taken down. So ideally GetInputMethodArea() should be called after Show().
594 /// <returns>Rectangle which is keyboard panel x, y, width, height</returns>
595 public Rectangle GetInputMethodArea()
597 Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 internal void ApplyOptions(InputMethodOptions options)
604 NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609 /// Sets up the input-panel specific data.
611 /// <param name="text">The specific data to be set to the input panel.</param>
612 public void SetInputPanelUserData(string text)
614 NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
615 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619 /// Gets the specific data of the current active input panel.
621 /// <param name="text">The specific data to be got from the input panel.</param>
622 public void GetInputPanelUserData(out string text)
624 NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
629 /// Gets the state of the current active input panel.
631 /// <returns>The state of the input panel.</returns>
632 public ImfManager.State GetInputPanelState()
634 ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
635 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 /// Sets the return key on the input panel to be visible or invisible.<br/>
641 /// The default is true.
643 /// <param name="visible">True if the return key is visible(enabled), false otherwise.</param>
644 public void SetReturnKeyState(bool visible)
646 NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
647 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651 /// Enable to show the input panel automatically when focused.
653 /// <param name="enabled">If true, the input panel will be shown when focused.</param>
654 public void AutoEnableInputPanel(bool enabled)
656 NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
657 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661 /// Shows the input panel.
663 public void ShowInputPanel()
665 NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
666 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
670 /// Hides the input panel.
672 public void HideInputPanel()
674 NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
675 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679 /// Gets the keyboard type.<br/>
680 /// The default keyboard type is SoftwareKeyboard.
682 /// <returns>The keyboard type</returns>
683 public ImfManager.KeyboardType GetKeyboardType()
685 ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691 /// Gets the current language locale of the input panel.<br/>
692 /// Ex) en_US, en_GB, en_PH, fr_FR, ...
694 /// <returns>The current language locale of the input panel.</returns>
695 public string GetInputPanelLocale()
697 string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
698 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
705 public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
707 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 internal static ImfManager GetImfManagerFromPtr(global::System.IntPtr cPtr)
712 ImfManager ret = new ImfManager(cPtr, false);
713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
718 /// ImfManager activated event arguments.
720 public class ImfManagerActivatedEventArgs : EventArgs
722 public ImfManager ImfManager
729 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
730 private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
731 private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
733 private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
736 /// ImfManager activated.
738 public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
742 if (_imfManagerActivatedEventHandler == null)
744 _imfManagerActivatedEventCallback = OnImfManagerActivated;
745 ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
748 _imfManagerActivatedEventHandler += value;
752 _imfManagerActivatedEventHandler -= value;
754 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
756 ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
761 private void OnImfManagerActivated(global::System.IntPtr data)
763 ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
765 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
767 if (_imfManagerActivatedEventHandler != null)
769 _imfManagerActivatedEventHandler(this, e);
773 internal ActivatedSignalType ActivatedSignal()
775 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
776 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 /// ImfManager event received event arguments.
783 public class ImfManagerEventReceivedEventArgs : EventArgs
785 public ImfManager ImfManager
791 public ImfEventData ImfEventData
798 private delegate ImfCallbackData ImfManagerEventReceivedEventCallbackType(global::System.IntPtr imfManager, global::System.IntPtr imfEventData);
799 private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
801 private event EventHandlerWithReturnType<object, ImfManagerEventReceivedEventArgs, ImfCallbackData> _imfManagerEventReceivedEventHandler;
803 /// ImfManager event received.
805 public event EventHandlerWithReturnType<object, ImfManagerEventReceivedEventArgs, ImfCallbackData> ImfManagerEventReceived
809 if (_imfManagerEventReceivedEventHandler == null)
811 _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
812 EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
815 _imfManagerEventReceivedEventHandler += value;
819 _imfManagerEventReceivedEventHandler -= value;
821 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
823 EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
828 private ImfCallbackData OnImfManagerEventReceived(global::System.IntPtr imfManager, global::System.IntPtr imfEventData)
830 ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
832 e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager);
833 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
835 if (_imfManagerEventReceivedEventHandler != null)
837 return _imfManagerEventReceivedEventHandler(this, e);
842 internal ImfEventSignalType EventReceivedSignal()
844 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
850 /// ImfManager status changed event arguments.
852 public class ImfManagerStatusChangedEventArgs : EventArgs
854 public bool StatusChanged
861 private delegate void ImfManagerStatusChangedEventCallbackType(bool statusChanged);
862 private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
864 private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
866 /// ImfManager status changed.
868 public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
872 if (_imfManagerStatusChangedEventHandler == null)
874 _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
875 StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
878 _imfManagerStatusChangedEventHandler += value;
882 _imfManagerStatusChangedEventHandler -= value;
884 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
886 StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
891 private void OnImfManagerStatusChanged(bool statusChanged)
893 ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
895 e.StatusChanged = statusChanged;
897 if (_imfManagerStatusChangedEventHandler != null)
899 _imfManagerStatusChangedEventHandler(this, e);
903 internal StatusSignalType StatusChangedSignal()
905 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
906 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
910 private delegate void ImfManagerResizedEventCallbackType();
911 private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
913 private event EventHandler _imfManagerResizedEventHandler;
915 /// ImfManager resized.
917 public event EventHandler ImfManagerResized
921 if (_imfManagerResizedEventHandler == null)
923 _imfManagerResizedEventCallback = OnImfManagerResized;
924 ResizedSignal().Connect(_imfManagerResizedEventCallback);
927 _imfManagerResizedEventHandler += value;
931 _imfManagerResizedEventHandler -= value;
933 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
935 ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
940 private void OnImfManagerResized()
942 if (_imfManagerResizedEventHandler != null)
944 _imfManagerResizedEventHandler(this, null);
948 internal ImfVoidSignalType ResizedSignal()
950 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), true);
951 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
955 private delegate void ImfManagerLanguageChangedEventCallbackType();
956 private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
958 private event EventHandler _imfManagerLanguageChangedEventHandler;
960 /// ImfManager language changed.
962 public event EventHandler ImfManagerLanguageChanged
966 if (_imfManagerLanguageChangedEventHandler == null)
968 _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
969 LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
972 _imfManagerLanguageChangedEventHandler += value;
976 _imfManagerLanguageChangedEventHandler -= value;
978 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
980 LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
985 private void OnImfManagerLanguageChanged()
987 if (_imfManagerLanguageChangedEventHandler != null)
989 _imfManagerLanguageChangedEventHandler(this, null);
993 internal ImfVoidSignalType LanguageChangedSignal()
995 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), true);
996 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1001 /// ImfManager keyboard type changed event arguments.
1003 public class ImfKeyboardTypeChangedEventArgs : EventArgs
1005 public KeyboardType KeyboardType
1012 private delegate void ImfKeyboardTypeChangedEventCallbackType(KeyboardType type);
1013 private ImfKeyboardTypeChangedEventCallbackType _imfKeyboardTypeChangedEventCallback;
1015 private event EventHandler<ImfKeyboardTypeChangedEventArgs> _imfKeyboardTypeChangedEventHandler;
1017 /// ImfManager keyboard type changed.
1019 public event EventHandler<ImfKeyboardTypeChangedEventArgs> ImfKeyboardTypeChanged
1023 if (_imfKeyboardTypeChangedEventHandler == null)
1025 _imfKeyboardTypeChangedEventCallback = OnImfKeyboardTypeChanged;
1026 KeyboardTypeChangedSignal().Connect(_imfKeyboardTypeChangedEventCallback);
1029 _imfKeyboardTypeChangedEventHandler += value;
1033 _imfKeyboardTypeChangedEventHandler -= value;
1035 if (_imfKeyboardTypeChangedEventHandler == null && _imfKeyboardTypeChangedEventCallback != null)
1037 KeyboardTypeChangedSignal().Disconnect(_imfKeyboardTypeChangedEventCallback);
1042 private void OnImfKeyboardTypeChanged(KeyboardType type)
1044 ImfKeyboardTypeChangedEventArgs e = new ImfKeyboardTypeChangedEventArgs();
1046 e.KeyboardType = type;
1048 if (_imfKeyboardTypeChangedEventHandler != null)
1050 _imfKeyboardTypeChangedEventHandler(this, e);
1054 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1056 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1057 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1062 /// The direction of text.
1064 public enum TextDirection
1077 /// Events that are generated by the IMF.
1079 public enum ImfEvent
1086 /// Pre-Edit changed.
1090 /// Commit recieved.
1094 /// Event to delete a range of characters from the string.
1098 /// Event to query string and cursor position.
1102 /// Private command sent from the input panel.
1108 /// Enumeration for state of the input panel.
1117 /// Input panel is shown.
1121 /// Input panel is hidden.
1125 /// Input panel in process of being shown.
1131 /// Enumeration for the type of Keyboard.
1133 public enum KeyboardType
1136 /// Software keyboard (Virtual keyboard) is default.
1140 /// Hardware keyboard.