Merge "Remove the actor from exclusive list in RenderTaskList when the actor is destr...
[platform/core/uifw/dali-core.git] / dali / public-api / events / wheel-event.h
1 #ifndef __DALI_WHEEL_EVENT_H__
2 #define __DALI_WHEEL_EVENT_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/math/vector2.h>
24
25
26 namespace Dali
27 {
28 /**
29  * @addtogroup dali_core_events
30  * @{
31  */
32
33 /**
34  * @brief The wheel event structure is used to store a wheel rolling, it facilitates
35  * processing of the wheel rolling and passing to other libraries like Toolkit.
36  *
37  * There is a key modifier which relates to keys like alt, shift and control functions are
38  * supplied to check if they have been pressed when the wheel is being rolled.
39  *
40  * 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.
41  * The mouse wheel event can be sent to the specific actor but the custom wheel event will be sent to the stage.
42  */
43 struct DALI_IMPORT_API WheelEvent
44 {
45   // Enumerations
46
47   /**
48    * @brief Specifies the type of the wheel event.
49    */
50   enum Type
51   {
52     MOUSE_WHEEL,      ///< Mouse wheel event
53     CUSTOM_WHEEL      ///< Custom wheel event
54   };
55
56   /**
57    * @brief Default constructor.
58    */
59   WheelEvent();
60
61   /**
62    * @brief Constructor.
63    *
64    * @param[in]  type       The type of the wheel event
65    * @param[in]  direction  The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel)
66    * @param[in]  modifiers  modifier keys pressed during the event (such as shift, alt and control)
67    * @param[in]  point      The co-ordinates of the cursor relative to the top-left of the screen.
68    * @param[in]  z          The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
69    * @param[in]  timeStamp  The time the wheel is being rolled.
70    */
71   WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp );
72
73   /**
74    * @brief Destructor.
75    */
76   ~WheelEvent();
77
78   /**
79    * @brief Check to see if Shift key modifier has been supplied.
80    *
81    * @return bool true if shift modifier
82    */
83   bool IsShiftModifier() const;
84
85   /**
86    * @brief Check to see if Ctrl (control) key modifier has been supplied.
87    *
88    * @return bool true if ctrl modifier
89    */
90   bool IsCtrlModifier() const;
91
92   /**
93    * @brief Check to see if Alt key modifier has been supplied.
94    *
95    * @return bool true if alt modifier
96    */
97   bool IsAltModifier() const;
98
99   // Data
100
101   /**
102    * @brief Type of the event
103    *
104    * @see Type
105    */
106   Type type;
107
108   /**
109    * @brief The direction in which the wheel is being rolled.
110    *
111    * 0 means the default vertical wheel, and 1 means horizontal wheel
112    */
113   int direction;
114
115   /**
116    * @brief Modifier keys pressed during the event (such as shift, alt and control).
117    */
118   unsigned int modifiers;
119
120   /**
121    * @brief The co-ordinates of the cursor relative to the top-left of the screen
122    * when the wheel is being rolled.
123    */
124   Vector2 point;
125
126   /**
127    * @brief The offset of the wheel rolling, where positive value means rolling down or clockwise
128    * and negative value means rolling up or counter-clockwise.
129    */
130   int z;
131
132   /**
133    * @brief The time when the wheel is being rolled.
134    */
135   unsigned int timeStamp;
136
137 };
138
139 /**
140  * @}
141  */
142 } // namespace Dali
143
144 #endif // __DALI_WHEEL_EVENT_H__