sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FSysSystemInfo.h
1 //
2 // Open Service Platform
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 /**
19  * @file        FSysSystemInfo.h
20  * @brief       This is the header file for the %SystemInfo class.
21  *
22  * This header file contains the declarations of the %SystemInfo class.
23  */
24
25 #ifndef _FSYS_SYSTEM_INFO_H_
26 #define _FSYS_SYSTEM_INFO_H_
27
28 #include <FBaseString.h>
29 #include <FBaseUuId.h>
30 #include <FBaseColIList.h>
31
32 namespace Tizen { namespace System
33 {
34
35 /**
36  * @enum        SystemInfoValueType
37  *
38  * Defines the data type for the %SystemInfo class.
39  *
40  * @since       2.0
41  */
42 enum SystemInfoValueType
43 {
44         VALUE_TYPE_STRING,      // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_STRING.
45         VALUE_TYPE_INTEGER,     // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_INTEGER.
46         VALUE_TYPE_DOUBLE,      // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_DOUBLE.
47         VALUE_TYPE_UUID,        // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_UUID.
48         SYSTEM_INFO_VALUE_TYPE_STRING = VALUE_TYPE_STRING,      /**< The Tizen::Base::String type */
49         SYSTEM_INFO_VALUE_TYPE_INTEGER = VALUE_TYPE_INTEGER,    /**< The Tizen::Base::Integer type */
50         SYSTEM_INFO_VALUE_TYPE_DOUBLE = VALUE_TYPE_DOUBLE,      /**< The Tizen::Base::Double type */
51         SYSTEM_INFO_VALUE_TYPE_UUID = VALUE_TYPE_UUID,          /**< The Tizen::Base::UuId type */
52 };
53
54 /**
55  * @class       SystemInfo
56  * @brief       This class provides methods for getting system information.
57  *
58  * @since       2.0
59  *
60  * @final       This class is not intended for extension.
61  *
62  * The %SystemInfo class provides system information, such as the API and platform versions, supported device features,
63  * and screen dimensions.
64  * To get the information, you must provide the <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">SystemInfo key</a>.
65  *
66  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">System Information</a>.
67  *
68  * The following example demonstrates how to use the %SystemInfo class.
69  *
70  * @code
71  * #include <FBase.h>
72  * #include <FSystem.h>
73  *
74  * using namespace Tizen::Base;
75  * using namespace Tizen::System;
76  *
77  * result
78  * MyClass::GetSystemInfomation(void)
79  * {
80  *       result r = E_SUCCESS;
81  *
82  *       String key(L"http://tizen.org/system/duid");
83  *       String deviceUniqueId;
84  *
85  *       r = SystemInfo::GetValue(key, deviceUniqueId);
86  *       TryCatch(r == E_SUCCESS, , "MySystemInfo: To get a value is failed");
87  *
88  *       return E_SUCCESS;
89  *
90  *      CATCH:
91  *       return r;
92  * }
93  * @endcode
94  *
95  */
96 class _OSP_EXPORT_ SystemInfo
97         : public Tizen::Base::Object
98 {
99
100 public:
101         /**
102          * Gets the specific Tizen::Base::String type system information based on the specified designators (key).
103          *
104          * @since       2.0
105          *
106          * @return      An error code
107          * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
108          * @if OSPCOMPAT
109          *                      The following key values are updated: @n
110          *                      - @b Since: @b 2.0 Refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
111          *                              @xmlonly <pcheck kind="value" since="2.0">telephony, input.keyboard.layout, screen.size, screen.coordinatesystem.physical, screen.coordinatesystem.logical, platform.core.cpu.arch, platform.core.fpu.arch, platform.name, modelname, duid, map.provider</pcheck> @endxmlonly
112          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
113          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
114          * @endif
115          * @param[out]  value                   The system information of type Tizen::Base::String
116          * @exception   E_SUCCESS               The method is successful.
117          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
118          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
119          */
120         static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
121
122         /**
123          * Gets the specific integer type system information based on the specified designators (key).
124          *
125          * @since       2.0
126          *
127          * @return      An error code
128          * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
129          * @if OSPCOMPAT
130          *                      The following key values are updated: @n
131          *                      - @b Since: @b 2.0 Refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
132          *                              @xmlonly <pcheck kind="value" since="2.0">multipointtouch.pointcount, sound.media.volume.max, sound.notification.volume.max, sound.ringtone.volume.max, sound.system.volume.max, screen.bpp, screen.height, screen.width, screen.dpi</pcheck> @endxmlonly 
133          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
134          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
135          * @endif
136          * @param[out]  value                   The integer type system information
137          * @exception   E_SUCCESS               The method is successful.
138          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
139          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
140          */
141         static result GetValue(const Tizen::Base::String& key, int& value);
142
143         /**
144          * Gets the specific double type system information based on the specified designators (key).
145          *
146          * @since       2.0
147          *
148          * @return      An error code
149          * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information
150          * @param[out]  value                   The @c double type system information
151          * @exception   E_SUCCESS               The method is successful.
152          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
153          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
154          */
155         static result GetValue(const Tizen::Base::String& key, double& value);
156
157         /**
158          * Gets the specific UuId type system information based on the specified designators (key).
159          *
160          * @since       2.0
161          *
162          * @return      An error code
163          * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information
164          * @param[out]  value                   The UuId type system information
165          * @exception   E_SUCCESS               The method is successful.
166          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
167          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
168          */
169         static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
170
171         /**
172          * Gets the specific system information based on the specified key and data type of the information.
173          *
174          * @since       2.0
175          *
176          * @return      A system information list
177          * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
178          * @if OSPCOMPAT
179          *              The following key values are updated @n
180          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
181          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
182          * @endif
183          * @param[in]   type                    The data type of the information
184          * @exception   E_SUCCESS               The method is successful.
185          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
186          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
187          * @remarks     The specific error code can be accessed using the GetLastResult() method.
188          */
189         static Tizen::Base::Collection::IList* GetValuesN(const Tizen::Base::String& key, SystemInfoValueType type);
190
191         /**
192          * Gets the specific boolean type system information based on the specified designators (key).
193          *
194          * @since       2.0
195          *
196          * @return      An error code
197          * @param[in]   key     The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
198          * @if OSPCOMPAT
199          *                      The following key values are updated: @n
200          *                      - @b Since: @b 2.0 Refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
201          *                              @xmlonly <pcheck kind="value" since="2.0">bluetooth, camera, camera.front, camera.front.flash, camera.back, camera.back.flash, location, location.wps, location.gps, microphone, nfc, sensor.barometer, sensor.barometer.wakeup, sensor.accelerometer, sensor.accelerometer.wakeup, sensor.magnetometer, sensor.magnetometer.wakeup, sensor.gyroscope, sensor.gyroscope.wakeup, sensor.photometer, sensor.photometer.wakeup, sensor.tiltmeter, sensor.tiltmeter.wakeup, sensor.proximity, sensor.proximity.wakeup, usb.host, usb.accessory, input.keyboard, wifi, wifi.direct, opengles.version.1_1, opengles.version.2_0, screen.desktopmode, screen.output.rca, screen.output.hdmi, fmradio, speech.recognition, sip.voip</pcheck> @endxmlonly 
202          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
203          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
204          * @endif
205          * @param[out]  value                   The @c bool type system information
206          * @exception   E_SUCCESS               The method is successful.
207          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
208          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
209          */
210         static result GetValue(const Tizen::Base::String& key, bool& value);
211
212         /**
213          * Gets the platform version in the "[Major].[Minor].[Build Version]" format.
214          *
215          * @since 2.0
216          *
217          * @privilege   %http://tizen.org/privilege/platforminfo
218          *
219          * @return      An error code
220          * @param[out]  platformVersion         The platform version
221          * @exception   E_SUCCESS               The method is successful.
222          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
223          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
224          */
225         static result GetPlatformVersion(Tizen::Base::String& platformVersion);
226
227         /**
228          * Gets the Native API version in the "[Major].[Minor]" format.
229          *
230          * @since 2.0
231          *
232          * @privilege   %http://tizen.org/privilege/platforminfo
233          *
234          * @return      An error code
235          * @param[out]  nativeApiVersion        The Native API version
236          * @exception   E_SUCCESS               The method is successful.
237          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
238          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
239          */
240         static result GetNativeApiVersion(Tizen::Base::String& nativeApiVersion);
241
242         /**
243          * Gets the WEB API version in the "[Major].[Minor]" format.
244          *
245          * @since 2.0
246          *
247          * @privilege   %http://tizen.org/privilege/platforminfo
248          *
249          * @return      An error code
250          * @param[out]  webApiVersion           The %Tizen API version
251          * @exception   E_SUCCESS               The method is successful.
252          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
253          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
254          */
255         static result GetWebApiVersion(Tizen::Base::String& webApiVersion);
256
257         /**
258          * @if VISPARTNER
259          * Gets the International Mobile Equipment Identity (IMEI) of the device.
260          *
261          * @since       2.0
262          *
263          * @visibility  partner
264          * @privilege   %http://tizen.org/privilege/useridentity
265          *
266          * @return      An error code
267          * @param[out]  imei                    The IMEI of the device
268          * @exception   E_SUCCESS               The method is successful.
269          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
270          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.
271          * @endif
272          */
273         static result GetImei(Tizen::Base::String& imei);
274
275 private:
276         /**
277          * This is the default constructor for this class. This default constructor is intentionally declared as private so that only the platform can create an instance.
278          */
279         SystemInfo(void);
280
281         /**
282          * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
283          */
284         virtual ~SystemInfo(void);
285
286         /**
287          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
288          */
289         SystemInfo(const SystemInfo& value);
290
291         /**
292          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
293          */
294         SystemInfo& operator =(const SystemInfo& value);
295
296 private:
297         friend class _SystemInfoImpl;
298         class _SystemInfoImpl* __pSystemInfoImpl;
299 }; // SystemInfo
300
301 } } // Tizen::System
302
303 #endif //_FSYS_SYSTEM_INFO_H_