common: move file paths to spec file
[platform/core/api/system-info.git] / include / system_info_private.h
1 /*
2  * Copyright (c) 2011 - 2015 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_PRIVATE_H__
19 #define __TIZEN_SYSTEM_SYSTEM_INFO_PRIVATE_H__
20
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25
26 #ifndef API
27 #define API __attribute__ ((visibility("default")))
28 #endif
29
30 #define CPU_INFO_FILE_PATH "/proc/cpuinfo"
31 #define CPU_INFO_MAX_FREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
32 #define MAXBUFSIZE 512
33
34 #define PLATFORM_TAG    "platform"
35 #define CUSTOM_TAG              "custom"
36 #define INTERNAL_TAG    "internal"
37
38 #define BOOL_TYPE       "bool"
39 #define INT_TYPE        "int"
40 #define DBL_TYPE        "double"
41 #define STR_TYPE        "string"
42
43 #define BOARD_CONFIG    "board"
44
45 /**
46  * @brief Enumeration of key for system information
47  */
48 typedef enum {
49         SYSTEM_INFO_KEY_MODEL,                  /**< The model of the device */
50         SYSTEM_INFO_KEY_TIZEN_VERSION,          /**< The version of the Tizen API */
51         SYSTEM_INFO_KEY_PLATFORM_NAME,          /**< The name of platform */
52         SYSTEM_INFO_KEY_TIZEN_VERSION_NAME,     /**< The name of tizen version  */
53         SYSTEM_INFO_KEY_MANUFACTURER,           /**< The manufacturer of the device */
54         SYSTEM_INFO_KEY_CORE_CPU_ARCH,          /**< The CORE CPU architecture of model */
55         SYSTEM_INFO_KEY_CORE_CPU_FREQ,          /**< The CORE CPU frequency of model */
56         SYSTEM_INFO_KEY_BUILD_STRING,           /**< The build string of platform binary */
57         SYSTEM_INFO_KEY_BUILD_DATE,             /**< The build date of platform binary */
58         SYSTEM_INFO_KEY_BUILD_TIME,             /**< The build time of platform binary */
59         SYSTEM_INFO_KEY_SCREEN_HEIGHT,          /**< The height of the screen in pixels */
60         SYSTEM_INFO_KEY_SCREEN_WIDTH,           /**< The width of the screen in pixels */
61         SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, /**< The physical screen height in millimeters */
62         SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH,  /**< The physical screen width in millimeters */
63         SYSTEM_INFO_KEY_TETHERING_SUPPORTED,    /**< Indicates whether the device supports tethering */
64 } system_info_key_e;
65
66 typedef enum {
67         SYSTEM_INFO_DATA_TYPE_STRING,
68         SYSTEM_INFO_DATA_TYPE_INT,
69         SYSTEM_INFO_DATA_TYPE_DOUBLE,
70         SYSTEM_INFO_DATA_TYPE_BOOL
71 } system_info_data_type_e;
72
73 /**
74  * @brief Enumeration of Mode type
75  */
76 typedef enum {
77         SYSTEM_INFO_MODEL_TYPE_EMULATOR,
78         SYSTEM_INFO_MODEL_TYPE_TARGET
79 } system_info_mode_type_e;
80
81 typedef int (*system_info_get_value_cb) (system_info_key_e key, system_info_data_type_e data_type, void **value);
82
83 system_info_mode_type_e system_info_get_system_info_model_type(void);
84
85 int system_info_ini_get_string(char *ini_file, char *key, char **output);
86 int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value);
87 int system_info_get_value_from_config_xml(char *feature_tag, const char *name_field, char *type_field, char **value);
88
89 int system_info_vconf_get_value_int(const char *vconf_key, int *value);
90 int system_info_vconf_get_value_bool(const char *vconf_key, bool *value);
91 int system_info_vconf_get_value_double(const char *vconf_key, double *value);
92 int system_info_vconf_get_value_string(const char *vconf_key, char **value);
93
94 int system_info_get_model(system_info_key_e key, system_info_data_type_e data_type, void **value);
95 int system_info_get_tizen_version(system_info_key_e key, system_info_data_type_e data_type, void **value);
96 int system_info_get_platform_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
97 int system_info_get_tizen_version_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
98 int system_info_get_core_cpu_arch(system_info_key_e key, system_info_data_type_e data_type, void **value);
99 int system_info_get_core_cpu_freq(system_info_key_e key, system_info_data_type_e data_type, void **value);
100 int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
101 int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value);
102 int system_info_get_physical_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
103 int system_info_get_physical_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value);
104 int system_info_get_manufacturer(system_info_key_e key, system_info_data_type_e data_type, void **value);
105 int system_info_get_build_string(system_info_key_e key, system_info_data_type_e data_type, void **value);
106 int system_info_get_build_date(system_info_key_e key, system_info_data_type_e data_type, void **value);
107 int system_info_get_build_time(system_info_key_e key, system_info_data_type_e data_type, void **value);
108 int system_info_get_tethering_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
109
110 int system_info_get_no_file(const char *key, void **value);
111
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif /* __TIZEN_SYSTEM_SYSTEM_INFO_PRIVATE_H__ */