Update change log and spec for wrt-plugins-tizen_0.4.27
[framework/web/wrt-plugins-tizen.git] / src / Systeminfo / SysteminfoPropertyInfo.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 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 WRTPLUGINS_API_PROPERTY_INFO_H_
19 #define WRTPLUGINS_API_PROPERTY_INFO_H_
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include <CommonsJavaScript/JSUtils.h>
24 #include <CommonsJavaScript/Converter.h>
25 #include <string>
26 #include <dpl/shared_ptr.h>
27
28 namespace DeviceAPI {
29 namespace Systeminfo {
30
31 enum SystemInfosDeviceOrientationStatus {
32     PORTRAIT_PRIMARY = 0,
33     PORTRAIT_SECONDARY = 1,
34     LANDSCAPE_PRIMARY = 2,
35     LANDSCAPE_SECONDARY = 3
36 };
37
38 struct DeviceCapabilitiesProperties
39 {
40     bool            bluetooth;
41     bool            nfc;
42     bool            nfcReservedPush;
43     unsigned short  multiTouchCount;
44     bool            inputKeyboard;
45     bool            inputKeyboardLayout;
46     bool            wifi;
47     bool            wifiDirect;
48     bool            opengles;
49     std::string     openglestextureFormat;
50     bool            openglesVersion1_1;
51     bool            openglesVersion2_0;
52     bool            fmRadio;
53     std::string     platformVersion;
54     std::string     platformName;
55     std::string     webApiVersion;
56     std::string     nativeApiVersion;
57     bool            camera;
58     bool            cameraFront;
59     bool            cameraFrontFlash;
60     bool            cameraBack;
61     bool            cameraBackFlash;
62     bool            location;
63     bool            locationGps;    
64     bool            locationWps;
65     bool            microphone;
66     bool            usbHost;
67     bool            usbAccessory;
68     bool            screenOutputRca;
69     bool            screenOutputHdmi;
70     std::string     platformCoreCpuArch;
71     std::string     platformCoreFpuArch;
72     bool            sipVoip;
73     std::string     duid;
74     bool            speechRecognition;
75     bool            speechSynthesis;
76     bool            accelerometer;    
77     bool            accelerometerWakeup;
78     bool            barometer;
79     bool            barometerWakeup;
80     bool            gyroscope;
81     bool            gyroscopeWakeup;
82     bool            magnetometer;
83     bool            magnetometerWakeup;
84     bool            photometer;
85     bool            photometerWakeup;
86     bool            proximity;
87     bool            proximityWakeup;
88     bool            tiltmeter;
89     bool            tiltmeterWakeup;
90     bool            dataEncryption;
91     bool            graphicsAcceleration;
92     bool            push;
93     bool            telephony;
94     bool            telephonyMms;
95     bool            telephonySms;
96     bool            screenSizeNormal;
97     bool            screenSize480_800;
98     bool            screenSize720_1280;
99     bool            autoRotation;
100     bool            shellAppWidget;
101     bool            visionImageRecognition;
102     bool            visionQrcodeGeneration;
103     bool            visionQrcodeRecognition;
104     bool            visionFaceRecognition;
105     bool            secureElement;
106     bool            nativeOspCompatible;
107
108     DeviceCapabilitiesProperties() :
109         bluetooth(false),
110         nfc(false),
111         nfcReservedPush(false),
112         multiTouchCount(0),
113         inputKeyboard(false),
114         inputKeyboardLayout(false),
115         wifi(false),
116         wifiDirect(false),
117         opengles(false),
118         openglestextureFormat(""),
119         openglesVersion1_1(false),
120         openglesVersion2_0(false),
121         fmRadio(false),
122         platformVersion(""),
123         platformName(""),
124         webApiVersion(""),
125         nativeApiVersion(""),
126         camera(false),
127         cameraFront(false),
128         cameraFrontFlash(false),
129         cameraBack(false),
130         cameraBackFlash(false),
131         location(false),
132         locationGps(false),
133         locationWps(false),
134         microphone(false),
135         usbHost(false),
136         usbAccessory(false),
137         screenOutputRca(false),
138         screenOutputHdmi(false),
139         platformCoreCpuArch(""),
140         platformCoreFpuArch(""),
141         sipVoip(false),
142         duid(""),
143         speechRecognition(false),
144         speechSynthesis(false),
145         accelerometer(false),
146         accelerometerWakeup(false),        
147         barometer(false),
148         barometerWakeup(false),
149         gyroscope(false),
150         gyroscopeWakeup(false),
151         magnetometer(false),
152         magnetometerWakeup(false),
153         photometer(false),
154         photometerWakeup(false),
155         proximity(false),
156         proximityWakeup(false),
157         tiltmeter(false),
158         tiltmeterWakeup(false),
159         dataEncryption(false),
160         graphicsAcceleration(false),
161         push(false),
162         telephony(false),
163         telephonyMms(false),
164         telephonySms(false),
165         screenSizeNormal(false),
166         screenSize480_800(false),
167         screenSize720_1280(false),
168         autoRotation(false),
169         shellAppWidget(false),
170         visionImageRecognition(false),
171         visionQrcodeGeneration(false),
172         visionQrcodeRecognition(false),
173         visionFaceRecognition(false),
174         secureElement(false),
175         nativeOspCompatible(false)
176         {
177         }
178 };
179
180 struct BatteryProperties
181 {
182     double level;
183     bool isCharging;
184
185     BatteryProperties() :
186         level(0.0),
187         isCharging(false)
188     {
189     }
190 };
191
192 struct CpuProperties
193 {
194     double load;
195
196     CpuProperties() :
197         load(0.0)
198     {
199     }
200 };
201
202 struct StorageProperties
203 {
204         std::string             type;
205         unsigned long long      capacity;
206         unsigned long long      availableCapacity;
207         bool                    isRemoveable;
208         bool                    isRemovable;
209
210         StorageProperties():
211                 type("UNKNOWN"),
212                 capacity(0),
213                 availableCapacity(0),
214                 isRemoveable(false),
215                 isRemovable(false)
216         {
217         }
218 };
219
220 struct DisplayProperties
221 {
222         unsigned long  resolutionWidth;
223         unsigned long  resolutionHeight;
224         unsigned long  dotsPerInchWidth;
225         unsigned long  dotsPerInchHeight;
226         double         physicalWidth;
227         double         physicalHeight;
228         double         brightness;
229
230         DisplayProperties() :
231                 resolutionWidth(0),
232                 resolutionHeight(0),
233                 dotsPerInchWidth(0),
234                 dotsPerInchHeight(0),
235                 physicalWidth(0.0),
236                 physicalHeight(0.0),
237                 brightness(0.0)
238         {
239         }
240 };
241
242 struct WifiNetworkProperties
243 {
244         std::string             status;
245         std::string             ssid;
246         std::string             ipAddress;
247         std::string             ipv6Address;    
248         double                  signalStrength;
249
250         WifiNetworkProperties() :
251                 status(""),
252                 ssid(""),
253                 ipAddress(""),
254                 ipv6Address(""),
255                 signalStrength(0.0)
256         {
257         }
258 };
259
260 struct NetworkProperties
261 {
262         std::string             networkType;
263
264         NetworkProperties() :
265                 networkType("UNKNOWN")
266         {
267         }
268 };
269
270 struct CellularNetworkProperties
271 {
272         std::string             status;
273         std::string             apn;
274         std::string             ipAddress;
275         std::string             ipv6Address;    
276         unsigned short  mcc;
277         unsigned short  mnc;
278         unsigned short  cellId;
279         unsigned short  lac;
280         bool                    isRoaming;
281         bool            isFlightMode;
282         std::string     imei;
283
284         CellularNetworkProperties() :
285                 status(""),
286                 apn(""),
287                 ipAddress(""),
288                 ipv6Address(""),
289                 mcc(0),
290                 mnc(0),
291                 cellId(0),
292                 lac(0),
293                 isRoaming(false),
294                 isFlightMode(false),
295                 imei("")
296         {
297         }
298 };
299
300 struct SIMProperties
301 {
302     std::string     state;
303         std::string             operatorName;
304         std::string             msisdn;
305         std::string             iccid;
306         unsigned short  mcc;
307         unsigned short  mnc;
308         std::string             msin;
309         std::string             spn;
310
311         SIMProperties() :
312         state(""),
313                 operatorName(""),
314                 msisdn(""),
315                 iccid(""),
316                 mcc(0),
317                 mnc(0),
318                 msin(""),
319                 spn("")
320         {
321         }
322 };
323
324 struct DeviceOrientationProperties
325 {
326     std::string  status;
327
328     DeviceOrientationProperties() :
329         status("")
330     {
331     }
332 };
333
334 struct BuildProperties
335 {
336     std::string  model;
337     std::string  manufacturer;
338     std::string  buildVersion;
339
340     BuildProperties() :
341         model(""),
342         manufacturer(""),
343         buildVersion("")
344     {
345     }
346 };
347
348 struct LocaleProperties
349 {
350     std::string  language;
351     std::string  country;
352
353     LocaleProperties() :
354         language(""),
355         country("")
356     {
357     }    
358 };
359
360 struct PeripheralProperties
361 {
362     bool  isVideoOutputOn;
363
364     PeripheralProperties() :
365         isVideoOutputOn(false)
366     {
367     }    
368 };
369
370 typedef DPL::SharedPtr<DeviceCapabilitiesProperties> DeviceCapabilitiesPropertiesPtr;
371 typedef DPL::SharedPtr<BatteryProperties> BatteryPropertiesPtr;
372 typedef DPL::SharedPtr<CpuProperties> CpuPropertiesPtr;
373 typedef DPL::SharedPtr<StorageProperties> StoragePropertiesPtr;
374 typedef DPL::SharedPtr<DisplayProperties> DisplayPropertiesPtr;
375 typedef DPL::SharedPtr<WifiNetworkProperties> WifiNetworkPropertiesPtr;
376 typedef DPL::SharedPtr<NetworkProperties> NetworkPropertiesPtr;
377 typedef DPL::SharedPtr<CellularNetworkProperties> CellularNetworkPropertiesPtr;
378 typedef DPL::SharedPtr<SIMProperties> SIMPropertiesPtr;
379 typedef DPL::SharedPtr<DeviceOrientationProperties> DeviceOrientationPropertiesPtr;
380 typedef DPL::SharedPtr<BuildProperties> BuildPropertiesPtr;
381 typedef DPL::SharedPtr<LocaleProperties> LocalePropertiesPtr;
382 typedef DPL::SharedPtr<PeripheralProperties> PeripheralPropertiesPtr;
383
384 }
385 }
386
387 #endif