Initialize Tizen 2.3
[framework/osp/uix.git] / src / FUixSensor_SensorCoreEventTypes.h
1 // 
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd. 
4 // 
5 // Licensed under the Flora License, Version 1.1 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file     FUixSensor_SensorCoreEventTypes.h
20  * @brief    This is the header file for the common data types and constants used by the _SensorEventDeliverer and the _ISensorCore.
21  *
22  * This header file contains the declarations of the common data types and constants used by _SensorEventDeliverer and the _ISensorCore.
23  */
24
25 #ifndef _FUIX_SENSOR_INTERNAL_SENSOR_CORE_EVENT_TYPES_H_
26 #define _FUIX_SENSOR_INTERNAL_SENSOR_CORE_EVENT_TYPES_H_
27
28 namespace Tizen { namespace Uix { namespace Sensor
29 {
30 typedef void* _SensorCoreEventHandle;
31
32 enum _SensorCoreEventType
33 {
34         _SENSOR_CORE_EVENT_TYPE_ACCELERATION_DATA = 0,
35         _SENSOR_CORE_EVENT_TYPE_MAGNETIC_FIELD_DATA,
36         _SENSOR_CORE_EVENT_TYPE_PROXIMITY_DISTANCE_DATA,
37         _SENSOR_CORE_EVENT_TYPE_TILT_DATA,
38         _SENSOR_CORE_EVENT_TYPE_ROTATION_RATE_DATA,
39         _SENSOR_CORE_EVENT_TYPE_LIGHT_LEVEL_DATA,
40         _SENSOR_CORE_EVENT_TYPE_ACCELERATION_SENSOR_WAKEUP,
41         _SENSOR_CORE_EVENT_TYPE_GRAVITY_DATA,
42         _SENSOR_CORE_EVENT_TYPE_USER_ACCELERATION_DATA,
43         _SENSOR_CORE_EVENT_TYPE_DEVICE_ORIENTATION_DATA,
44         _SENSOR_CORE_EVENT_TYPE_MAX,
45         _SENSOR_CORE_EVENT_TYPE_NONE = -1,
46 };
47
48 struct _SensorCoreEventValue
49 {
50         float value;
51 };
52
53 struct _SensorCoreEventAxisOf3Dimension
54 {
55         float x;
56         float y;
57         float z;
58 };
59
60 struct _SensorCoreEventRotationAxisOf3Dimension
61 {
62         float roll;
63         float pitch;
64         float yaw;
65 };
66
67 struct _SensorCoreEventAzimuth
68 {
69         float azimuth;
70 };
71
72 struct _SensorCoreEventDistance
73 {
74         float distance;
75 };
76
77 struct _SensorCoreEventTiltAxisOf3Dimension
78 {
79         float roll;
80         float pitch;
81         float azimuth;
82 };
83
84 struct _SensorCoreEventDeviceOrientationAxisOf3Dimension
85 {
86         float yaw;
87         float roll;
88         float pitch;
89 };
90
91
92 struct _SensorCoreEventLevel
93 {
94         float level;
95 };
96
97 union _SensorCoreEventKind
98 {
99         _SensorCoreEventValue invalidValueData;
100         _SensorCoreEventAxisOf3Dimension accelerationData;
101         _SensorCoreEventAxisOf3Dimension magneticFieldData;
102         _SensorCoreEventDistance proximityDistanceData;
103         _SensorCoreEventTiltAxisOf3Dimension tiltData;
104         _SensorCoreEventAxisOf3Dimension rotationRateData;
105         _SensorCoreEventLevel lightLevelData;
106         _SensorCoreEventAxisOf3Dimension gravityData;
107         _SensorCoreEventAxisOf3Dimension userAccelerationData;
108         _SensorCoreEventDeviceOrientationAxisOf3Dimension deviceOrientationData;
109 };
110
111 struct _SensorCoreEvent
112 {
113         bool isEventValid;
114         _SensorCoreEventType eventType;
115         long long eventTimestamp;
116         _SensorCoreEventKind eventKind;
117 };
118
119 static const _SensorCoreEventHandle INVALID_SENSOR_CORE_EVENT_HANDLE = 0;
120
121 static const long long INVALID_SENSOR_CORE_EVENT_TIMESTAMP = 0LL;
122
123 static const long INVALID_SENSOR_CORE_EVENT_INTERVAL = 0L;
124
125 static const float INVALID_SENSOR_CORE_EVENT_VALUE = -9999.9999F;
126
127 static const _SensorCoreEvent INVALID_SENSOR_CORE_EVENT = {
128                 false,
129                 _SENSOR_CORE_EVENT_TYPE_NONE,
130                 INVALID_SENSOR_CORE_EVENT_TIMESTAMP,
131                 { { INVALID_SENSOR_CORE_EVENT_VALUE } }
132 };
133 } } }// Tizen::Uix::Sensor
134
135 #endif // _FUIX_SENSOR_INTERNAL_SENSOR_CORE_EVENT_TYPES_H_