3b6e29ad6a86dd7da97cc52ffbb3b3c840ef9563
[platform/framework/web/crosswalk.git] / src / xwalk / sysapps / device_capabilities / device_capabilities.idl
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Device Capabilities API
6 namespace device_capabilities {
7   dictionary AudioCodec {
8     DOMString format;
9   };
10
11   dictionary VideoCodec {
12     DOMString format;
13     boolean hwAccel;
14     boolean encode;
15   };
16
17   dictionary SystemAVCodecs {
18     AudioCodec[] audioCodecs;
19     VideoCodec[] videoCodecs;
20   };
21
22   dictionary SystemCPU {
23     long numOfProcessors;
24     DOMString archName;
25     double load;
26   };
27
28   dictionary DisplayUnit {
29     DOMString id;
30     DOMString name;
31     boolean isPrimary;
32     boolean isInternal;
33     long dpiX;
34     long dpiY;
35     long width;
36     long height;
37     long availWidth;
38     long availHeight;
39   };
40
41   dictionary SystemDisplay {
42     DisplayUnit[] displays;
43   };
44
45   dictionary SystemMemory {
46     // If we use long here, it will overflow.
47     double capacity;
48     double availCapacity;
49   };
50
51   enum StorageUnitType {
52     fixed,
53     removable,
54     unknown
55   };
56
57   dictionary StorageUnit {
58     DOMString id;
59     DOMString name;
60     DOMString type;
61     double capacity;
62   };
63
64   dictionary SystemStorage {
65     StorageUnit[] storages;
66   };
67
68   callback SystemAVCodecsPromise = void (SystemAVCodecs info, DOMString error);
69   callback SystemCPUPromise = void (SystemCPU info, DOMString error);
70   callback SystemDisplayPromise = void (SystemDisplay info, DOMString error);
71   callback SystemMemoryPromise = void (SystemMemory info, DOMString error);
72   callback SystemStoragePromise = void (SystemStorage info, DOMString error);
73
74   interface Functions {
75     static void getAVCodecs(SystemAVCodecsPromise promise);
76     static void getCPUInfo(SystemCPUPromise promise);
77     static void getDisplayInfo(SystemDisplayPromise promise);
78     static void getMemoryInfo(SystemMemoryPromise promise);
79     static void getStorageInfo(SystemStoragePromise promise);
80
81     [nodoc] static DeviceCapabilities deviceCapabilitiesConstructor(DOMString objectId);
82   };
83 };