update devel/master branch to 0.2.32
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / devel-src / 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         /// <summary>
70         /// Name given to the key pressed
71         /// </summary> 
72         public string KeyPressedName
73         {
74             get
75             {
76                 return keyPressedName;
77             }
78         }
79
80         /* duplicated with KeyPressedName : removed
81         public string KeyPressed
82         {
83             get
84             {
85                 return keyPressed;
86             }
87         }
88         */
89
90         /// <summary>
91         /// Keycode for the key pressed.
92         /// </summary> 
93         public int KeyCode
94         {
95             get
96             {
97                 return keyCode;
98             }
99         }
100
101         /// <summary>
102         /// Special keys like shift, alt and control which modify the next key pressed.
103         /// </summary> 
104         public int KeyModifier
105         {
106             get
107             {
108                 return keyModifier;
109             }
110         }
111
112         /// <summary>
113         /// The time (in ms) that the key event occurred.
114         /// </summary> 
115         public uint Time
116         {
117             get
118             {
119                 return time;
120             }
121         }
122
123         /// <summary>
124         /// State of the key event.
125         /// </summary> 
126         public Key.StateType State
127         {
128             get
129             {
130                 return state;
131             }
132         }
133
134         /// <summary>
135         /// Default Constructor.
136         /// </summary> 
137         public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true)
138         {
139             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140         }
141
142         /// <summary>
143         /// Constructor.
144         /// </summary>
145         /// <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>
146         /// <param name="keyString">A string of input characters or key pressed</param>
147         /// <param name="keyCode">The unique key code for the key pressed</param>
148         /// <param name="keyModifier">The key modifier for special keys like shift and alt</param>
149         /// <param name="timeStamp">The time (in ms) that the key event occurred</param>
150         /// <param name="keyState">The state of the key event</param>
151         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)
152         {
153             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154         }
155
156         /// <summary>
157         /// Checks to see if Shift key modifier has been supplied.
158         /// </summary>
159         /// <returns>True if shift modifier</returns>
160         public bool IsShiftModifier()
161         {
162             bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr);
163             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164             return ret;
165         }
166
167         /// <summary>
168         /// Checks to see if Ctrl (control) key modifier has been supplied.
169         /// </summary>
170         /// <returns>True if ctrl modifier</returns>
171         public bool IsCtrlModifier()
172         {
173             bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr);
174             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175             return ret;
176         }
177
178         /// <summary>
179         /// Checks to see if Alt key modifier has been supplied.
180         /// </summary>
181         /// <returns>True if alt modifier</returns>
182         public bool IsAltModifier()
183         {
184             bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr);
185             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186             return ret;
187         }
188
189         private string keyPressedName
190         {
191             set
192             {
193                 NDalicPINVOKE.Key_keyPressedName_set(swigCPtr, value);
194                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195             }
196             get
197             {
198                 string ret = NDalicPINVOKE.Key_keyPressedName_get(swigCPtr);
199                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200                 return ret;
201             }
202         }
203
204         private string keyPressed
205         {
206             set
207             {
208                 NDalicPINVOKE.Key_keyPressed_set(swigCPtr, value);
209                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210             }
211             get
212             {
213                 string ret = NDalicPINVOKE.Key_keyPressed_get(swigCPtr);
214                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215                 return ret;
216             }
217         }
218
219         private int keyCode
220         {
221             set
222             {
223                 NDalicPINVOKE.Key_keyCode_set(swigCPtr, value);
224                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225             }
226             get
227             {
228                 int ret = NDalicPINVOKE.Key_keyCode_get(swigCPtr);
229                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230                 return ret;
231             }
232         }
233
234         private int keyModifier
235         {
236             set
237             {
238                 NDalicPINVOKE.Key_keyModifier_set(swigCPtr, value);
239                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240             }
241             get
242             {
243                 int ret = NDalicPINVOKE.Key_keyModifier_get(swigCPtr);
244                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245                 return ret;
246             }
247         }
248
249         private uint time
250         {
251             set
252             {
253                 NDalicPINVOKE.Key_time_set(swigCPtr, value);
254                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255             }
256             get
257             {
258                 uint ret = NDalicPINVOKE.Key_time_get(swigCPtr);
259                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260                 return ret;
261             }
262         }
263
264         private Key.StateType state
265         {
266             set
267             {
268                 NDalicPINVOKE.Key_state_set(swigCPtr, (int)value);
269                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270             }
271             get
272             {
273                 Key.StateType ret = (Key.StateType)NDalicPINVOKE.Key_state_get(swigCPtr);
274                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275                 return ret;
276             }
277         }
278
279         /// <summary>
280         /// Enumeration for specifying the state of the key event.
281         /// </summary>
282         public enum StateType
283         {
284             Down,
285             Up,
286             Last
287         }
288
289     }
290
291 }