1 /*
2  * Copyright (c) 2023-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef BRIGHTNESS_PARAM_HELPER_H
17 #define BRIGHTNESS_PARAM_HELPER_H
18 
19 #include <cstdint>
20 #include <functional>
21 #include <iosfwd>
22 #include <singleton.h>
23 #include <string>
24 
25 namespace OHOS {
26 namespace DisplayPowerMgr {
27 class BrightnessParamHelper {
28 public:
29     static uint32_t GetDefaultBrightness();
30     static uint32_t GetMaxBrightness();
31     static uint32_t GetMinBrightness();
32     static uint32_t GetSleepBrightness();
33     static uint32_t GetSleepMinumumReductionBrightness();
34     static uint32_t GetSleepDarkenTime();
35     typedef void (* BootCompletedCallback)();
36     static void RegisterBootCompletedCallback(BootCompletedCallback&);
37 
38 private:
39     static constexpr const char* KEY_DEFAULT_BRIGHTNESS {"const.display.brightness.default"};
40     static constexpr const char* KEY_MAX_BRIGHTNESS {"const.display.brightness.max"};
41     static constexpr const char* KEY_MIN_BRIGHTNESS {"const.display.brightness.min"};
42     static constexpr const char* KEY_SLEEP_BRIGHTNESS {"const.display.brightness.sleep"};
43     static constexpr const char* KEY_SLEEP_MINUMUM_REDUCTION_BRIGHTNESS {"const.display.brightness.sleepMinReduction"};
44     static constexpr const char* KEY_SLEEP_DARKEN_TIME {"const.display.brightness.sleepDarkenTime"};
45     static constexpr uint32_t BRIGHTNESS_MIN = 1;
46     static constexpr uint32_t BRIGHTNESS_DEFAULT = 102;
47     static constexpr uint32_t BRIGHTNESS_MAX = 255;
48     static constexpr uint32_t BRIGHTNESS_SLEEP = 10;
49     static constexpr uint32_t BRIGHTNESS_SLEEP_MINUMUM_REDUCTION = 10;
50     static constexpr uint32_t BRIGHTNESS_SLEEP_DARKEN_TIME = 1000;
51 };
52 } // namespace DisplayPowerMgr
53 } // namespace OHOS
54 
55 #endif // BRIGHTNESS_PARAM_HELPER_H
56