1.[NUI 276] c# nui visual high level class refactorying.
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / Key.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Tizen.NUI
12 {
13
14     /// <summary>
15     /// The key structure is used to store a key press.
16     /// </summary> 
17     public class Key : global::System.IDisposable
18     {
19         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20         protected bool swigCMemOwn;
21
22         internal Key(global::System.IntPtr cPtr, bool cMemoryOwn)
23         {
24             swigCMemOwn = cMemoryOwn;
25             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26         }
27
28         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Key obj)
29         {
30             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31         }
32
33         ~Key()
34         {
35             DisposeQueue.Instance.Add(this);
36         }
37
38         public virtual void Dispose()
39         {
40             if (!Stage.IsInstalled())
41             {
42                 DisposeQueue.Instance.Add(this);
43                 return;
44             }
45
46             lock (this)
47             {
48                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
49                 {
50                     if (swigCMemOwn)
51                     {
52                         swigCMemOwn = false;
53                         NDalicPINVOKE.delete_Key(swigCPtr);
54                     }
55                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56                 }
57                 global::System.GC.SuppressFinalize(this);
58             }
59         }
60
61
62         internal static Key GetKeyFromPtr(global::System.IntPtr cPtr)
63         {
64             Key ret = new Key(cPtr, false);
65             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66             return ret;
67         }
68
69         public string DeviceName
70         {
71             get
72             {
73                 string ret = NDalicPINVOKE.GetDeviceName(swigCPtr);
74                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75                 return ret;
76             }
77         }
78
79         /// <summary>
80         /// Name given to the key pressed
81         /// </summary> 
82         public string KeyPressedName
83         {
84             get
85             {
86                 return keyPressedName;
87             }
88         }
89
90         /* duplicated with KeyPressedName : removed
91         public string KeyPressed
92         {
93             get
94             {
95                 return keyPressed;
96             }
97         }
98         */
99
100         /// <summary>
101         /// Keycode for the key pressed.
102         /// </summary> 
103         public int KeyCode
104         {
105             get
106             {
107                 return keyCode;
108             }
109         }
110
111         /// <summary>
112         /// Special keys like shift, alt and control which modify the next key pressed.
113         /// </summary> 
114         public int KeyModifier
115         {
116             get
117             {
118                 return keyModifier;
119             }
120         }
121
122         /// <summary>
123         /// The time (in ms) that the key event occurred.
124         /// </summary> 
125         public uint Time
126         {
127             get
128             {
129                 return time;
130             }
131         }
132
133         /// <summary>
134         /// State of the key event.
135         /// </summary> 
136         public Key.StateType State
137         {
138             get
139             {
140                 return state;
141             }
142         }
143
144         public DeviceClassType DeviceClass
145         {
146             get
147             {
148                 int ret = NDalicPINVOKE.GetDeviceClass(swigCPtr);
149                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150                 return (DeviceClassType)ret;
151             }
152         }
153
154
155         /// <summary>
156         /// Default Constructor.
157         /// </summary> 
158         public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true)
159         {
160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161         }
162
163         /// <summary>
164         /// Constructor.
165         /// </summary>
166         /// <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>
167         /// <param name="keyString">A string of input characters or key pressed</param>
168         /// <param name="keyCode">The unique key code for the key pressed</param>
169         /// <param name="keyModifier">The key modifier for special keys like shift and alt</param>
170         /// <param name="timeStamp">The time (in ms) that the key event occurred</param>
171         /// <param name="keyState">The state of the key event</param>
172         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)
173         {
174             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175         }
176
177         public Key(Key rhs) : this(NDalicPINVOKE.new_Key__SWIG_2(Key.getCPtr(rhs)), true) {
178             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179         }
180
181         public Key Assign(Key rhs) {
182             Key ret = new Key(NDalicPINVOKE.Key_Assign(swigCPtr, Key.getCPtr(rhs)), false);
183             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184             return ret;
185         }
186         /// <summary>
187         /// Checks to see if Shift key modifier has been supplied.
188         /// </summary>
189         /// <returns>True if shift modifier</returns>
190         public bool IsShiftModifier()
191         {
192             bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr);
193             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194             return ret;
195         }
196
197         /// <summary>
198         /// Checks to see if Ctrl (control) key modifier has been supplied.
199         /// </summary>
200         /// <returns>True if ctrl modifier</returns>
201         public bool IsCtrlModifier()
202         {
203             bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr);
204             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205             return ret;
206         }
207
208         /// <summary>
209         /// Checks to see if Alt key modifier has been supplied.
210         /// </summary>
211         /// <returns>True if alt modifier</returns>
212         public bool IsAltModifier()
213         {
214             bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr);
215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216             return ret;
217         }
218
219         private string keyPressedName
220         {
221             set
222             {
223                 NDalicPINVOKE.Key_keyPressedName_set(swigCPtr, value);
224                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225             }
226             get
227             {
228                 string ret = NDalicPINVOKE.Key_keyPressedName_get(swigCPtr);
229                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230                 return ret;
231             }
232         }
233
234         private string keyPressed
235         {
236             set
237             {
238                 NDalicPINVOKE.Key_keyPressed_set(swigCPtr, value);
239                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240             }
241             get
242             {
243                 string ret = NDalicPINVOKE.Key_keyPressed_get(swigCPtr);
244                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245                 return ret;
246             }
247         }
248
249         private int keyCode
250         {
251             set
252             {
253                 NDalicPINVOKE.Key_keyCode_set(swigCPtr, value);
254                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255             }
256             get
257             {
258                 int ret = NDalicPINVOKE.Key_keyCode_get(swigCPtr);
259                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260                 return ret;
261             }
262         }
263
264         private int keyModifier
265         {
266             set
267             {
268                 NDalicPINVOKE.Key_keyModifier_set(swigCPtr, value);
269                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270             }
271             get
272             {
273                 int ret = NDalicPINVOKE.Key_keyModifier_get(swigCPtr);
274                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275                 return ret;
276             }
277         }
278
279         private uint time
280         {
281             set
282             {
283                 NDalicPINVOKE.Key_time_set(swigCPtr, value);
284                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285             }
286             get
287             {
288                 uint ret = NDalicPINVOKE.Key_time_get(swigCPtr);
289                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290                 return ret;
291             }
292         }
293
294         private Key.StateType state
295         {
296             set
297             {
298                 NDalicPINVOKE.Key_state_set(swigCPtr, (int)value);
299                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300             }
301             get
302             {
303                 Key.StateType ret = (Key.StateType)NDalicPINVOKE.Key_state_get(swigCPtr);
304                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305                 return ret;
306             }
307         }
308
309         /// <summary>
310         /// Enumeration for specifying the state of the key event.
311         /// </summary>
312         public enum StateType
313         {
314             Down,
315             Up,
316             Last
317         }
318
319     }
320 }