apply FSL(Flora Software License)
[framework/system/power-manager.git] / pm_setting.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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 /*
19  * @file        pm_setting.h
20  * @version     0.1
21  * @brief       Power manager setting module header
22  */
23 #ifndef __PM_SETTING_H__
24 #define __PM_SETTING_H__
25
26 #include <vconf.h>
27
28 /*
29  * @addtogroup POWER_MANAGER
30  * @{
31  */
32
33 enum {
34         SETTING_BEGIN = 0,
35         SETTING_TO_NORMAL = SETTING_BEGIN,
36         SETTING_LOW_BATT,
37         SETTING_CHARGING,
38         SETTING_BRT_LEVEL,
39         SETTING_LOCK_SCREEN,
40         SETTING_GET_END,
41         SETTING_PM_STATE = SETTING_GET_END,
42         SETTING_END
43 };
44
45 extern int get_setting_brightness();
46
47 /*
48  * @brief setting initialization function
49  *
50  * get the variables if it exists. otherwise, set the default.
51  * and register some callback functions.
52  *
53  * @internal
54  * @param[in] func configuration change callback function
55  * @return 0 : success, -1 : error
56  */
57 extern int init_setting(int (*func) (int key_idx, int val));
58
59 extern int exit_setting();
60
61 /*
62  * get normal state timeout from SLP-setting SLP_SETTING_LCD_TIMEOUT_NORMAL
63  *
64  * @internal
65  * @param[out] timeout timeout variable pointer
66  * @return 0 : success, -1 : error
67  */
68 extern int get_run_timeout(int *timeout);
69
70 /*
71  * get LCD dim state timeout from environment variable.
72  *
73  * @internal
74  * @param[out] timeout timeout variable pointer
75  * @return 0 : success, -1 : error
76  */
77 extern int get_dim_timeout(int *timeout);
78
79 /*
80  * get LCD off state timeout from environment variable.
81  *
82  * @internal
83  * @param[out] timeout timeout variable pointer
84  * @return 0 : success, -1 : error
85  */
86 extern int get_off_timeout(int *timeout);
87
88 /*
89  * get USB connection status from SLP-setting SLP_SETTING_USB_STATUS
90  *
91  * @internal
92  * @param[out] val usb connection status variable pointer, 0 is disconnected, others is connected.
93  * @return 0 : success, -1 : error
94  */
95 extern int get_usb_status(int *val);
96
97 /*
98  * set Current power manager state at SLP-setting "memory/pwrmgr/state"
99  *
100  * @internal
101  * @param[in] val current power manager state.
102  * @return 0 : success, -1 : error
103  */
104 extern int set_setting_pmstate(int val);
105
106 /*
107  * get charging status at SLP-setting "memory/Battery/Charger"
108  *
109  * @internal
110  * @param[in] val charging or not (1 or 0 respectively).
111  * @return 0 : success, -1 : error
112  */
113 extern int get_charging_status(int *val);
114
115 /*
116  * get current battery low status at SLP-setting "memory/Battery/Status/Low"
117  *
118  * @internal
119  * @param[in] val current low battery status
120  * @return 0 : success, -1 : error
121  */
122 extern int get_lowbatt_status(int *val);
123
124 /*
125  * @}
126  */
127
128 #endif