Update change log and spec for wrt-plugins-tizen_0.4.46
[platform/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     std::string     profile;
108
109     DeviceCapabilitiesProperties() :
110         bluetooth(false),
111         nfc(false),
112         nfcReservedPush(false),
113         multiTouchCount(0),
114         inputKeyboard(false),
115         inputKeyboardLayout(false),
116         wifi(false),
117         wifiDirect(false),
118         opengles(false),
119         openglestextureFormat(""),
120         openglesVersion1_1(false),
121         openglesVersion2_0(false),
122         fmRadio(false),
123         platformVersion(""),
124         platformName(""),
125         webApiVersion(""),
126         nativeApiVersion(""),
127         camera(false),
128         cameraFront(false),
129         cameraFrontFlash(false),
130         cameraBack(false),
131         cameraBackFlash(false),
132         location(false),
133         locationGps(false),
134         locationWps(false),
135         microphone(false),
136         usbHost(false),
137         usbAccessory(false),
138         screenOutputRca(false),
139         screenOutputHdmi(false),
140         platformCoreCpuArch(""),
141         platformCoreFpuArch(""),
142         sipVoip(false),
143         duid(""),
144         speechRecognition(false),
145         speechSynthesis(false),
146         accelerometer(false),
147         accelerometerWakeup(false),        
148         barometer(false),
149         barometerWakeup(false),
150         gyroscope(false),
151         gyroscopeWakeup(false),
152         magnetometer(false),
153         magnetometerWakeup(false),
154         photometer(false),
155         photometerWakeup(false),
156         proximity(false),
157         proximityWakeup(false),
158         tiltmeter(false),
159         tiltmeterWakeup(false),
160         dataEncryption(false),
161         graphicsAcceleration(false),
162         push(false),
163         telephony(false),
164         telephonyMms(false),
165         telephonySms(false),
166         screenSizeNormal(false),
167         screenSize480_800(false),
168         screenSize720_1280(false),
169         autoRotation(false),
170         shellAppWidget(false),
171         visionImageRecognition(false),
172         visionQrcodeGeneration(false),
173         visionQrcodeRecognition(false),
174         visionFaceRecognition(false),
175         secureElement(false),
176         nativeOspCompatible(false),
177         profile("")
178         {
179         }
180 };
181
182 struct BatteryProperties
183 {
184     double level;
185     bool isCharging;
186
187     BatteryProperties() :
188         level(0.0),
189         isCharging(false)
190     {
191     }
192 };
193
194 struct CpuProperties
195 {
196     double load;
197
198     CpuProperties() :
199         load(0.0)
200     {
201     }
202 };
203
204 struct StorageUnitProperties
205 {
206         std::string             type;
207         unsigned long long      capacity;
208         unsigned long long      availableCapacity;
209         bool                    isRemoveable;
210         bool                    isRemovable;
211
212         StorageUnitProperties():
213                 type("UNKNOWN"),
214                 capacity(0),
215                 availableCapacity(0),
216                 isRemoveable(false),
217                 isRemovable(false)
218         {
219         }
220 };
221
222 struct StorageProperties
223 {
224     StorageUnitProperties   units[2];
225     unsigned long           cnt;
226
227     StorageProperties():
228         cnt(0)
229     {
230     }
231 };
232
233
234 struct DisplayProperties
235 {
236         unsigned long  resolutionWidth;
237         unsigned long  resolutionHeight;
238         unsigned long  dotsPerInchWidth;
239         unsigned long  dotsPerInchHeight;
240         double         physicalWidth;
241         double         physicalHeight;
242         double         brightness;
243
244         DisplayProperties() :
245                 resolutionWidth(0),
246                 resolutionHeight(0),
247                 dotsPerInchWidth(0),
248                 dotsPerInchHeight(0),
249                 physicalWidth(0.0),
250                 physicalHeight(0.0),
251                 brightness(0.0)
252         {
253         }
254 };
255
256 struct WifiNetworkProperties
257 {
258         std::string             status;
259         std::string             ssid;
260         std::string             ipAddress;
261         std::string             ipv6Address;    
262         double                  signalStrength;
263
264         WifiNetworkProperties() :
265                 status(""),
266                 ssid(""),
267                 ipAddress(""),
268                 ipv6Address(""),
269                 signalStrength(0.0)
270         {
271         }
272 };
273
274 struct NetworkProperties
275 {
276         std::string             networkType;
277
278         NetworkProperties() :
279                 networkType("UNKNOWN")
280         {
281         }
282 };
283
284 struct CellularNetworkProperties
285 {
286         std::string             status;
287         std::string             apn;
288         std::string             ipAddress;
289         std::string             ipv6Address;    
290         unsigned short  mcc;
291         unsigned short  mnc;
292         unsigned short  cellId;
293         unsigned short  lac;
294         bool                    isRoaming;
295         bool            isFlightMode;
296         std::string     imei;
297
298         CellularNetworkProperties() :
299                 status(""),
300                 apn(""),
301                 ipAddress(""),
302                 ipv6Address(""),
303                 mcc(0),
304                 mnc(0),
305                 cellId(0),
306                 lac(0),
307                 isRoaming(false),
308                 isFlightMode(false),
309                 imei("")
310         {
311         }
312 };
313
314 struct SIMProperties
315 {
316     std::string     state;
317         std::string             operatorName;
318         std::string             msisdn;
319         std::string             iccid;
320         unsigned short  mcc;
321         unsigned short  mnc;
322         std::string             msin;
323         std::string             spn;
324
325         SIMProperties() :
326         state(""),
327                 operatorName(""),
328                 msisdn(""),
329                 iccid(""),
330                 mcc(0),
331                 mnc(0),
332                 msin(""),
333                 spn("")
334         {
335         }
336 };
337
338 struct DeviceOrientationProperties
339 {
340     std::string  status;
341     bool         isAutoRotation;
342
343     DeviceOrientationProperties() :
344         status(""),
345         isAutoRotation(false)
346     {
347     }
348 };
349
350 struct BuildProperties
351 {
352     std::string  model;
353     std::string  manufacturer;
354     std::string  buildVersion;
355
356     BuildProperties() :
357         model(""),
358         manufacturer(""),
359         buildVersion("")
360     {
361     }
362 };
363
364 struct LocaleProperties
365 {
366     std::string  language;
367     std::string  country;
368
369     LocaleProperties() :
370         language(""),
371         country("")
372     {
373     }    
374 };
375
376 struct PeripheralProperties
377 {
378     bool  isVideoOutputOn;
379
380     PeripheralProperties() :
381         isVideoOutputOn(false)
382     {
383     }    
384 };
385
386 typedef DPL::SharedPtr<DeviceCapabilitiesProperties> DeviceCapabilitiesPropertiesPtr;
387 typedef DPL::SharedPtr<BatteryProperties> BatteryPropertiesPtr;
388 typedef DPL::SharedPtr<CpuProperties> CpuPropertiesPtr;
389 typedef DPL::SharedPtr<StorageUnitProperties> StorageUnitPropertiesPtr;
390 typedef DPL::SharedPtr<StorageProperties> StoragePropertiesPtr;
391 typedef DPL::SharedPtr<DisplayProperties> DisplayPropertiesPtr;
392 typedef DPL::SharedPtr<WifiNetworkProperties> WifiNetworkPropertiesPtr;
393 typedef DPL::SharedPtr<NetworkProperties> NetworkPropertiesPtr;
394 typedef DPL::SharedPtr<CellularNetworkProperties> CellularNetworkPropertiesPtr;
395 typedef DPL::SharedPtr<SIMProperties> SIMPropertiesPtr;
396 typedef DPL::SharedPtr<DeviceOrientationProperties> DeviceOrientationPropertiesPtr;
397 typedef DPL::SharedPtr<BuildProperties> BuildPropertiesPtr;
398 typedef DPL::SharedPtr<LocaleProperties> LocalePropertiesPtr;
399 typedef DPL::SharedPtr<PeripheralProperties> PeripheralPropertiesPtr;
400
401 }
402 }
403
404 #endif