tizen 2.3 release
[framework/system/deviced.git] / src / display / setting.h
1 /*
2  * deviced
3  *
4  * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19
20 /*
21  * @file        setting.h
22  * @brief       Power manager setting module header
23  */
24 #ifndef __PM_SETTING_H__
25 #define __PM_SETTING_H__
26
27 #include <vconf.h>
28
29 /*
30  * @addtogroup POWER_MANAGER
31  * @{
32  */
33
34 enum {
35         SETTING_BEGIN = 0,
36         SETTING_TO_NORMAL = SETTING_BEGIN,
37         SETTING_BRT_LEVEL,
38         SETTING_LOCK_SCREEN,
39         SETTING_SMART_STAY,
40         SETTING_BOOT_POWER_ON_STATUS,
41         SETTING_POWER_CUSTOM_BRIGHTNESS,
42         SETTING_ACCESSIBILITY_TTS,
43         SETTING_GET_END,
44         SETTING_PM_STATE = SETTING_GET_END,
45         SETTING_LOW_BATT,
46         SETTING_CHARGING,
47         SETTING_POWEROFF,
48         SETTING_HALLIC_OPEN,
49         SETTING_LOCK_SCREEN_BG,
50         SETTING_END
51 };
52
53 extern int (*update_pm_setting) (int key_idx, int val);
54
55 extern int get_setting_brightness();
56
57 /*
58  * @brief setting initialization function
59  *
60  * get the variables if it exists. otherwise, set the default.
61  * and register some callback functions.
62  *
63  * @internal
64  * @param[in] func configuration change callback function
65  * @return 0 : success, -1 : error
66  */
67 extern int init_setting(int (*func) (int key_idx, int val));
68
69 extern int exit_setting();
70
71 /*
72  * get normal state timeout from SLP-setting SLP_SETTING_LCD_TIMEOUT_NORMAL
73  *
74  * @internal
75  * @param[out] timeout timeout variable pointer
76  * @return 0 : success, -1 : error
77  */
78 extern int get_run_timeout(int *timeout);
79
80 /*
81  * get LCD dim state timeout from environment variable.
82  *
83  * @internal
84  * @param[out] dim_timeout timeout variable pointer
85  * @return 0 : success, negative value : error
86  */
87 extern int get_dim_timeout(int *dim_timeout);
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