2 * Copyright (c) 2011 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.
20 #ifndef __TIZEN_SYSTEM_DEVICE_H__
21 #define __TIZEN_SYSTEM_DEVICE_H__
24 #include "device-error.h"
32 * @addtogroup CAPI_SYSTEM_DEVICE_MODULE
37 * @brief Gets the number of display devices.
39 * @return The number of display devices that the device provides.
40 * @retval #DEVICE_ERROR_NONE Successful
41 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
43 * @see device_get_brightness()
44 * @see device_set_brightness()
45 * @see device_get_max_brightness()
46 * @see device_set_brightness_from_settings()
47 * @see device_set_brightness_to_settings()
49 int device_get_display_numbers(int* device_number);
52 * @brief Gets the display brightness value.
54 * @param[in] display_index The index of the display, it be greater than or equal to 0 and less than \n
55 * the number of displays returned by device_get_display_numbers().\n
56 * The index zero is always assigned to the main display.
57 * @param[out] brightness The current brightness value of the display
59 * @return 0 on success, otherwise a negative error value.
60 * @retval #DEVICE_ERROR_NONE Successful
61 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
62 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
64 * @see device_get_display_numbers()
65 * @see device_set_brightness()
66 * @see device_get_max_brightness()
67 * @see device_set_brightness_from_settings()
68 * @see device_set_brightness_to_settings()
70 int device_get_brightness(int display_index, int *brightness);
73 * @brief Sets the display brightness value.
75 * @param[in] display_index The index of the display, it be greater than or equal to 0 and less than \n
76 * the number of displays returned by device_get_display_numbers().\n
77 * The index zero is always assigned to the main display.
78 * @param[in] brightness The new brightness value to set \n
79 * The maximum value can be represented by device_get_max_brightness()
81 * @return 0 on success, otherwise a negative error value.
82 * @retval #DEVICE_ERROR_NONE Successful
83 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
84 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
86 * @see device_get_display_numbers()
87 * @see device_get_max_brightness()
88 * @see device_get_brightness()
89 * @see device_set_brightness_from_settings()
90 * @see device_set_brightness_to_settings()
92 int device_set_brightness(int display_index, int brightness);
95 * @brief Gets the maximum brightness value that can be set.
97 * @param[in] display_index The index of the display, it be greater than or equal to 0 and less than \n
98 * the number of displays returned by device_get_display_numbers().\n
99 * The index zero is always assigned to the main display.
100 * @param[out] max_brightness The maximum brightness value of the display
102 * @return 0 on success, otherwise a negative error value.
103 * @retval #DEVICE_ERROR_NONE Successful
104 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
105 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
107 * @see device_get_display_numbers()
108 * @see device_set_brightness()
109 * @see device_get_brightness()
110 * @see device_set_brightness_from_settings()
111 * @see device_set_brightness_to_settings()
113 int device_get_max_brightness(int display_index, int *max_brightness);
116 * @brief Sets the display brightness value from registered in settings.
119 * This function set display brightness to condition in the settings.
120 * if auto brightness option is enabled in setting, display's brightness will be changed automatically.
122 * @param[in] display_index The index of the display, it be greater than or equal to 0 and less than \n
123 * the number of displays returned by device_get_display_numbers().\n
124 * The index zero is always assigned to the main display.
126 * @return 0 on success, otherwise a negative error value.
127 * @retval #DEVICE_ERROR_NONE Successful
128 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
129 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
131 * @see device_get_display_numbers()
132 * @see device_get_max_brightness()
133 * @see device_set_brightness()
134 * @see device_get_brightness()
135 * @see device_set_brightness_to_settings()
137 int device_set_brightness_from_settings(int display_index);
140 * @brief Sets the display brightness value to specific display and set to variable in settings.
143 * This function set given brightness value to given index of display.
144 * And also brightness variable in settings will be changed to given brightness value too.
146 * @param[in] display_index The index of the display, it be greater than or equal to 0 and less than \n
147 * the number of displays returned by device_get_display_numbers().\n
148 * The index zero is always assigned to the main display.
149 * @param[in] brightness The new brightness value to set \n
150 * The maximum value can be represented by device_get_max_brightness()
152 * @return 0 on success, otherwise a negative error value.
153 * @retval #DEVICE_ERROR_NONE Successful
154 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
155 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
157 * @see device_get_display_numbers()
158 * @see device_get_max_brightness()
159 * @see device_set_brightness()
160 * @see device_get_brightness()
161 * @see device_set_brightness_from_settings()
163 int device_set_brightness_to_settings(int display_index, int brightness);
166 * @brief Get brightness value of LED that placed to camera flash.
168 * @remarks This API is related to the following feature: %http://tizen.org/feature/camera.back.flash
170 * @param[out] brightness brightness value of LED (0 ~ MAX)
172 * @return 0 on success, otherwise a negative error value.
173 * @retval #DEVICE_ERROR_NONE Successful
174 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
175 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
176 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
178 int device_flash_get_brightness(int *brightness);
181 * @brief Set brightness value of LED that placed to camera flash.
183 * @remarks This API is related to the following feature: %http://tizen.org/feature/camera.back.flash
185 * @param[in] brightness brightness value of LED (0 ~ MAX)
187 * @return 0 on success, otherwise a negative error value.
188 * @retval #DEVICE_ERROR_NONE Successful
189 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
190 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
191 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
193 int device_flash_set_brightness(int brightness);
196 * @brief Get max brightness value of LED that placed to camera flash.
199 * Brightness control does not support yet. so this function always return 1. \n
200 * Set function can only use to switch on/off the flash. \n
201 * Get function can only use to retrieve on/off state of flash.
202 * This API is related to the following feature: %http://tizen.org/feature/camera.back.flash
204 * @param[out] max_brightness max brightness value of LED
206 * @return 0 on success, otherwise a negative error value.
207 * @retval #DEVICE_ERROR_NONE Successful
208 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
209 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
210 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
212 int device_flash_get_max_brightness(int *max_brightness);
215 * @brief Get total amount of physical RAM, in kilobytes
219 * @param[out] total_mem total amount of physical RAM
221 * @return 0 on success, otherwise a negative error value.
222 * @retval #DEVICE_ERROR_NONE Successful
223 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
224 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
226 int device_memory_get_total(unsigned int *total_mem);
229 * @brief Get available amount of physical RAM, in kilobytes
232 * Available amount is defined by following formula currently.
233 * available mem = MemFree+Buffers+Cached+SwapCached-Shmem
235 * @param[out] avail_mem available amount of physical RAM
237 * @return 0 on success, otherwise a negative error value.
238 * @retval #DEVICE_ERROR_NONE Successful
239 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
240 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
242 int device_memory_get_available(unsigned int *avail_mem);
252 #endif // __TIZEN_SYSTEM_DEVICE_H__