Revert "[NUI] Provide binding after WheelEvent class pimpling (#1927)" (#1956)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Wheel.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21     /// <summary>
22     /// The wheel event structure is used to store a wheel rolling, it facilitates processing of the wheel rolling and passing to other libraries like Toolkit.<br />
23     /// There is a key modifier which relates to keys like Alt, Shift, and Ctrl functions are supplied to check if they have been pressed when the wheel is being rolled.<br />
24     /// We support a mouse device and there may be another custom device that support the wheel event. The device type is specified as \e type.<br />
25     /// The mouse wheel event can be sent to the specific actor but the custom wheel event will be sent to the window.<br />
26     /// </summary>
27     /// <since_tizen> 3 </since_tizen>
28     public class Wheel : Disposable
29     {
30
31         /// <summary>
32         /// The default constructor.
33         /// </summary>
34         /// <since_tizen> 3 </since_tizen>
35         public Wheel() : this(Interop.Wheel.new_Wheel__SWIG_0(), true)
36         {
37             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
38         }
39
40         /// <summary>
41         /// The constructor.
42         /// </summary>
43         /// <param name="type">The type of the wheel event.</param>
44         /// <param name="direction">The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel).</param>
45         /// <param name="modifiers">Modifier keys pressed during the event (such as Shift, Alt, and Ctrl).</param>
46         /// <param name="point">The coordinates of the cursor relative to the top-left of the screen.</param>
47         /// <param name="z">The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise).</param>
48         /// <param name="timeStamp">The time the wheel is being rolled.</param>
49         /// <since_tizen> 3 </since_tizen>
50         public Wheel(Wheel.WheelType type, int direction, uint modifiers, Vector2 point, int z, uint timeStamp) : this(Interop.Wheel.new_Wheel__SWIG_1((int)type, direction, modifiers, Vector2.getCPtr(point), z, timeStamp), true)
51         {
52             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53         }
54
55         internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
56         {
57         }
58
59         /// <summary>
60         /// The type of the wheel event.
61         /// </summary>
62         /// <since_tizen> 3 </since_tizen>
63         public enum WheelType
64         {
65             /// <summary>
66             /// Mouse wheel event.
67             /// </summary>
68             /// <since_tizen> 3 </since_tizen>
69             MouseWheel,
70
71             /// <summary>
72             /// Custom wheel event.
73             /// </summary>
74             /// <since_tizen> 3 </since_tizen>
75             CustomWheel
76         }
77
78         /// <summary>
79         /// The type of the wheel event.
80         /// </summary>
81         /// <since_tizen> 3 </since_tizen>
82         public Wheel.WheelType Type
83         {
84             get
85             {
86                 return type;
87             }
88         }
89
90         /// <summary>
91         /// The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel).
92         /// </summary>
93         /// <since_tizen> 3 </since_tizen>
94         public int Direction
95         {
96             get
97             {
98                 return direction;
99             }
100         }
101
102         /// <summary>
103         /// Modifier keys pressed during the event (such as Shift, Alt, and Ctrl).
104         /// </summary>
105         /// <since_tizen> 3 </since_tizen>
106         public uint Modifiers
107         {
108             get
109             {
110                 return modifiers;
111             }
112         }
113
114         /// <summary>
115         /// The coordinates of the cursor relative to the top-left of the screen.
116         /// </summary>
117         /// <since_tizen> 3 </since_tizen>
118         public Vector2 Point
119         {
120             get
121             {
122                 return point;
123             }
124         }
125
126         /// <summary>
127         /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise).
128         /// </summary>
129         /// <since_tizen> 3 </since_tizen>
130         public int Z
131         {
132             get
133             {
134                 return z;
135             }
136         }
137
138         /// <summary>
139         /// The time the wheel is being rolled.
140         /// </summary>
141         /// <since_tizen> 3 </since_tizen>
142         public uint TimeStamp
143         {
144             get
145             {
146                 return timeStamp;
147             }
148         }
149
150         private Wheel.WheelType type
151         {
152             set
153             {
154                 Interop.Wheel.Wheel_type_set(swigCPtr, (int)value);
155                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156             }
157             get
158             {
159                 Wheel.WheelType ret = (Wheel.WheelType)Interop.Wheel.Wheel_type_get(swigCPtr);
160                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161                 return ret;
162             }
163         }
164
165         private int direction
166         {
167             set
168             {
169                 Interop.Wheel.Wheel_direction_set(swigCPtr, value);
170                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171             }
172             get
173             {
174                 int ret = Interop.Wheel.Wheel_direction_get(swigCPtr);
175                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176                 return ret;
177             }
178         }
179
180         private uint modifiers
181         {
182             set
183             {
184                 Interop.Wheel.Wheel_modifiers_set(swigCPtr, value);
185                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186             }
187             get
188             {
189                 uint ret = Interop.Wheel.Wheel_modifiers_get(swigCPtr);
190                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191                 return ret;
192             }
193         }
194
195         private Vector2 point
196         {
197             set
198             {
199                 Interop.Wheel.Wheel_point_set(swigCPtr, Vector2.getCPtr(value));
200                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201             }
202             get
203             {
204                 global::System.IntPtr cPtr = Interop.Wheel.Wheel_point_get(swigCPtr);
205                 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
206                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207                 return ret;
208             }
209         }
210
211         private int z
212         {
213             set
214             {
215                 Interop.Wheel.Wheel_z_set(swigCPtr, value);
216                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217             }
218             get
219             {
220                 int ret = Interop.Wheel.Wheel_z_get(swigCPtr);
221                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222                 return ret;
223             }
224         }
225
226         private uint timeStamp
227         {
228             set
229             {
230                 Interop.Wheel.Wheel_timeStamp_set(swigCPtr, value);
231                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232             }
233             get
234             {
235                 uint ret = Interop.Wheel.Wheel_timeStamp_get(swigCPtr);
236                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237                 return ret;
238             }
239         }
240
241
242         /// <summary>
243         /// Checks to see if the Shift key modifier has been supplied.
244         /// </summary>
245         /// <returns>True if Shift modifier.</returns>
246         /// <since_tizen> 3 </since_tizen>
247         public bool IsShiftModifier()
248         {
249             bool ret = Interop.Wheel.Wheel_IsShiftModifier(swigCPtr);
250             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251             return ret;
252         }
253
254         /// <summary>
255         /// Checks to see if Ctrl (control) key modifier has been supplied.
256         /// </summary>
257         /// <returns>True if Ctrl modifier.</returns>
258         /// <since_tizen> 3 </since_tizen>
259         public bool IsCtrlModifier()
260         {
261             bool ret = Interop.Wheel.Wheel_IsCtrlModifier(swigCPtr);
262             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263             return ret;
264         }
265
266         /// <summary>
267         /// Checks to see if Alt key modifier has been supplied.
268         /// </summary>
269         /// <returns>True if Alt modifier.</returns>
270         /// <since_tizen> 3 </since_tizen>
271         public bool IsAltModifier()
272         {
273             bool ret = Interop.Wheel.Wheel_IsAltModifier(swigCPtr);
274             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275             return ret;
276         }
277
278         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Wheel obj)
279         {
280             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
281         }
282
283         internal static Wheel GetWheelFromPtr(global::System.IntPtr cPtr)
284         {
285             Wheel ret = new Wheel(cPtr, false);
286             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287             return ret;
288         }
289
290         /// This will not be public opened.
291         [EditorBrowsable(EditorBrowsableState.Never)]
292         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
293         {
294             Interop.Wheel.delete_Wheel(swigCPtr);
295         }
296     }
297 }