42
|
1 |
/**
|
|
2 |
This API is used to provide system related data.
|
|
3 |
It takes the sysObject as an argument that is the embeded API in the main HTML file.
|
|
4 |
While using this API outside mobile environment, User or developer need not to take any extara action in oprder to support SYSAPI.
|
|
5 |
*/
|
|
6 |
|
|
7 |
function systemAPI(sysObject)
|
|
8 |
{
|
|
9 |
/*
|
|
10 |
* System Language information services
|
|
11 |
*/
|
|
12 |
sysObject.language = 'EN';
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
/*
|
|
18 |
* Power information services
|
|
19 |
*/
|
|
20 |
|
|
21 |
// Properties
|
|
22 |
sysObject.chargelevel = 5;
|
|
23 |
sysObject.chargerconnected = 0;
|
|
24 |
|
|
25 |
// Event triggers
|
|
26 |
sysObject.onchargelevel = null;
|
|
27 |
sysObject.onchargerconnected = null;
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
/*
|
|
32 |
* Beep tone control services
|
|
33 |
*/
|
|
34 |
sysObject.beep = function(frequency, duration){ }
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
/*
|
|
39 |
* Network Information services
|
|
40 |
*/
|
|
41 |
|
|
42 |
// value range between: {0-7}
|
|
43 |
sysObject.signalbars = 7;
|
|
44 |
|
|
45 |
sysObject.networkname = 'No network';
|
|
46 |
|
|
47 |
// value range between: {0-7}
|
|
48 |
sysObject.networkregistrationstatus = 0;
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
/*
|
|
53 |
* Display and keypad illumination information and control services
|
|
54 |
*/
|
|
55 |
|
|
56 |
// Properties
|
|
57 |
sysObject.lightminintensity = 1;
|
|
58 |
sysObject.lightmaxintensity = 100;
|
|
59 |
sysObject.lightdefaultintensity = 0;
|
|
60 |
|
|
61 |
sysObject.lightinfiniteduration = 0;
|
|
62 |
sysObject.lightmaxduration = 1;
|
|
63 |
sysObject.lightdefaultcycletime = 0;
|
|
64 |
|
|
65 |
sysObject.lighttargetprimarydisplayandkeyboard = 0x3;
|
|
66 |
sysObject.lighttargetsystem = 1;
|
|
67 |
|
|
68 |
// functions
|
|
69 |
sysObject.lighton = function(lighttarget, duration, intensity, fadein){ }
|
|
70 |
sysObject.lightblink = function(lighttarget, duration, onduration, offduration, intensity){ }
|
|
71 |
sysObject.lightoff = function(lighttarget, duration, fadeout){ }
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
/*
|
|
76 |
* Vibration information and control services
|
|
77 |
*/
|
|
78 |
sysObject.vibraminintensity = 1;
|
|
79 |
sysObject.vibramaxintensity = 10;
|
|
80 |
sysObject.vibramaxduration = 100;
|
|
81 |
|
|
82 |
// Vibration setting in the user profile is off.
|
|
83 |
sysObject.vibrasettings = 2;
|
|
84 |
|
|
85 |
sysObject.startvibra = function(duration, intensity){ }
|
|
86 |
|
|
87 |
sysObject.stopvibra = function(){ }
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
/*
|
|
93 |
* Memory and file system information services
|
|
94 |
*/
|
|
95 |
sysObject.totalram = 32;
|
|
96 |
sysObject.freeram = 10;
|
|
97 |
sysObject.drivelist = 'C';
|
|
98 |
|
|
99 |
sysObject.drivesize = function(drive){ return 64; }
|
|
100 |
|
|
101 |
sysObject.drivefree = function(drive){ return 32; }
|
|
102 |
|
|
103 |
}
|
|
104 |
|
|
105 |
|
|
106 |
// make TRUE systeminfo.js script loaded
|
|
107 |
window.parent.NOKIA.scriptsLoaded.systeminfo = true; |