2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.ComponentModel;
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 />
27 /// <since_tizen> 3 </since_tizen>
28 public class Wheel : Disposable
32 /// The default constructor.
34 /// <since_tizen> 3 </since_tizen>
35 public Wheel() : this(Interop.Wheel.new_Wheel__SWIG_0(), true)
37 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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)
52 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
55 internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
60 /// The type of the wheel event.
62 /// <since_tizen> 3 </since_tizen>
66 /// Mouse wheel event.
68 /// <since_tizen> 3 </since_tizen>
72 /// Custom wheel event.
74 /// <since_tizen> 3 </since_tizen>
79 /// The type of the wheel event.
81 /// <since_tizen> 3 </since_tizen>
82 public Wheel.WheelType Type
91 /// The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel).
93 /// <since_tizen> 3 </since_tizen>
103 /// Modifier keys pressed during the event (such as Shift, Alt, and Ctrl).
105 /// <since_tizen> 3 </since_tizen>
106 public uint Modifiers
115 /// The coordinates of the cursor relative to the top-left of the screen.
117 /// <since_tizen> 3 </since_tizen>
127 /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise).
129 /// <since_tizen> 3 </since_tizen>
139 /// The time the wheel is being rolled.
141 /// <since_tizen> 3 </since_tizen>
142 public uint TimeStamp
150 private Wheel.WheelType type
154 Interop.Wheel.Wheel_type_set(swigCPtr, (int)value);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 Wheel.WheelType ret = (Wheel.WheelType)Interop.Wheel.Wheel_type_get(swigCPtr);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 private int direction
169 Interop.Wheel.Wheel_direction_set(swigCPtr, value);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 int ret = Interop.Wheel.Wheel_direction_get(swigCPtr);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 private uint modifiers
184 Interop.Wheel.Wheel_modifiers_set(swigCPtr, value);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 uint ret = Interop.Wheel.Wheel_modifiers_get(swigCPtr);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 private Vector2 point
199 Interop.Wheel.Wheel_point_set(swigCPtr, Vector2.getCPtr(value));
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
215 Interop.Wheel.Wheel_z_set(swigCPtr, value);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 int ret = Interop.Wheel.Wheel_z_get(swigCPtr);
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 private uint timeStamp
230 Interop.Wheel.Wheel_timeStamp_set(swigCPtr, value);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 uint ret = Interop.Wheel.Wheel_timeStamp_get(swigCPtr);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 /// Checks to see if the Shift key modifier has been supplied.
245 /// <returns>True if Shift modifier.</returns>
246 /// <since_tizen> 3 </since_tizen>
247 public bool IsShiftModifier()
249 bool ret = Interop.Wheel.Wheel_IsShiftModifier(swigCPtr);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 /// Checks to see if Ctrl (control) key modifier has been supplied.
257 /// <returns>True if Ctrl modifier.</returns>
258 /// <since_tizen> 3 </since_tizen>
259 public bool IsCtrlModifier()
261 bool ret = Interop.Wheel.Wheel_IsCtrlModifier(swigCPtr);
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 /// Checks to see if Alt key modifier has been supplied.
269 /// <returns>True if Alt modifier.</returns>
270 /// <since_tizen> 3 </since_tizen>
271 public bool IsAltModifier()
273 bool ret = Interop.Wheel.Wheel_IsAltModifier(swigCPtr);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
278 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Wheel obj)
280 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
283 internal static Wheel GetWheelFromPtr(global::System.IntPtr cPtr)
285 Wheel ret = new Wheel(cPtr, false);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 /// This will not be public opened.
291 [EditorBrowsable(EditorBrowsableState.Never)]
292 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
294 Interop.Wheel.delete_Wheel(swigCPtr);