| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef POWER_MANAGER_BACKLIGHT_INTERFACE_H_ | 5 #ifndef POWER_MANAGER_BACKLIGHT_INTERFACE_H_ |
| 6 #define POWER_MANAGER_BACKLIGHT_INTERFACE_H_ | 6 #define POWER_MANAGER_BACKLIGHT_INTERFACE_H_ |
| 7 | 7 |
| 8 #include "power_manager/signal_callback.h" |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 | 11 |
| 10 namespace power_manager { | 12 namespace power_manager { |
| 11 | 13 |
| 12 // Interface for getting and setting the level of the backlight. | 14 // Interface for getting and setting the level of the backlight. |
| 13 class BacklightInterface { | 15 class BacklightInterface { |
| 14 public: | 16 public: |
| 15 // Set |level| to the current brightness level of the backlight, and set | 17 // Set |level| to the current brightness level of the backlight, and set |
| 16 // |max| to the max brightness level of the backlight. The minimum brightness | 18 // |max| to the max brightness level of the backlight. The minimum brightness |
| 17 // level of the backlight is zero. | 19 // level of the backlight is zero. |
| 18 // | 20 // |
| 19 // On success, return true; otherwise return false. | 21 // On success, return true; otherwise return false. |
| 20 virtual bool GetBrightness(int64* level, int64* max) = 0; | 22 virtual bool GetBrightness(int64* level, int64* max) = 0; |
| 21 | 23 |
| 22 // Set |level| to the intended brightness level of the backlight. The | 24 // Set |level| to the intended brightness level of the backlight. The |
| 23 // minimum brightness level of the backlight is zero. | 25 // minimum brightness level of the backlight is zero. |
| 24 // | 26 // |
| 25 // On success, return true; otherwise return false. | 27 // On success, return true; otherwise return false. |
| 26 virtual bool GetTargetBrightness(int64* level) = 0; | 28 virtual bool GetTargetBrightness(int64* level) = 0; |
| 27 | 29 |
| 28 // Set the backlight to the specified brightness |level|. | 30 // Set the backlight to the specified brightness |level|. |
| 29 // | 31 // |
| 30 // On success, return true; otherwise return false. | 32 // On success, return true; otherwise return false. |
| 31 virtual bool SetBrightness(int64 level) = 0; | 33 virtual bool SetBrightness(int64 level) = 0; |
| 32 | 34 |
| 35 // Specify a callback that will be used to determine if the screen should |
| 36 // be turned off during a backlight transition. |
| 37 virtual void SetScreenOffFunc(SIGNAL_CALLBACK_PTR(void, func), void *data) |
| 38 = 0; |
| 39 |
| 33 protected: | 40 protected: |
| 34 ~BacklightInterface() {} | 41 ~BacklightInterface() {} |
| 35 }; | 42 }; |
| 36 | 43 |
| 37 } // namespace power_manager | 44 } // namespace power_manager |
| 38 | 45 |
| 39 #endif // POWER_MANAGER_BACKLIGHT_INTERFACE_H_ | 46 #endif // POWER_MANAGER_BACKLIGHT_INTERFACE_H_ |
| OLD | NEW |