//------------------------------------------------------------------------------ // // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.9 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ namespace Tizen.NUI { /// /// The key structure is used to store a key press. /// public class Key : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; internal Key(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Key obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Key() { DisposeQueue.Instance.Add(this); } public virtual void Dispose() { if (!Stage.IsInstalled()) { DisposeQueue.Instance.Add(this); return; } lock (this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicPINVOKE.delete_Key(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } global::System.GC.SuppressFinalize(this); } } internal static Key GetKeyFromPtr(global::System.IntPtr cPtr) { Key ret = new Key(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public string DeviceName { get { string ret = NDalicPINVOKE.GetDeviceName(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// /// Name given to the key pressed /// public string KeyPressedName { get { return keyPressedName; } } /* duplicated with KeyPressedName : removed public string KeyPressed { get { return keyPressed; } } */ /// /// Keycode for the key pressed. /// public int KeyCode { get { return keyCode; } } /// /// Special keys like shift, alt and control which modify the next key pressed. /// public int KeyModifier { get { return keyModifier; } } /// /// The time (in ms) that the key event occurred. /// public uint Time { get { return time; } } /// /// State of the key event. /// public Key.StateType State { get { return state; } } public DeviceClassType DeviceClass { get { int ret = NDalicPINVOKE.GetDeviceClass(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return (DeviceClassType)ret; } } /// /// Default Constructor. /// public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// Constructor. /// /// The name of the key pressed or command from the IMF, if later then the some following parameters will be needed /// A string of input characters or key pressed /// The unique key code for the key pressed /// The key modifier for special keys like shift and alt /// The time (in ms) that the key event occurred /// The state of the key event public Key(string keyName, string keyString, int keyCode, int keyModifier, uint timeStamp, Key.StateType keyState) : this(NDalicPINVOKE.new_Key__SWIG_1(keyName, keyString, keyCode, keyModifier, timeStamp, (int)keyState), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Key(Key rhs) : this(NDalicPINVOKE.new_Key__SWIG_2(Key.getCPtr(rhs)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Key Assign(Key rhs) { Key ret = new Key(NDalicPINVOKE.Key_Assign(swigCPtr, Key.getCPtr(rhs)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Checks to see if Shift key modifier has been supplied. /// /// True if shift modifier public bool IsShiftModifier() { bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Checks to see if Ctrl (control) key modifier has been supplied. /// /// True if ctrl modifier public bool IsCtrlModifier() { bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Checks to see if Alt key modifier has been supplied. /// /// True if alt modifier public bool IsAltModifier() { bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private string keyPressedName { set { NDalicPINVOKE.Key_keyPressedName_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { string ret = NDalicPINVOKE.Key_keyPressedName_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private string keyPressed { set { NDalicPINVOKE.Key_keyPressed_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { string ret = NDalicPINVOKE.Key_keyPressed_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private int keyCode { set { NDalicPINVOKE.Key_keyCode_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { int ret = NDalicPINVOKE.Key_keyCode_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private int keyModifier { set { NDalicPINVOKE.Key_keyModifier_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { int ret = NDalicPINVOKE.Key_keyModifier_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private uint time { set { NDalicPINVOKE.Key_time_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { uint ret = NDalicPINVOKE.Key_time_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } private Key.StateType state { set { NDalicPINVOKE.Key_state_set(swigCPtr, (int)value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { Key.StateType ret = (Key.StateType)NDalicPINVOKE.Key_state_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// /// Enumeration for specifying the state of the key event. /// public enum StateType { Down, Up, Last } } public enum DeviceClassType { None, Seat, Keyboard, Mouse, Touch, Pen, Pointer, Gamepad } }