1.[NUI 276] c# nui visual high level class refactorying.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Key.cs
index 66b05bf..33b0b71 100755 (executable)
-// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved\r
-// PROPRIETARY/CONFIDENTIAL \r
-// This software is the confidential and proprietary\r
-// information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall\r
-// not disclose such Confidential Information and shall use it only in\r
-// accordance with the terms of the license agreement you entered into with\r
-// SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the\r
-// suitability of the software, either express or implied, including but not\r
-// limited to the implied warranties of merchantability, fitness for a\r
-// particular purpose, or non-infringement. SAMSUNG shall not be liable for any\r
-// damages suffered by licensee as a result of using, modifying or distributing\r
-// this software or its derivatives.\r
-\r
-// Copyright (c) 2017 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Apache License, Version 2.0 (the "License");\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-// http://www.apache.org/licenses/LICENSE-2.0\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an "AS IS" BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-//\r
-\r
-// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts\r
-// Some have been manually changed\r
-\r
-namespace Tizen.NUI\r
-{\r
-\r
-    public class Key : global::System.IDisposable\r
-    {\r
-        private global::System.Runtime.InteropServices.HandleRef swigCPtr;\r
-        protected bool swigCMemOwn;\r
-\r
-        internal Key(global::System.IntPtr cPtr, bool cMemoryOwn)\r
-        {\r
-            swigCMemOwn = cMemoryOwn;\r
-            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);\r
-        }\r
-\r
-        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Key obj)\r
-        {\r
-            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;\r
-        }\r
-\r
-        ~Key()\r
-        {\r
-            DisposeQueue.Instance.Add(this);\r
-        }\r
-\r
-        public virtual void Dispose()\r
-        {\r
-            if (!Stage.IsInstalled())\r
-            {\r
-                DisposeQueue.Instance.Add(this);\r
-                return;\r
-            }\r
-\r
-            lock (this)\r
-            {\r
-                if (swigCPtr.Handle != global::System.IntPtr.Zero)\r
-                {\r
-                    if (swigCMemOwn)\r
-                    {\r
-                        swigCMemOwn = false;\r
-                        NDalicPINVOKE.delete_Key(swigCPtr);\r
-                    }\r
-                    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);\r
-                }\r
-                global::System.GC.SuppressFinalize(this);\r
-            }\r
-        }\r
-\r
-\r
-        internal static Key GetKeyFromPtr(global::System.IntPtr cPtr)\r
-        {\r
-            Key ret = new Key(cPtr, false);\r
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            return ret;\r
-        }\r
-\r
-        public string KeyPressedName\r
-        {\r
-            get\r
-            {\r
-                return keyPressedName;\r
-            }\r
-        }\r
-\r
-        public string KeyPressed\r
-        {\r
-            get\r
-            {\r
-                return keyPressed;\r
-            }\r
-        }\r
-\r
-        public int KeyCode\r
-        {\r
-            get\r
-            {\r
-                return keyCode;\r
-            }\r
-        }\r
-\r
-        public int KeyModifier\r
-        {\r
-            get\r
-            {\r
-                return keyModifier;\r
-            }\r
-        }\r
-\r
-        public uint Time\r
-        {\r
-            get\r
-            {\r
-                return time;\r
-            }\r
-        }\r
-\r
-        public Key.StateType State\r
-        {\r
-            get\r
-            {\r
-                return state;\r
-            }\r
-        }\r
-\r
-        public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true)\r
-        {\r
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-        }\r
-\r
-        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)\r
-        {\r
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-        }\r
-\r
-        public bool IsShiftModifier()\r
-        {\r
-            bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr);\r
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            return ret;\r
-        }\r
-\r
-        public bool IsCtrlModifier()\r
-        {\r
-            bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr);\r
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            return ret;\r
-        }\r
-\r
-        public bool IsAltModifier()\r
-        {\r
-            bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr);\r
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            return ret;\r
-        }\r
-\r
-        private string keyPressedName\r
-        {\r
-            set\r
-            {\r
-                NDalicPINVOKE.Key_keyPressedName_set(swigCPtr, value);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            }\r
-            get\r
-            {\r
-                string ret = NDalicPINVOKE.Key_keyPressedName_get(swigCPtr);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-                return ret;\r
-            }\r
-        }\r
-\r
-        private string keyPressed\r
-        {\r
-            set\r
-            {\r
-                NDalicPINVOKE.Key_keyPressed_set(swigCPtr, value);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            }\r
-            get\r
-            {\r
-                string ret = NDalicPINVOKE.Key_keyPressed_get(swigCPtr);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-                return ret;\r
-            }\r
-        }\r
-\r
-        private int keyCode\r
-        {\r
-            set\r
-            {\r
-                NDalicPINVOKE.Key_keyCode_set(swigCPtr, value);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            }\r
-            get\r
-            {\r
-                int ret = NDalicPINVOKE.Key_keyCode_get(swigCPtr);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-                return ret;\r
-            }\r
-        }\r
-\r
-        private int keyModifier\r
-        {\r
-            set\r
-            {\r
-                NDalicPINVOKE.Key_keyModifier_set(swigCPtr, value);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            }\r
-            get\r
-            {\r
-                int ret = NDalicPINVOKE.Key_keyModifier_get(swigCPtr);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-                return ret;\r
-            }\r
-        }\r
-\r
-        private uint time\r
-        {\r
-            set\r
-            {\r
-                NDalicPINVOKE.Key_time_set(swigCPtr, value);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            }\r
-            get\r
-            {\r
-                uint ret = NDalicPINVOKE.Key_time_get(swigCPtr);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-                return ret;\r
-            }\r
-        }\r
-\r
-        private Key.StateType state\r
-        {\r
-            set\r
-            {\r
-                NDalicPINVOKE.Key_state_set(swigCPtr, (int)value);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-            }\r
-            get\r
-            {\r
-                Key.StateType ret = (Key.StateType)NDalicPINVOKE.Key_state_get(swigCPtr);\r
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
-                return ret;\r
-            }\r
-        }\r
-\r
-        public enum StateType\r
-        {\r
-            Down,\r
-            Up,\r
-            Last\r
-        }\r
-\r
-    }\r
-\r
-}\r
+//------------------------------------------------------------------------------
+// <auto-generated />
+//
+// 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
+{
+
+    /// <summary>
+    /// The key structure is used to store a key press.
+    /// </summary> 
+    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;
+            }
+        }
+
+        /// <summary>
+        /// Name given to the key pressed
+        /// </summary> 
+        public string KeyPressedName
+        {
+            get
+            {
+                return keyPressedName;
+            }
+        }
+
+        /* duplicated with KeyPressedName : removed
+        public string KeyPressed
+        {
+            get
+            {
+                return keyPressed;
+            }
+        }
+        */
+
+        /// <summary>
+        /// Keycode for the key pressed.
+        /// </summary> 
+        public int KeyCode
+        {
+            get
+            {
+                return keyCode;
+            }
+        }
+
+        /// <summary>
+        /// Special keys like shift, alt and control which modify the next key pressed.
+        /// </summary> 
+        public int KeyModifier
+        {
+            get
+            {
+                return keyModifier;
+            }
+        }
+
+        /// <summary>
+        /// The time (in ms) that the key event occurred.
+        /// </summary> 
+        public uint Time
+        {
+            get
+            {
+                return time;
+            }
+        }
+
+        /// <summary>
+        /// State of the key event.
+        /// </summary> 
+        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;
+            }
+        }
+
+
+        /// <summary>
+        /// Default Constructor.
+        /// </summary> 
+        public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        /// <param name="keyName">The name of the key pressed or command from the IMF, if later then the some following parameters will be needed</param>
+        /// <param name="keyString">A string of input characters or key pressed</param>
+        /// <param name="keyCode">The unique key code for the key pressed</param>
+        /// <param name="keyModifier">The key modifier for special keys like shift and alt</param>
+        /// <param name="timeStamp">The time (in ms) that the key event occurred</param>
+        /// <param name="keyState">The state of the key event</param>
+        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;
+        }
+        /// <summary>
+        /// Checks to see if Shift key modifier has been supplied.
+        /// </summary>
+        /// <returns>True if shift modifier</returns>
+        public bool IsShiftModifier()
+        {
+            bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Checks to see if Ctrl (control) key modifier has been supplied.
+        /// </summary>
+        /// <returns>True if ctrl modifier</returns>
+        public bool IsCtrlModifier()
+        {
+            bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Checks to see if Alt key modifier has been supplied.
+        /// </summary>
+        /// <returns>True if alt modifier</returns>
+        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;
+            }
+        }
+
+        /// <summary>
+        /// Enumeration for specifying the state of the key event.
+        /// </summary>
+        public enum StateType
+        {
+            Down,
+            Up,
+            Last
+        }
+
+    }
+}