Initialize Tizen 2.3
[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_PLATFORM_NAME, /**< The name of platform */
50         SYSTEM_INFO_KEY_TIZEN_VERSION_NAME, /**< The name of tizen version  */
51         SYSTEM_INFO_KEY_MANUFACTURER, /**< The manufacturer of the device */
52         SYSTEM_INFO_KEY_CORE_CPU_ARCH, /**< The CORE CPU architecture of model */
53         SYSTEM_INFO_KEY_CORE_CPU_FREQ, /**< The CORE CPU frequency of model */
54         SYSTEM_INFO_KEY_BUILD_STRING, /**< The build string of platform binary */
55         SYSTEM_INFO_KEY_BUILD_DATE, /**< The build date of platform binary */
56         SYSTEM_INFO_KEY_BUILD_TIME, /**< The build time of platform binary */
57         SYSTEM_INFO_KEY_SCREEN_HEIGHT, /**< The height of the screen in pixels */
58         SYSTEM_INFO_KEY_SCREEN_WIDTH, /**< The width of the screen in pixels */
59         SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, /**< The physical screen height in millimeters */
60         SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH, /**< The physical screen width in millimeters */
61         SYSTEM_INFO_KEY_TETHERING_SUPPORTED, /**< Indicates whether the device supports tethering */
62 } system_info_key_e;
63
64 /**
65  * @brief   Gets the integer value of the system information
66  * @param[in] key The name of the system information to get
67  * @param[out] value The value of the given system information
68  * @return  0 on success, otherwise a negative error value.
69  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
70  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
71  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
72  */
73 int system_info_get_value_int(system_info_key_e key, int *value);
74
75 /**
76  * @brief   Gets the boolean value of the system information
77  * @param[in] key The name of the system information to get
78  * @param[out] value The value of the given system information
79  * @return  0 on success, otherwise a negative error value.
80  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
81  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
82  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
83  */
84 int system_info_get_value_bool(system_info_key_e key, bool *value);
85
86 /**
87  * @brief   Gets the double value of the system information
88  * @param[in] key The name of the system information to get
89  * @param[out] value The value of the given system information
90  * @return  0 on success, otherwise a negative error value.
91  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
92  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
93  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
94  */
95 int system_info_get_value_double(system_info_key_e key, double *value);
96
97 /**
98  * @brief   Gets the string value of the system information
99  * @remarks The @a value must be released with @c free() by you.
100  * @param[in] key The name of the system information to get
101  * @param[out] value The value of the given system information
102  * @return  0 on success, otherwise a negative error value.
103  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
104  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
105  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
106  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
107  */
108 int system_info_get_value_string(system_info_key_e key, char **value);
109
110 /**
111  * @brief   Gets the boolean value of the platform feature
112  * @param[in] key The name of the platform feature to get
113  * @param[out] value The value of the given platform feature
114  * @return  0 on success, otherwise a negative error value.
115  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
116  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
117  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
118  */
119 int system_info_get_platform_bool(const char *key, bool *value);
120
121 /**
122  * @brief   Gets the integer value of the platform feature
123  * @param[in] key The name of the platform feature to get
124  * @param[out] value The value of the given platform feature
125  * @return  0 on success, otherwise a negative error value.
126  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
127  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
128  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
129  */
130 int system_info_get_platform_int(const char *key, int *value);
131
132 /**
133  * @brief   Gets the string value of the platform feature
134  * @param[in] key The name of the platform feature to get
135  * @param[out] value The value of the given platform feature
136  * @return  0 on success, otherwise a negative error value.
137  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
138  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
139  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
140  */
141 int system_info_get_platform_double(const char *key, double *value);
142
143 /**
144  * @brief   Gets the string value of the platform feature
145  * @remarks The @a value must be released with @c free() by you.
146  * @param[in] key The name of the platform feature to get
147  * @param[out] value The value of the given platform feature
148  * @return  0 on success, otherwise a negative error value.
149  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
150  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
151  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
152  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
153  */
154 int system_info_get_platform_string(const char *key, char **value);
155
156
157 /**
158  * @brief   Gets the boolean value of the custom feature
159  * @param[in] key The name of the custom feature to get
160  * @param[out] value The value of the given custom feature
161  * @return  0 on success, otherwise a negative error value.
162  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
163  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
164  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
165  */
166 int system_info_get_custom_bool(const char *key, bool *value);
167
168 /**
169  * @brief   Gets the string value of the custom feature
170  * @param[in] key The name of the custom feature to get
171  * @param[out] value The value of the given custom feature
172  * @return  0 on success, otherwise a negative error value.
173  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
174  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
175  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
176  */
177 int system_info_get_custom_int(const char *key, int *value);
178
179 /**
180  * @brief   Gets the string value of the custom feature
181  * @param[in] key The name of the custom feature to get
182  * @param[out] value The value of the given custom feature
183  * @return  0 on success, otherwise a negative error value.
184  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
185  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
186  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
187  */
188 int system_info_get_custom_double(const char *key, double *value);
189
190 /**
191  * @brief   Gets the string value of the custom feature
192  * @remarks The @a value must be released with @c free() by you.
193  * @param[in] key The name of the custom feature to get
194  * @param[out] value The value of the given custom feature
195  * @return  0 on success, otherwise a negative error value.
196  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
197  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
198  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in model config file
199  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from model config file
200  */
201 int system_info_get_custom_string(const char *key, char **value);
202
203 /**
204  * @brief   Gets the string value of the internal feature
205  * @remarks The @a value must be released with @c free() by you.
206  * @param[in] key The name of the internal feature to get
207  * @param[out] value The value of the given internal feature
208  * @return  0 on success, otherwise a negative error value.
209  * @retval  #SYSTEM_INFO_ERROR_NONE Successful
210  * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
211  * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in config files
212  * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from config files
213  */
214 int system_info_get_internal_value(const char *key, char **value);
215
216
217 /**
218  * @}
219  */
220
221 #ifdef __cplusplus
222 }
223 #endif
224
225 #endif /* __TIZEN_SYSTEM_SYSTEM_INFO_H__ */