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 * - @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>.
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.
120 static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
123 * Gets the specific integer type system information based on the specified designators (key).
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
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>.
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.
141 static result GetValue(const Tizen::Base::String& key, int& value);
144 * Gets the specific double type system information based on the specified designators (key).
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.
155 static result GetValue(const Tizen::Base::String& key, double& value);
158 * Gets the specific UuId type system information based on the specified designators (key).
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.
169 static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
172 * Gets the specific system information based on the specified key and data type of the information.
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
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>.
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.
189 static Tizen::Base::Collection::IList* GetValuesN(const Tizen::Base::String& key, SystemInfoValueType type);
192 * Gets the specific boolean type system information based on the specified designators (key).
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
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>.
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.
210 static result GetValue(const Tizen::Base::String& key, bool& value);
213 * Gets the platform version in the "[Major].[Minor].[Build Version]" format.
217 * @privilege %http://tizen.org/privilege/platforminfo
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.
225 static result GetPlatformVersion(Tizen::Base::String& platformVersion);
228 * Gets the Native API version in the "[Major].[Minor]" format.
232 * @privilege %http://tizen.org/privilege/platforminfo
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.
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);
259 * Gets the International Mobile Equipment Identity (IMEI) of the device.
263 * @visibility partner
264 * @privilege %http://tizen.org/privilege/useridentity
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.
273 static result GetImei(Tizen::Base::String& imei);
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.
282 * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
284 virtual ~SystemInfo(void);
287 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
289 SystemInfo(const SystemInfo& value);
292 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
294 SystemInfo& operator =(const SystemInfo& value);
297 friend class _SystemInfoImpl;
298 class _SystemInfoImpl* __pSystemInfoImpl;
303 #endif //_FSYS_SYSTEM_INFO_H_