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