tizen 2.3 release
[framework/web/wearable/wrt-plugins-tizen.git] / src / Sensor / JSSensorData.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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 #ifndef __TIZEN_JS_SENSOR_DATA_H__
19 #define __TIZEN_JS_SENSOR_DATA_H__
20
21 #include <JavaScriptCore/JavaScript.h>
22
23 #include "SensorData.h"
24
25 namespace DeviceAPI {
26 namespace Sensor {
27
28 class JSLightData
29 {
30     public:
31         static const JSClassDefinition* getClassInfo();
32         static const JSClassRef getClassRef();
33         static JSValueRef createJSObject(JSContextRef context, LightData* lightData);
34         static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
35     private:
36
37         /**
38          * The callback invoked when an object is first created.
39          */
40         static void initialize(JSContextRef context, JSObjectRef object);
41
42         /**
43          * The callback invoked when an object is finalized.
44          */
45         static void finalize(JSObjectRef object);
46
47         /**
48          * This member variable contains the values which has to be passed
49          * when the this class is embedded into JS Engine.
50          */
51         static JSClassDefinition m_classInfo;
52
53         /**
54          * This member variable contains the initialization values for the
55          * properties of this class. The values are given according to
56          * the data structure JSPropertySpec
57          */
58         static JSStaticValue m_property[];
59
60         static JSClassRef m_jsClassRef;
61 };
62
63
64 class JSProximityData
65 {
66     public:
67         static const JSClassDefinition* getClassInfo();
68         static const JSClassRef getClassRef();
69         static JSValueRef createJSObject(JSContextRef context, ProximityData* proximityData);
70         static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
71     private:
72
73         /**
74          * The callback invoked when an object is first created.
75          */
76         static void initialize(JSContextRef context, JSObjectRef object);
77
78         /**
79          * The callback invoked when an object is finalized.
80          */
81         static void finalize(JSObjectRef object);
82
83         /**
84          * This member variable contains the values which has to be passed
85          * when the this class is embedded into JS Engine.
86          */
87         static JSClassDefinition m_classInfo;
88
89         /**
90          * This member variable contains the initialization values for the
91          * properties of this class. The values are given according to
92          * the data structure JSPropertySpec
93          */
94         static JSStaticValue m_property[];
95
96         static JSClassRef m_jsClassRef;
97 };
98
99
100 class JSMagneticData
101 {
102     public:
103         static const JSClassDefinition* getClassInfo();
104         static const JSClassRef getClassRef();
105         static JSValueRef createJSObject(JSContextRef context, MagneticData* magneticData);
106         static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
107     private:
108
109         /**
110          * The callback invoked when an object is first created.
111          */
112         static void initialize(JSContextRef context, JSObjectRef object);
113
114         /**
115          * The callback invoked when an object is finalized.
116          */
117         static void finalize(JSObjectRef object);
118
119         /**
120          * This member variable contains the values which has to be passed
121          * when the this class is embedded into JS Engine.
122          */
123         static JSClassDefinition m_classInfo;
124
125         /**
126          * This member variable contains the initialization values for the
127          * properties of this class. The values are given according to
128          * the data structure JSPropertySpec
129          */
130         static JSStaticValue m_property[];
131
132         static JSClassRef m_jsClassRef;
133 };
134
135 class JSPressureData
136 {
137     public:
138         static const JSClassDefinition* getClassInfo();
139         static const JSClassRef getClassRef();
140         static JSValueRef createJSObject(JSContextRef context, PressureData* pressureData);
141         static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
142     private:
143
144         /**
145          * The callback invoked when an object is first created.
146          */
147         static void initialize(JSContextRef context, JSObjectRef object);
148
149         /**
150          * The callback invoked when an object is finalized.
151          */
152         static void finalize(JSObjectRef object);
153
154         /**
155          * This member variable contains the values which has to be passed
156          * when the this class is embedded into JS Engine.
157          */
158         static JSClassDefinition m_classInfo;
159
160         /**
161          * This member variable contains the initialization values for the
162          * properties of this class. The values are given according to
163          * the data structure JSPropertySpec
164          */
165         static JSStaticValue m_property[];
166
167         static JSClassRef m_jsClassRef;
168 };
169
170
171 class JSUltravioletData
172 {
173     public:
174         static const JSClassDefinition* getClassInfo();
175         static const JSClassRef getClassRef();
176         static JSValueRef createJSObject(JSContextRef context, UltravioletData* ultravioletData);
177         static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
178     private:
179
180         /**
181          * The callback invoked when an object is first created.
182          */
183         static void initialize(JSContextRef context, JSObjectRef object);
184
185         /**
186          * The callback invoked when an object is finalized.
187          */
188         static void finalize(JSObjectRef object);
189
190         /**
191          * This member variable contains the values which has to be passed
192          * when the this class is embedded into JS Engine.
193          */
194         static JSClassDefinition m_classInfo;
195
196
197         /**
198          * This member variable contains the initialization values for the
199          * properties of this class. The values are given according to
200          * the data structure JSPropertySpec
201          */
202         static JSStaticValue m_property[];
203
204         static JSClassRef m_jsClassRef;
205 };
206
207 } // Sensor
208 } // DeviceAPI
209
210 #endif // __TIZEN_JS_DOWNLOAD_MANAGER_H__