2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FSysSystemInfo.h
20 * @brief This is the header file for the %SystemInfo class.
22 * This header file contains the declarations of the %SystemInfo class.
25 #ifndef _FSYS_SYSTEM_INFO_H_
26 #define _FSYS_SYSTEM_INFO_H_
28 #include <FBaseString.h>
29 #include <FBaseUuId.h>
30 #include <FBaseColIList.h>
32 namespace Tizen { namespace System
36 * @enum SystemInfoValueType
38 * Defines the data type for the %SystemInfo class.
42 enum SystemInfoValueType
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 */
56 * @brief This class provides methods for getting system information.
60 * @final This class is not intended for extension.
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>.
66 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">System Information</a>.
68 * The following example demonstrates how to use the %SystemInfo class.
72 * #include <FSystem.h>
74 * using namespace Tizen::Base;
75 * using namespace Tizen::System;
78 * MyClass::GetSystemInfomation(void)
80 * result r = E_SUCCESS;
82 * String key(L"http://tizen.org/system/duid");
83 * String deviceUniqueId;
85 * r = SystemInfo::GetValue(key, deviceUniqueId);
86 * TryCatch(r == E_SUCCESS, , "MySystemInfo: To get a value is failed");
96 class _OSP_EXPORT_ SystemInfo
97 : public Tizen::Base::Object
102 * Gets the specific Tizen::Base::String type system information based on the specified designators (key).
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
109 * The following key values are updated: @n
110 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
111 * - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer
112 * <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
114 * @param[out] value The system information of type Tizen::Base::String
115 * @exception E_SUCCESS The method is successful.
116 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
117 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
119 static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
122 * Gets the specific integer type system information based on the specified designators (key).
126 * @return An error code
127 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
129 * The following key values are updated: @n
130 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
131 * - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer
132 * <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
134 * @param[out] value The integer type system information
135 * @exception E_SUCCESS The method is successful.
136 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
137 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
139 static result GetValue(const Tizen::Base::String& key, int& value);
142 * Gets the specific double type system information based on the specified designators (key).
146 * @return An error code
147 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information
148 * @param[out] value The @c double type system information
149 * @exception E_SUCCESS The method is successful.
150 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
151 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
153 static result GetValue(const Tizen::Base::String& key, double& value);
156 * Gets the specific UuId type system information based on the specified designators (key).
160 * @return An error code
161 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information
162 * @param[out] value The UuId type system information
163 * @exception E_SUCCESS The method is successful.
164 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
165 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
167 static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
170 * Gets the specific system information based on the specified key and data type of the information.
174 * @return A system information list
175 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
177 * The following key values are updated @n
178 * - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer
179 * <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
181 * @param[in] type The data type of the information
182 * @exception E_SUCCESS The method is successful.
183 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
184 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
185 * @remarks The specific error code can be accessed using the GetLastResult() method.
187 static Tizen::Base::Collection::IList* GetValuesN(const Tizen::Base::String& key, SystemInfoValueType type);
190 * Gets the specific boolean type system information based on the specified designators (key).
194 * @return An error code
195 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">key name</a> of the system information @n
197 * The following key values are updated: @n
198 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">here</a>.
199 * - @b Deprecated All the key values provided prior to %Tizen 2.0 are deprecated. For more detailed information, refer
200 * <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo_deprecated.htm">here</a>.
202 * @param[out] value The @c bool type system information
203 * @exception E_SUCCESS The method is successful.
204 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
205 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
207 static result GetValue(const Tizen::Base::String& key, bool& value);
210 * Gets the platform version in the "[Major].[Minor].[Patch Version]" format.
215 * @privilege %http://tizen.org/privilege/platforminfo
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.
223 static result GetPlatformVersion(Tizen::Base::String& platformVersion);
226 * Gets the Native API version in the "[Major].[Minor]" format.
231 * @privilege %http://tizen.org/privilege/platforminfo
233 * @return An error code
234 * @param[out] nativeApiVersion The Native API version
235 * @exception E_SUCCESS The method is successful.
236 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
237 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
239 static result GetNativeApiVersion(Tizen::Base::String& nativeApiVersion);
242 * Gets the WEB API version in the "[Major].[Minor]" format.
247 * @privilege %http://tizen.org/privilege/platforminfo
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.
255 static result GetWebApiVersion(Tizen::Base::String& webApiVersion);
258 * Gets the platform build information.
263 * @privilege %http://tizen.org/privilege/platforminfo
265 * @return An error code
266 * @param[out] buildInfo The %Tizen build information
267 * @exception E_SUCCESS The method is successful.
268 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
269 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
271 static result GetBuildInfo(Tizen::Base::String& buildInfo);
274 * Gets the International Mobile Equipment Identity (IMEI) of the device.
279 * @privilege %http://tizen.org/privilege/useridentity
281 * @return An error code
282 * @param[out] imei The IMEI of the device
283 * @exception E_SUCCESS The method is successful.
284 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
285 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
287 static result GetImei(Tizen::Base::String& imei);
291 * 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 * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
298 virtual ~SystemInfo(void);
301 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
303 SystemInfo(const SystemInfo& value);
306 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
308 SystemInfo& operator =(const SystemInfo& value);
311 friend class _SystemInfoImpl;
312 class _SystemInfoImpl* __pSystemInfoImpl;
317 #endif //_FSYS_SYSTEM_INFO_H_