Revise Tizen::Io doxygen
[platform/framework/native/appfw.git] / inc / FSysSystemInfo.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FSysSystemInfo.h
19  * @brief       This is the header file for the %SystemInfo class.
20  *
21  * This header file contains the declarations of the %SystemInfo class.
22  */
23
24 #ifndef _FSYS_SYSTEM_INFO_H_
25 #define _FSYS_SYSTEM_INFO_H_
26
27 #include <FBaseString.h>
28 #include <FBaseUuId.h>
29 #include <FBaseColIList.h>
30
31 namespace Tizen { namespace System
32 {
33
34 /**
35  * @enum        SystemInfoValueType
36  *
37  * Defines the data type for the %SystemInfo class.
38  *
39  * @since       2.0
40  */
41 enum SystemInfoValueType
42 {
43         VALUE_TYPE_STRING,      // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_STRING.
44         VALUE_TYPE_INTEGER,     // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_INTEGER.
45         VALUE_TYPE_DOUBLE,      // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_DOUBLE.
46         VALUE_TYPE_UUID,        // This enum value is deprecated. Instead of using this enum value, use SYSTEM_INFO_VALUE_TYPE_UUID.
47         SYSTEM_INFO_VALUE_TYPE_STRING = VALUE_TYPE_STRING,      /**< The Tizen::Base::String type */
48         SYSTEM_INFO_VALUE_TYPE_INTEGER = VALUE_TYPE_INTEGER,    /**< The Tizen::Base::Integer type */
49         SYSTEM_INFO_VALUE_TYPE_DOUBLE = VALUE_TYPE_DOUBLE,      /**< The Tizen::Base::Double type */
50         SYSTEM_INFO_VALUE_TYPE_UUID = VALUE_TYPE_UUID,          /**< The Tizen::Base::UuId type */
51 };
52
53 /**
54  * @class       SystemInfo
55  * @brief       This class provides methods for getting system information.
56  *
57  * @since       2.0
58  *
59  * @final       This class is not intended for extension.
60  *
61  * The %SystemInfo class provides system information, such as the API and platform versions, supported device features,
62  * and screen dimensions.
63  * To get the system information, you must provide the <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">SystemInfo key</a>.
64  *
65  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">System Information</a>.
66  *
67  * The following example demonstrates how to use the %SystemInfo class.
68  *
69  * @code
70  * #include <FBase.h>
71  * #include <FSystem.h>
72  *
73  * using namespace Tizen::Base;
74  * using namespace Tizen::System;
75  *
76  * result
77  * MyClass::GetSystemInfomation(void)
78  * {
79  *       result r = E_SUCCESS;
80  *
81  *       String key(L"http://tizen.org/system/duid");
82  *       String deviceUniqueId;
83  *
84  *       r = SystemInfo::GetValue(key, deviceUniqueId);
85  *       TryCatch(r == E_SUCCESS, , "MySystemInfo: To get a value is failed");
86  *
87  *       return E_SUCCESS;
88  *
89  *      CATCH:
90  *       return r;
91  * }
92  * @endcode
93  *
94  */
95 class _OSP_EXPORT_ SystemInfo
96         : public Tizen::Base::Object
97 {
98
99 public:
100         /**
101          * Gets the Tizen::Base::String type system information based on the specified designators (key).
102          *
103          * @since               2.0
104          *
105          * @return              An error code
106          * @param[in]   key             The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
107          * @if OSPCOMPAT
108          *                      The following key values are updated: @n
109          *                      - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
110          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
111          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
112          * @endif
113          * @param[out]  value                           The system information of type Tizen::Base::String
114          * @exception   E_SUCCESS                       The method is successful.
115          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
116          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
117          */
118         static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
119
120         /**
121          * Gets the integer type system information based on the specified designators (key).
122          *
123          * @since               2.0
124          *
125          * @return              An error code
126          * @param[in]   key             The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
127          * @if OSPCOMPAT
128          *                      The following key values are updated: @n
129          *                      - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
130          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
131          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
132          * @endif
133          * @param[out]  value                           The integer type system information
134          * @exception   E_SUCCESS                       The method is successful.
135          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
136          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
137          */
138         static result GetValue(const Tizen::Base::String& key, int& value);
139
140         /**
141          * Gets the @c double type system information based on the specified designators (key).
142          *
143          * @since               2.0
144          *
145          * @return              An error code
146          * @param[in]   key             The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information
147          * @param[out]  value                           The @c double type system information
148          * @exception   E_SUCCESS                       The method is successful.
149          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
150          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
151          */
152         static result GetValue(const Tizen::Base::String& key, double& value);
153
154         /**
155          * Gets the UuId type system information based on the specified designators (key).
156          *
157          * @since               2.0
158          *
159          * @return              An error code
160          * @param[in]   key             The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information
161          * @param[out]  value                           The UuId type system information
162          * @exception   E_SUCCESS                       The method is successful.
163          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
164          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
165          */
166         static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
167
168         /**
169          * Gets the system information based on the specified key and data type of the information.
170          *
171          * @since               2.0
172          *
173          * @return              The system information list
174          * @param[in]   key             The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
175          * @if OSPCOMPAT
176          *              The following key values are updated @n
177          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
178          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
179          * @endif
180          * @param[in]   type                            The data type of the information
181          * @exception   E_SUCCESS                       The method is successful.
182          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
183          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
184          * @remarks             The specific error code can be accessed using the GetLastResult() method.
185          */
186         static Tizen::Base::Collection::IList* GetValuesN(const Tizen::Base::String& key, SystemInfoValueType type);
187
188         /**
189          * Gets the @c bool type system information based on the specified designators (key).
190          *
191          * @since               2.0
192          *
193          * @return              An error code
194          * @param[in]   key             The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
195          * @if OSPCOMPAT
196          *                      The following key values are updated: @n
197          *                      - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
198          *                      - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer 
199          *                       <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
200          * @endif
201          * @param[out]  value                           The @c bool type system information
202          * @exception   E_SUCCESS                       The method is successful.
203          * @exception   E_OBJ_NOT_FOUND         The specified @c key is not found.
204          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
205          */
206         static result GetValue(const Tizen::Base::String& key, bool& value);
207
208         /**
209          * Gets the platform version in the "[Major].[Minor].[Patch Version]" format.
210          *
211          * @since               2.0
212          *
213          * @privlevel   public
214          * @privilege   %http://tizen.org/privilege/system @n
215          *                              (%http://tizen.org/privilege/platforminfo is deprecated.)
216          *
217          * @return              An error code
218          * @param[out]  platformVersion         The platform version
219          * @exception   E_SUCCESS                       The method is successful.
220          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
221          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
222          */
223         static result GetPlatformVersion(Tizen::Base::String& platformVersion);
224
225         /**
226          * Gets the native API version in the "[Major].[Minor]" format.
227          *
228          * @since 2.0
229          *
230          * @privlevel   public
231          * @privilege   %http://tizen.org/privilege/system @n
232          *                              (%http://tizen.org/privilege/platforminfo is deprecated.)
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          * @privlevel   public
248          * @privilege   %http://tizen.org/privilege/system @n
249          *                              (%http://tizen.org/privilege/platforminfo is deprecated.)
250          *
251          * @return              An error code
252          * @param[out]  webApiVersion           The %Tizen API version
253          * @exception   E_SUCCESS                       The method is successful.
254          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
255          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
256          */
257         static result GetWebApiVersion(Tizen::Base::String& webApiVersion);
258
259         /**
260          * Gets the platform build information.
261          *
262          * @since               2.1
263          *
264          * @privlevel   public
265          * @privilege   %http://tizen.org/privilege/system @n
266          *                              (%http://tizen.org/privilege/platforminfo is deprecated.)
267          *
268          * @return              An error code
269          * @param[out]  buildInfo                       The %Tizen build information
270          * @exception   E_SUCCESS                       The method is successful.
271          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
272          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
273          */
274         static result GetBuildInfo(Tizen::Base::String& buildInfo);
275
276         /**
277          * Gets the International Mobile Equipment Identity (IMEI) of the device.
278          *
279          * @since               2.0
280          *
281          * @privlevel   partner
282          * @privilege   %http://tizen.org/privilege/systemmanager @n
283          *                              (%http://tizen.org/privilege/useridentity is deprecated.)
284          *
285          * @return              An error code
286          * @param[out]  imei                            The IMEI of the device
287          * @exception   E_SUCCESS                       The method is successful.
288          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
289          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
290          */
291         static result GetImei(Tizen::Base::String& imei);
292
293 private:
294         /**
295          * 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.
296          */
297         SystemInfo(void);
298
299         /**
300          * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
301          */
302         virtual ~SystemInfo(void);
303
304         /**
305          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
306          */
307         SystemInfo(const SystemInfo& value);
308
309         /**
310          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
311          */
312         SystemInfo& operator =(const SystemInfo& value);
313
314 private:
315         friend class _SystemInfoImpl;
316         class _SystemInfoImpl* __pSystemInfoImpl;
317 }; // SystemInfo
318
319 } } // Tizen::System
320
321 #endif //_FSYS_SYSTEM_INFO_H_