Fix minor issues
[platform/core/api/runtime-info.git] / include / runtime_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_RUNTIME_INFO_PRIVATE_H__
19 #define __TIZEN_SYSTEM_RUNTIME_INFO_PRIVATE_H__
20
21 #include <vconf.h>
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 #ifndef API
29 #define API __attribute__ ((visibility("default")))
30 #endif
31
32 #ifdef LOG_TAG
33 #undef LOG_TAG
34 #endif
35 #define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
36
37 #define _E(fmt, arg...) LOGE("[%s,%d] "fmt, __FUNCTION__, __LINE__, ##arg)
38 #define _D(fmt, arg...) LOGD("[%s,%d] "fmt, __FUNCTION__, __LINE__, ##arg)
39 #define _I(fmt, arg...) LOGI("[%s,%d] "fmt, __FUNCTION__, __LINE__, ##arg)
40
41 typedef enum {
42         RUNTIME_INFO_DATA_TYPE_STRING,
43         RUNTIME_INFO_DATA_TYPE_INT,
44         RUNTIME_INFO_DATA_TYPE_DOUBLE,
45         RUNTIME_INFO_DATA_TYPE_BOOL
46 } runtime_info_data_type_e;
47
48 typedef union {
49         int i;
50         bool b;
51         double d;
52         char *s;
53 } runtime_info_value_u;
54
55 typedef runtime_info_value_u * runtime_info_value_h;
56
57 typedef int (*runtime_info_func_get_value) (runtime_info_value_h value);
58 typedef int (*runtime_info_func_set_event_cb) (void);
59 typedef void (*runtime_info_func_unset_event_cb) (void);
60
61 void runtime_info_updated(runtime_info_key_e key);
62
63 int runtime_info_vconf_get_value_int(const char *vconf_key, int *value);
64 int runtime_info_vconf_get_value_bool(const char *vconf_key, int *value);
65 int runtime_info_vconf_get_value_double(const char *vconf_key, double *value);
66 int runtime_info_vconf_get_value_string(const char *vconf_key, char **value);
67
68 int runtime_info_vconf_set_event_cb(const char *vconf_key, runtime_info_key_e runtime_info_key, int slot);
69 void runtime_info_vconf_unset_event_cb(const char *vconf_key, int slot);
70
71 int runtime_info_flightmode_get_value(runtime_info_value_h);
72 int runtime_info_flightmode_set_event_cb(void);
73 void runtime_info_flightmode_unset_event_cb(void);
74
75 int runtime_info_audiojack_get_value(runtime_info_value_h);
76 int runtime_info_audiojack_set_event_cb(void);
77 void runtime_info_audiojack_unset_event_cb(void);
78
79 int runtime_info_wifi_status_get_value(runtime_info_value_h);
80 int runtime_info_wifi_status_set_event_cb(void);
81 void runtime_info_wifi_status_unset_event_cb(void);
82
83 int runtime_info_bt_enabled_get_value(runtime_info_value_h);
84 int runtime_info_bt_enabled_set_event_cb(void);
85 void runtime_info_bt_enabled_unset_event_cb(void);
86
87 int runtime_info_wifi_hotspot_get_value(runtime_info_value_h);
88 int runtime_info_wifi_hotspot_set_event_cb(void);
89 void runtime_info_wifi_hotspot_unset_event_cb(void);
90
91 int runtime_info_bt_hotspot_get_value(runtime_info_value_h);
92 int runtime_info_bt_hotspot_set_event_cb(void);
93 void runtime_info_bt_hotspot_unset_event_cb(void);
94
95 int runtime_info_usb_hotspot_get_value(runtime_info_value_h);
96 int runtime_info_usb_hotspot_set_event_cb(void);
97 void runtime_info_usb_hotspot_unset_event_cb(void);
98
99 int runtime_info_location_service_get_value(runtime_info_value_h);
100 int runtime_info_location_service_set_event_cb(void);
101 void runtime_info_location_service_unset_event_cb(void);
102
103 int runtime_info_location_agps_get_value(runtime_info_value_h);
104 int runtime_info_location_agps_set_event_cb(void);
105 void runtime_info_location_agps_unset_event_cb(void);
106
107 int runtime_info_location_network_get_value(runtime_info_value_h);
108 int runtime_info_location_network_set_event_cb(void);
109 void runtime_info_location_network_unset_event_cb(void);
110
111 int runtime_info_packet_data_get_value(runtime_info_value_h);
112 int runtime_info_packet_data_set_event_cb(void);
113 void runtime_info_packet_data_unset_event_cb(void);
114
115 int runtime_info_data_roaming_get_value(runtime_info_value_h);
116 int runtime_info_data_roaming_set_event_cb(void);
117 void runtime_info_data_roaming_unset_event_cb(void);
118
119 int runtime_info_silent_mode_get_value(runtime_info_value_h);
120 int runtime_info_silent_mode_set_event_cb(void);
121 void runtime_info_silent_mode_unset_event_cb(void);
122
123 int runtime_info_vibration_enabled_get_value(runtime_info_value_h);
124 int runtime_info_vibration_enabled_set_event_cb(void);
125 void runtime_info_vibration_enabled_unset_event_cb(void);
126
127 int runtime_info_24hour_format_get_value(runtime_info_value_h);
128 int runtime_info_24hour_format_set_event_cb(void);
129 void runtime_info_24hour_format_unset_event_cb(void);
130
131 int runtime_info_first_day_of_week_get_value(runtime_info_value_h);
132 int runtime_info_first_day_of_week_set_event_cb(void);
133 void runtime_info_first_day_of_week_unset_event_cb(void);
134
135 int runtime_info_language_get_value(runtime_info_value_h);
136 int runtime_info_language_set_event_cb(void);
137 void runtime_info_language_unset_event_cb(void);
138
139 int runtime_info_region_get_value(runtime_info_value_h);
140 int runtime_info_region_set_event_cb(void);
141 void runtime_info_region_unset_event_cb(void);
142
143 int runtime_info_gps_status_get_value(runtime_info_value_h);
144 int runtime_info_gps_status_set_event_cb(void);
145 void runtime_info_gps_status_unset_event_cb(void);
146
147 int runtime_info_battery_charging_get_value(runtime_info_value_h);
148 int runtime_info_battery_charging_set_event_cb(void);
149 void runtime_info_battery_charging_unset_event_cb(void);
150
151 int runtime_info_tvout_connected_get_value(runtime_info_value_h value);
152 int runtime_info_tvout_connected_set_event_cb(void);
153 void runtime_info_tvout_connected_unset_event_cb(void);
154
155 int runtime_info_audio_jack_status_get_value(runtime_info_value_h value);
156 int runtime_info_audio_jack_status_set_event_cb(void);
157 void runtime_info_audio_jack_status_unset_event_cb(void);
158
159 int runtime_info_sliding_keyboard_opened_get_value(runtime_info_value_h value);
160 int runtime_info_sliding_keyboard_opened_set_event_cb(void);
161 void runtime_info_sliding_keyboard_opened_unset_event_cb(void);
162
163 int runtime_info_usb_connected_get_value(runtime_info_value_h value);
164 int runtime_info_usb_connected_set_event_cb(void);
165 void runtime_info_usb_connected_unset_event_cb(void);
166
167 int runtime_info_charger_connected_get_value(runtime_info_value_h value);
168 int runtime_info_charger_connected_set_event_cb(void);
169 void runtime_info_charger_connected_unset_event_cb(void);
170
171 int runtime_info_vibration_level_haptic_feedback_get_value(runtime_info_value_h value);
172 int runtime_info_vibration_level_haptic_feedback_set_event_cb(void);
173 void runtime_info_vibration_level_haptic_feedback_unset_event_cb(void);
174
175 int runtime_info_auto_rotation_enabled_get_value(runtime_info_value_h);
176 int runtime_info_auto_rotation_enabled_set_event_cb(void);
177 void runtime_info_auto_rotation_enabled_unset_event_cb(void);
178
179 int runtime_info_get_frequency_cpufreq(int core_idx, char *type, int *cpu_freq);
180 int runtime_info_get_frequency_cpuinfo(int core_idx, int *cpu_freq);
181
182 #ifdef __cplusplus
183 }
184 #endif
185
186 #endif /* __TIZEN_SYSTEM_RUNTIME_INFO_PRIVATE_H__ */