2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FSysSystemInfo.h
19 * @brief This is the header file for the %SystemInfo class.
21 * This header file contains the declarations of the %SystemInfo class.
24 #ifndef _FSYS_SYSTEM_INFO_H_
25 #define _FSYS_SYSTEM_INFO_H_
27 #include <FBaseString.h>
28 #include <FBaseUuId.h>
29 #include <FBaseColIList.h>
31 namespace Tizen { namespace System
35 * @enum SystemInfoValueType
37 * Defines the data type for the %SystemInfo class.
41 enum SystemInfoValueType
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 */
55 * @brief This class provides methods for getting system information.
59 * @final This class is not intended for extension.
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 information, you must provide the <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">SystemInfo key</a>.
65 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/sysinfo.htm">System Information</a>.
67 * The following example demonstrates how to use the %SystemInfo class.
71 * #include <FSystem.h>
73 * using namespace Tizen::Base;
74 * using namespace Tizen::System;
77 * MyClass::GetSystemInfomation(void)
79 * result r = E_SUCCESS;
81 * String key(L"http://tizen.org/system/duid");
82 * String deviceUniqueId;
84 * r = SystemInfo::GetValue(key, deviceUniqueId);
85 * TryCatch(r == E_SUCCESS, , "MySystemInfo: To get a value is failed");
95 class _OSP_EXPORT_ SystemInfo
96 : public Tizen::Base::Object
101 * Gets the specific Tizen::Base::String type system information based on the specified designators (key).
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
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>.
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.
118 static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
121 * Gets the specific integer type system information based on the specified designators (key).
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
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>.
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.
138 static result GetValue(const Tizen::Base::String& key, int& value);
141 * Gets the specific double type system information based on the specified designators (key).
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.
152 static result GetValue(const Tizen::Base::String& key, double& value);
155 * Gets the specific UuId type system information based on the specified designators (key).
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.
166 static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
169 * Gets the specific system information based on the specified key and data type of the information.
173 * @return A 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
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>.
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.
186 static Tizen::Base::Collection::IList* GetValuesN(const Tizen::Base::String& key, SystemInfoValueType type);
189 * Gets the specific boolean type system information based on the specified designators (key).
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
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>.
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.
206 static result GetValue(const Tizen::Base::String& key, bool& value);
209 * Gets the platform version in the "[Major].[Minor].[Patch Version]" format.
214 * @privilege %http://tizen.org/privilege/system @n
215 * (%http://tizen.org/privilege/platforminfo is deprecated.)
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/system @n
232 * (%http://tizen.org/privilege/platforminfo is deprecated.)
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.
240 static result GetNativeApiVersion(Tizen::Base::String& nativeApiVersion);
243 * Gets the WEB API version in the "[Major].[Minor]" format.
248 * @privilege %http://tizen.org/privilege/system @n
249 * (%http://tizen.org/privilege/platforminfo is deprecated.)
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.
257 static result GetWebApiVersion(Tizen::Base::String& webApiVersion);
260 * Gets the platform build information.
265 * @privilege %http://tizen.org/privilege/system @n
266 * (%http://tizen.org/privilege/platforminfo is deprecated.)
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.
274 static result GetBuildInfo(Tizen::Base::String& buildInfo);
277 * Gets the International Mobile Equipment Identity (IMEI) of the device.
282 * @privilege %http://tizen.org/privilege/systemmanager @n
283 * (%http://tizen.org/privilege/useridentity is deprecated.)
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.
291 static result GetImei(Tizen::Base::String& imei);
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.
300 * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
302 virtual ~SystemInfo(void);
305 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
307 SystemInfo(const SystemInfo& value);
310 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
312 SystemInfo& operator =(const SystemInfo& value);
315 friend class _SystemInfoImpl;
316 class _SystemInfoImpl* __pSystemInfoImpl;
321 #endif //_FSYS_SYSTEM_INFO_H_