2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __TIZEN_SYSTEM_DISPLAY_H__
19 #define __TIZEN_SYSTEM_DISPLAY_H__
21 #include "device-error.h"
29 * @addtogroup CAPI_SYSTEM_DEVICE_DISPLAY_MODULE
34 * @brief Gets the number of display devices.
38 * @privilege %http://tizen.org/privilege/display
40 * @param[out] device_number The total number of displays
42 * @return @c 0 on success,
43 * otherwise a negative error value
45 * @retval #DEVICE_ERROR_NONE Successful
46 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
47 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
48 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
50 * @see device_display_get_brightness()
51 * @see device_display_set_brightness()
52 * @see device_display_get_max_brightness()
54 int device_display_get_numbers(int *device_number);
57 * @brief Gets the maximum brightness value that can be set.
61 * @privilege %http://tizen.org/privilege/display
63 * @param[in] display_index The index of the display \n
64 * It can be greater than or equal to @c 0 and less than
65 * the number of displays returned by device_display_get_numbers(). \n
66 * The index zero is always assigned to the main display.
67 * @param[out] max_brightness The maximum brightness value of the display
69 * @return @c 0 on success,
70 * otherwise a negative error value
72 * @retval #DEVICE_ERROR_NONE Successful
73 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
74 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
75 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
77 * @see device_display_get_numbers()
78 * @see device_display_set_brightness()
79 * @see device_display_get_brightness()
81 int device_display_get_max_brightness(int display_index, int *max_brightness);
84 * @brief Gets the display brightness value.
88 * @privilege %http://tizen.org/privilege/display
90 * @param[in] display_index The index of the display \n
91 * It can be greater than or equal to @c 0 and less than
92 * the number of displays returned by device_display_get_numbers(). \n
93 * The index zero is always assigned to the main display.
94 * @param[out] brightness The current brightness value of the display
96 * @return @c 0 on success,
97 * otherwise a negative error value
99 * @retval #DEVICE_ERROR_NONE Successful
100 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
101 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
102 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
104 * @see device_display_get_numbers()
105 * @see device_display_set_brightness()
106 * @see device_display_get_max_brightness()
108 int device_display_get_brightness(int display_index, int *brightness);
111 * @brief Sets the display brightness value.
115 * @privilege %http://tizen.org/privilege/display
117 * @param[in] display_index The index of the display \n
118 * It can be greater than or equal to @c 0 and less than
119 * the number of displays returned by device_display_get_numbers(). \n
120 * The index zero is always assigned to the main display.
121 * @param[in] brightness The new brightness value to set \n
122 * The maximum value can be represented by device_display_get_max_brightness().
124 * @return @c 0 on success,
125 * otherwise a negative error value
127 * @retval #DEVICE_ERROR_NONE Successful
128 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
129 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
130 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
132 * @see device_display_get_numbers()
133 * @see device_display_get_max_brightness()
134 * @see device_display_get_brightness()
136 int device_display_set_brightness(int display_index, int brightness);
139 * @brief Enumeration for the available display states.
140 * @details An application cannot put the device into the power off state or the suspend state.
145 DISPLAY_STATE_NORMAL, /**< Normal state */
146 DISPLAY_STATE_SCREEN_DIM, /**< Screen dim state */
147 DISPLAY_STATE_SCREEN_OFF, /**< Screen off state */
151 * @brief Gets the current display state.
155 * @privilege %http://tizen.org/privilege/display
157 * @param[out] state the display state
159 * @return @c 0 on success,
160 * otherwise a negative error value
162 * @retval #DEVICE_ERROR_NONE Successful
163 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
164 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
166 * @see device_add_callback
167 * @see device_remove_callback
168 * @see #DEVICE_CALLBACK_DISPLAY_STATE
170 int device_display_get_state(display_state_e *state);
173 * @brief Changes the display state by force.
177 * @privilege %http://tizen.org/privilege/display
179 * @param[in] state the display state
181 * @return @c 0 on success,
182 * otherwise a negative error value
184 * @retval #DEVICE_ERROR_NONE Successful
185 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
186 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
187 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
189 * @see device_power_request_lock()
190 * @see device_power_release_lock()
191 * @see device_add_callback
192 * @see device_remove_callback
193 * @see #DEVICE_CALLBACK_DISPLAY_STATE
198 * result = device_display_change_state(DISPLAY_STATE_SCREEN_OFF);
200 * printf("[ERROR] return value result =%d, \n",result);
202 * printf("[SUCCESS] return value result =%d \n",result);
206 int device_display_change_state(display_state_e state);
216 #endif // __TIZEN_SYSTEM_DISPLAY_H__