refactoring for model-config
[framework/api/system-info.git] / include / system_info.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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 #ifndef __TIZEN_SYSTEM_SYSTEM_INFO_H__
19 #define __TIZEN_SYSTEM_SYSTEM_INFO_H__
20
21 #include <tizen.h>
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 /**
29  * @addtogroup CAPI_SYSTEM_SYSTEM_INFO_MODULE
30  * @{
31  */
32
33 /**
34  * @brief Enumeration of error code for system information
35  */
36 typedef enum {
37         SYSTEM_INFO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
38         SYSTEM_INFO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
39         SYSTEM_INFO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
40         SYSTEM_INFO_ERROR_IO_ERROR =  TIZEN_ERROR_IO_ERROR,     /**< An input/output error occurred when read value from system */
41 } system_info_error_e;
42
43 /**
44  * @brief Enumeration of key for system information
45  */
46 typedef enum {
47         SYSTEM_INFO_KEY_MODEL, /**< The model of the device */
48         SYSTEM_INFO_KEY_TIZEN_VERSION, /**< The version of the Tizen API */
49         SYSTEM_INFO_KEY_CAMERA_COUNT, /**< The number of cameras in the device */
50         SYSTEM_INFO_KEY_KEYBOARD_TYPE, /**< The type of the keyboard */
51         SYSTEM_INFO_KEY_MULTI_POINT_TOUCH_COUNT, /**< The maximum number of concurrent touch points supported in the device */
52         SYSTEM_INFO_KEY_NETWORK_TYPE, /**< The supported network type */
53         SYSTEM_INFO_KEY_OPENGLES_VERSION, /**< The supported version of the OpenGL ES */
54         SYSTEM_INFO_KEY_SCREEN_BITS_PER_PIXEL, /**< The number of bits per pixel */
55         SYSTEM_INFO_KEY_SCREEN_HEIGHT, /**< The height of the screen in pixels */
56         SYSTEM_INFO_KEY_SCREEN_WIDTH, /**< The width of the screen in pixels */
57         SYSTEM_INFO_KEY_PLATFORM_NAME, /**< The name of platform */
58         SYSTEM_INFO_KEY_TIZEN_VERSION_NAME, /**< The name of tizen version  */
59         SYSTEM_INFO_KEY_SCREEN_DPI, /**< The width of the screen DPI */
60         SYSTEM_INFO_KEY_CORE_CPU_ARCH, /**< The CORE CPU architecture of model */
61         SYSTEM_INFO_KEY_CORE_FPU_ARCH, /**< The CORE FPU architecture of model */
62         SYSTEM_INFO_KEY_OPENGLES_TEXTURE_FORMAT, /**< The supported texture format of the OpenGL ES */
63         SYSTEM_INFO_KEY_CORE_CPU_FREQ, /**< The CORE CPU frequency of model */
64         SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, /**< The physical screen height in millimeters */
65         SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH, /**< The physical screen width in millimeters */
66         SYSTEM_INFO_KEY_BUILD_STRING, /**< The build string of platform binary */
67         SYSTEM_INFO_KEY_BUILD_DATE, /**< The build date of platform binary */
68         SYSTEM_INFO_KEY_BUILD_TIME, /**< The build time of platform binary */
69         SYSTEM_INFO_KEY_BLUETOOTH_SUPPORTED, /**< Indicates whether the device supports Bluetooth */
70         SYSTEM_INFO_KEY_FMRADIO_SUPPORTED, /**< Indicates whether the device supports FM radio */
71         SYSTEM_INFO_KEY_GPS_SUPPORTED, /**< Indicates whether the device supports GPS */
72         SYSTEM_INFO_KEY_NFC_SUPPORTED, /**< Indicates whether the device supports NFC */
73         SYSTEM_INFO_KEY_WIFI_SUPPORTED, /**< Indicates whether the device supports Wi-Fi */
74         SYSTEM_INFO_KEY_WIFI_DIRECT_SUPPORTED, /**< Indicates whether the device supports Wi-Fi Direct */
75         SYSTEM_INFO_KEY_WPS_SUPPORTED, /**< Indicates whether the device supports WPS */
76         SYSTEM_INFO_KEY_USB_HOST_SUPPORTED, /**< Indicates whether the device supports USB host */
77         SYSTEM_INFO_KEY_USB_ACCESSORY_SUPPORTED, /**< Indicates whether the device supports USB accessory */
78         SYSTEM_INFO_KEY_FRONT_CAMERA_SUPPORTED, /**< Indicates whether the device supports front camera */
79         SYSTEM_INFO_KEY_FRONT_CAMERA_FLASH_SUPPORTED, /**< Indicates whether the device supports front camera flash */
80         SYSTEM_INFO_KEY_BACK_CAMERA_SUPPORTED, /**< Indicates whether the device supports back camera */
81         SYSTEM_INFO_KEY_BACK_CAMERA_FLASH_SUPPORTED, /**< Indicates whether the device supports back camera flash */
82         SYSTEM_INFO_KEY_HDMI_SUPPORTED, /**< Indicates whether the device supports HDMI */
83         SYSTEM_INFO_KEY_RCA_SUPPORTED, /**< Indicates whether the device supports RCA */
84         SYSTEM_INFO_KEY_SIP_VOIP_SUPPORTED, /**< Indicates whether the device supports SIP VOIP */
85         SYSTEM_INFO_KEY_MICROPHONE_SUPPORTED, /**< Indicates whether the device supports Microphone */
86         SYSTEM_INFO_KEY_SPEECH_RECOGNITION_SUPPORTED, /**< Indicates whether the device supports stt */
87         SYSTEM_INFO_KEY_BAROMETER_SENSOR_SUPPORTED, /**< Indicates whether the device supports barometer sensor */
88         SYSTEM_INFO_KEY_MMS_SUPPORTED, /**< Indicates whether the device supports MMS */
89         SYSTEM_INFO_KEY_SMS_SUPPORTED, /**< Indicates whether the device supports SMS */
90         SYSTEM_INFO_KEY_CBS_SUPPORTED, /**< Indicates whether the device supports CBS */
91         SYSTEM_INFO_KEY_NFC_RESERVED_PUSH_SUPPORTED, /**< Indicates whether the device supports nfc-reserved push */
92         SYSTEM_INFO_KEY_TETHERING_SUPPORTED, /**< Indicates whether the device supports tethering */
93         SYSTEM_INFO_KEY_SPEECH_SYNTHESIS_SUPPORTED, /**< Indicates whether the device supports tts */
94         SYSTEM_INFO_KEY_GRAPHICS_HWACCEL_SUPPORTED, /**< Indicates whether the device supports graphics hardware acceleration */
95         SYSTEM_INFO_KEY_FEATURE_AUTO_ROTATION_SUPPORTED, /**< Indicates whether the device supports native auto rotation feature */
96         SYSTEM_INFO_KEY_FEATURE_PINCH_ZOOM_SUPPORTED, /**< Indicates whether the device supports pinch zoom feature */
97         SYSTEM_INFO_KEY_MANUFACTURER, /**< The manufacturer of the device */
98 } system_info_key_e;
99
100 /**
101  * @brief   Gets the integer value of the system information
102  * @param[in] key The name of the system information to get
103  * @param[out] value The value of the given system information
104  * @return  0 on success, otherwise a negative error value.
105  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
106  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
107  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
108  */
109 int system_info_get_value_int(system_info_key_e key, int *value);
110
111 /**
112  * @brief   Gets the boolean value of the system information
113  * @param[in] key The name of the system information to get
114  * @param[out] value The value of the given system information
115  * @return  0 on success, otherwise a negative error value.
116  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
117  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
118  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
119  */
120 int system_info_get_value_bool(system_info_key_e key, bool *value);
121
122 /**
123  * @brief   Gets the double value of the system information
124  * @param[in] key The name of the system information to get
125  * @param[out] value The value of the given system information
126  * @return  0 on success, otherwise a negative error value.
127  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
128  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
129  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
130  */
131 int system_info_get_value_double(system_info_key_e key, double *value);
132
133 /**
134  * @brief   Gets the string value of the system information
135  * @remarks The @a value must be released with free() by you.
136  * @param[in] key The name of the system information to get
137  * @param[out] value The value of the given system information
138  * @return  0 on success, otherwise a negative error value.
139  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
140  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
141  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
142  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
143  */
144 int system_info_get_value_string(system_info_key_e key, char **value);
145
146 int system_info_get_external_bool(const char *key, bool *value);
147 int system_info_get_external_int(const char *key, int *value);
148 int system_info_get_external_double(const char *key, double *value);
149 int system_info_get_external_string(const char *key, char **value);
150
151 /**
152  * @brief   Gets the boolean value of the platform feature
153  * @param[in] key The name of the platform feature to get
154  * @param[out] value The value of the given platform feature
155  * @return  0 on success, otherwise a negative error value.
156  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
157  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
158  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
159  */
160 int system_info_get_platform_bool(const char *key, bool *value);
161
162 /**
163  * @brief   Gets the integer value of the platform feature
164  * @param[in] key The name of the platform feature to get
165  * @param[out] value The value of the given platform feature
166  * @return  0 on success, otherwise a negative error value.
167  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
168  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
169  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
170  */
171 int system_info_get_platform_int(const char *key, int *value);
172
173 /**
174  * @brief   Gets the string value of the platform feature
175  * @remarks The @a value must be released with free() by you.
176  * @param[in] key The name of the platform feature to get
177  * @param[out] value The value of the given platform feature
178  * @return  0 on success, otherwise a negative error value.
179  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
180  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
181  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
182  */
183 int system_info_get_platform_double(const char *key, double *value);
184
185 /**
186  * @brief   Gets the string value of the platform feature
187  * @remarks The @a value must be released with free() by you.
188  * @param[in] key The name of the platform feature to get
189  * @param[out] value The value of the given platform feature
190  * @return  0 on success, otherwise a negative error value.
191  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
192  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
193  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
194  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
195  */
196 int system_info_get_platform_string(const char *key, char **value);
197
198
199 /**
200  * @brief   Gets the boolean value of the custom feature
201  * @param[in] key The name of the custom feature to get
202  * @param[out] value The value of the given custom feature
203  * @return  0 on success, otherwise a negative error value.
204  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
205  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
206  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
207  */
208 int system_info_get_custom_bool(const char *key, bool *value);
209
210 /**
211  * @brief   Gets the string value of the custom feature
212  * @remarks The @a value must be released with free() by you.
213  * @param[in] key The name of the custom feature to get
214  * @param[out] value The value of the given custom feature
215  * @return  0 on success, otherwise a negative error value.
216  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
217  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
218  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
219  */
220 int system_info_get_custom_int(const char *key, int *value);
221
222 /**
223  * @brief   Gets the string value of the custom feature
224  * @remarks The @a value must be released with free() by you.
225  * @param[in] key The name of the custom feature to get
226  * @param[out] value The value of the given custom feature
227  * @return  0 on success, otherwise a negative error value.
228  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
229  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
230  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
231  */
232 int system_info_get_custom_double(const char *key, double *value);
233
234 /**
235  * @brief   Gets the string value of the custom feature
236  * @remarks The @a value must be released with free() by you.
237  * @param[in] key The name of the custom feature to get
238  * @param[out] value The value of the given custom feature
239  * @return  0 on success, otherwise a negative error value.
240  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
241  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
242  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
243  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
244  */
245 int system_info_get_custom_string(const char *key, char **value);
246
247 /**
248  * @brief   Gets the boolean value of the internal feature
249  * @param[in] key The name of the custom feature to get
250  * @param[out] value The value of the given internal feature
251  * @return  0 on success, otherwise a negative error value.
252  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
253  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
254  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
255  */
256 int system_info_get_internal_bool(const char *key, bool *value);
257
258 /**
259  * @brief   Gets the string value of the internal feature
260  * @remarks The @a value must be released with free() by you.
261  * @param[in] key The name of the custom feature to get
262  * @param[out] value The value of the given internal feature
263  * @return  0 on success, otherwise a negative error value.
264  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
265  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
266  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
267  */
268 int system_info_get_internal_int(const char *key, int *value);
269
270 /**
271  * @brief   Gets the string value of the internal feature
272  * @remarks The @a value must be released with free() by you.
273  * @param[in] key The name of the custom feature to get
274  * @param[out] value The value of the given internal feature
275  * @return  0 on success, otherwise a negative error value.
276  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
277  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
278  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
279  */
280 int system_info_get_internal_double(const char *key, double *value);
281
282 /**
283  * @brief   Gets the string value of the internal feature
284  * @remarks The @a value must be released with free() by you.
285  * @param[in] key The name of the internal feature to get
286  * @param[out] value The value of the given internal feature
287  * @return  0 on success, otherwise a negative error value.
288  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
289  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
290  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
291  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
292  */
293 int system_info_get_internal_string(const char *key, char **value);
294
295 /**
296  * @}
297  */
298
299 #ifdef __cplusplus
300 }
301 #endif
302
303 #endif /* __TIZEN_SYSTEM_SYSTEM_INFO_H__ */