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)
62 NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
64 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.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(global::System.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, global::System.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 != global::System.IntPtr.Zero)
150 NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
152 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
158 internal static ImfEventData GetImfEventDataFromPtr(global::System.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 public string PredictiveString
192 NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 /// The name of the event from the IMF.
206 public ImfManager.ImfEvent EventName
210 NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 /// Start position from the current cursor position to start deleting characters.
224 public int CursorOffset
228 NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 /// Number of characters to delete from the cursorOffset.
242 public int NumberOfChars
246 NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 /// Data required by IMF from the callback.
262 public class ImfCallbackData : global::System.IDisposable
264 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
265 protected bool swigCMemOwn;
267 internal IntPtr GetImfCallbackDataPtr()
269 return (IntPtr)swigCPtr;
272 internal ImfCallbackData(global::System.IntPtr cPtr, bool cMemoryOwn)
274 swigCMemOwn = cMemoryOwn;
275 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
278 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
280 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
283 //A Flag to check who called Dispose(). (By User or DisposeQueue)
284 private bool isDisposeQueued = false;
285 //A Flat to check if it is already disposed.
286 protected bool disposed = false;
291 if (!isDisposeQueued)
293 isDisposeQueued = true;
294 DisposeQueue.Instance.Add(this);
301 public void Dispose()
303 //Throw excpetion if Dispose() is called in separate thread.
304 if (!Window.IsInstalled())
306 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
311 Dispose(DisposeTypes.Implicit);
315 Dispose(DisposeTypes.Explicit);
316 System.GC.SuppressFinalize(this);
320 protected virtual void Dispose(DisposeTypes type)
327 if (type == DisposeTypes.Explicit)
330 //Release your own managed resources here.
331 //You should release all of your own disposable objects here.
335 //Release your own unmanaged resources here.
336 //You should not access any managed member here except static instance.
337 //because the execution order of Finalizes is non-deterministic.
339 if (swigCPtr.Handle != global::System.IntPtr.Zero)
344 NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr);
346 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
352 internal static ImfCallbackData GetImfCallbackDataFromPtr(global::System.IntPtr cPtr)
354 ImfCallbackData ret = new ImfCallbackData(cPtr, false);
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360 /// Default Constructor
362 public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
364 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 /// <param name="aUpdate">True if cursor position needs to be updated.</param>
371 /// <param name="aCursorPosition">New position of cursor.</param>
372 /// <param name="aCurrentText">Current text string.</param>
373 /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
374 public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 /// Current text string.
382 public string CurrentText
386 NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
387 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391 string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
398 /// Current text string.
400 public int CursorPosition
404 NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
405 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
409 int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
410 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
416 /// If cursor position needs to be updated.
422 NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
423 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
428 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 /// Flag if preedit reset is required.
436 public bool PreeditResetRequired
440 NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
441 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
445 bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
446 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 /// Retrieve a handle to the instance of ImfManager.
456 /// <returns>A handle to the ImfManager.</returns>
457 public static ImfManager Get()
459 ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
460 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465 /// Activate the IMF.<br/>
466 /// It means that the text editing is started at somewhere.<br/>
467 /// If the H/W keyboard isn't connected then it will show the virtual keyboard.
469 public void Activate()
471 NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
472 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 /// Deactivate the IMF.<br/>
477 /// It means that the text editing is finished at somewhere.
479 public void Deactivate()
481 NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
482 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486 /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.<br/>
487 /// If true then keyboard will be restored (activated) after focus is regained.
489 /// <returns>Restoration status.</returns>
490 public bool RestoreAfterFocusLost()
492 bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
493 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498 /// Set status whether the IMF has to restore the keyboard after losing focus.
500 /// <param name="toggle">True means that keyboard should be restored after focus lost and regained.</param>
501 public void SetRestoreAfterFocusLost(bool toggle)
503 NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
504 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508 /// Send message reset the pred-edit state / imf module.
510 public new void Reset()
512 NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
513 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517 /// Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation.
519 public void NotifyCursorPosition()
521 NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
526 /// Sets cursor position stored in VirtualKeyboard, this is required by the IMF context.
528 /// <param name="cursorPosition">Position of cursor.</param>
529 public void SetCursorPosition(uint cursorPosition)
531 NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536 /// Gets cursor position stored in VirtualKeyboard, this is required by the IMF context.
538 /// <returns>Current position of cursor</returns>
539 public uint GetCursorPosition()
541 uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
542 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547 /// Method to store the string required by the IMF, this is used to provide predictive word suggestions.
549 /// <param name="text">The text string surrounding the current cursor point.</param>
550 public void SetSurroundingText(string text)
552 NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
553 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557 /// Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
559 /// <returns>Surrounding text.</returns>
560 public string GetSurroundingText()
562 string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
563 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
568 /// Notifies IMF context that text input is set to multi line or not.
570 /// <param name="multiLine">True if multiline text input is used.</param>
571 public void NotifyTextInputMultiLine(bool multiLine)
573 NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
578 /// Returns text direction of the keyboard's current input language.
580 /// <returns>The direction of the text.</returns>
581 public ImfManager.TextDirection GetTextDirection()
583 ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
584 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589 /// Provides size and position of keyboard.<br/>
590 /// Position is relative to whether keyboard is visible or not.<br/>
591 /// If keyboard is not visible then position will be off the screen.<br/>
592 /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get<br/>
593 /// the values then taken down. So ideally GetInputMethodArea() should be called after Show().
595 /// <returns>Rectangle which is keyboard panel x, y, width, height</returns>
596 public Rectangle GetInputMethodArea()
598 Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
599 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603 internal void ApplyOptions(InputMethodOptions options)
605 NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
606 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
610 /// Sets up the input-panel specific data.
612 /// <param name="text">The specific data to be set to the input panel.</param>
613 public void SetInputPanelUserData(string text)
615 NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
620 /// Gets the specific data of the current active input panel.
622 /// <param name="text">The specific data to be got from the input panel.</param>
623 public void GetInputPanelUserData(out string text)
625 NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
626 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 /// Gets the state of the current active input panel.
632 /// <returns>The state of the input panel.</returns>
633 public ImfManager.State GetInputPanelState()
635 ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641 /// Sets the return key on the input panel to be visible or invisible.<br/>
642 /// The default is true.
644 /// <param name="visible">True if the return key is visible(enabled), false otherwise.</param>
645 public void SetReturnKeyState(bool visible)
647 NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
648 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 /// Enable to show the input panel automatically when focused.
654 /// <param name="enabled">If true, the input panel will be shown when focused.</param>
655 public void AutoEnableInputPanel(bool enabled)
657 NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
658 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
662 /// Shows the input panel.
664 public void ShowInputPanel()
666 NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
667 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671 /// Hides the input panel.
673 public void HideInputPanel()
675 NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 /// Gets the keyboard type.<br/>
681 /// The default keyboard type is SoftwareKeyboard.
683 /// <returns>The keyboard type</returns>
684 public ImfManager.KeyboardType GetKeyboardType()
686 ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
687 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 /// Gets the current language locale of the input panel.<br/>
693 /// Ex) en_US, en_GB, en_PH, fr_FR, ...
695 /// <returns>The current language locale of the input panel.</returns>
696 public string GetInputPanelLocale()
698 string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
699 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706 public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
708 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
711 internal static ImfManager GetImfManagerFromPtr(global::System.IntPtr cPtr)
713 ImfManager ret = new ImfManager(cPtr, false);
714 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
719 /// ImfManager activated event arguments.
721 public class ImfManagerActivatedEventArgs : EventArgs
723 public ImfManager ImfManager
730 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
731 private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
732 private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
734 private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
737 /// ImfManager activated.
739 public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
743 if (_imfManagerActivatedEventHandler == null)
745 _imfManagerActivatedEventCallback = OnImfManagerActivated;
746 ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
749 _imfManagerActivatedEventHandler += value;
753 _imfManagerActivatedEventHandler -= value;
755 if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
757 ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
762 private void OnImfManagerActivated(global::System.IntPtr data)
764 ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
766 e.ImfManager = ImfManager.GetImfManagerFromPtr(data);
768 if (_imfManagerActivatedEventHandler != null)
770 _imfManagerActivatedEventHandler(this, e);
774 internal ActivatedSignalType ActivatedSignal()
776 ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
777 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
782 /// ImfManager event received event arguments.
784 public class ImfManagerEventReceivedEventArgs : EventArgs
786 public ImfManager ImfManager
792 public ImfEventData ImfEventData
799 private delegate global::System.IntPtr ImfManagerEventReceivedEventCallbackType(global::System.IntPtr imfManager, global::System.IntPtr imfEventData);
800 private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
802 private event EventHandlerWithReturnType<object, ImfManagerEventReceivedEventArgs, ImfCallbackData> _imfManagerEventReceivedEventHandler;
804 /// ImfManager event received.
806 public event EventHandlerWithReturnType<object, ImfManagerEventReceivedEventArgs, ImfCallbackData> ImfManagerEventReceived
810 if (_imfManagerEventReceivedEventHandler == null)
812 _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
813 EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
816 _imfManagerEventReceivedEventHandler += value;
820 _imfManagerEventReceivedEventHandler -= value;
822 if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
824 EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
829 private global::System.IntPtr OnImfManagerEventReceived(global::System.IntPtr imfManager, global::System.IntPtr imfEventData)
831 ImfCallbackData imfCallbackData = null;
833 ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
835 e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager);
836 e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
838 if (_imfManagerEventReceivedEventHandler != null)
840 imfCallbackData = _imfManagerEventReceivedEventHandler(this, e);
842 if (imfCallbackData != null)
844 return imfCallbackData.GetImfCallbackDataPtr();
848 return new ImfCallbackData().GetImfCallbackDataPtr();
852 internal ImfEventSignalType EventReceivedSignal()
854 ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
855 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
860 /// ImfManager status changed event arguments.
862 public class ImfManagerStatusChangedEventArgs : EventArgs
864 public bool StatusChanged
871 private delegate void ImfManagerStatusChangedEventCallbackType(bool statusChanged);
872 private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
874 private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
876 /// ImfManager status changed.
878 public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
882 if (_imfManagerStatusChangedEventHandler == null)
884 _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
885 StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
888 _imfManagerStatusChangedEventHandler += value;
892 _imfManagerStatusChangedEventHandler -= value;
894 if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
896 StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
901 private void OnImfManagerStatusChanged(bool statusChanged)
903 ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
905 e.StatusChanged = statusChanged;
907 if (_imfManagerStatusChangedEventHandler != null)
909 _imfManagerStatusChangedEventHandler(this, e);
913 internal StatusSignalType StatusChangedSignal()
915 StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
916 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
920 private delegate void ImfManagerResizedEventCallbackType();
921 private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
923 private event EventHandler _imfManagerResizedEventHandler;
925 /// ImfManager resized.
927 public event EventHandler ImfManagerResized
931 if (_imfManagerResizedEventHandler == null)
933 _imfManagerResizedEventCallback = OnImfManagerResized;
934 ResizedSignal().Connect(_imfManagerResizedEventCallback);
937 _imfManagerResizedEventHandler += value;
941 _imfManagerResizedEventHandler -= value;
943 if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
945 ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
950 private void OnImfManagerResized()
952 if (_imfManagerResizedEventHandler != null)
954 _imfManagerResizedEventHandler(this, null);
958 internal ImfVoidSignalType ResizedSignal()
960 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), true);
961 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
965 private delegate void ImfManagerLanguageChangedEventCallbackType();
966 private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
968 private event EventHandler _imfManagerLanguageChangedEventHandler;
970 /// ImfManager language changed.
972 public event EventHandler ImfManagerLanguageChanged
976 if (_imfManagerLanguageChangedEventHandler == null)
978 _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
979 LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
982 _imfManagerLanguageChangedEventHandler += value;
986 _imfManagerLanguageChangedEventHandler -= value;
988 if (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
990 LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
995 private void OnImfManagerLanguageChanged()
997 if (_imfManagerLanguageChangedEventHandler != null)
999 _imfManagerLanguageChangedEventHandler(this, null);
1003 internal ImfVoidSignalType LanguageChangedSignal()
1005 ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), true);
1006 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1011 /// ImfManager keyboard type changed event arguments.
1013 public class ImfKeyboardTypeChangedEventArgs : EventArgs
1015 public KeyboardType KeyboardType
1022 private delegate void ImfKeyboardTypeChangedEventCallbackType(KeyboardType type);
1023 private ImfKeyboardTypeChangedEventCallbackType _imfKeyboardTypeChangedEventCallback;
1025 private event EventHandler<ImfKeyboardTypeChangedEventArgs> _imfKeyboardTypeChangedEventHandler;
1027 /// ImfManager keyboard type changed.
1029 public event EventHandler<ImfKeyboardTypeChangedEventArgs> ImfKeyboardTypeChanged
1033 if (_imfKeyboardTypeChangedEventHandler == null)
1035 _imfKeyboardTypeChangedEventCallback = OnImfKeyboardTypeChanged;
1036 KeyboardTypeChangedSignal().Connect(_imfKeyboardTypeChangedEventCallback);
1039 _imfKeyboardTypeChangedEventHandler += value;
1043 _imfKeyboardTypeChangedEventHandler -= value;
1045 if (_imfKeyboardTypeChangedEventHandler == null && _imfKeyboardTypeChangedEventCallback != null)
1047 KeyboardTypeChangedSignal().Disconnect(_imfKeyboardTypeChangedEventCallback);
1052 private void OnImfKeyboardTypeChanged(KeyboardType type)
1054 ImfKeyboardTypeChangedEventArgs e = new ImfKeyboardTypeChangedEventArgs();
1056 e.KeyboardType = type;
1058 if (_imfKeyboardTypeChangedEventHandler != null)
1060 _imfKeyboardTypeChangedEventHandler(this, e);
1064 internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
1066 KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
1067 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072 /// The direction of text.
1074 public enum TextDirection
1087 /// Events that are generated by the IMF.
1089 public enum ImfEvent
1096 /// Pre-Edit changed.
1100 /// Commit recieved.
1104 /// Event to delete a range of characters from the string.
1108 /// Event to query string and cursor position.
1112 /// Private command sent from the input panel.
1118 /// Enumeration for state of the input panel.
1127 /// Input panel is shown.
1131 /// Input panel is hidden.
1135 /// Input panel in process of being shown.
1141 /// Enumeration for the type of Keyboard.
1143 public enum KeyboardType
1146 /// Software keyboard (Virtual keyboard) is default.
1150 /// Hardware keyboard.