• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 DISPLAYMGR_IDISPLAY_MGR_H
17 #define DISPLAYMGR_IDISPLAY_MGR_H
18 
19 #include <iremote_broker.h>
20 #include <vector>
21 
22 #include "display_mgr_errors.h"
23 #include "display_power_info.h"
24 #include "idisplay_power_callback.h"
25 
26 namespace OHOS {
27 namespace DisplayPowerMgr {
28 class IDisplayPowerMgr : public IRemoteBroker {
29 public:
30     enum {
31         SET_DISPLAY_STATE = 0,
32         GET_DISPLAY_STATE,
33         GET_DISPLAY_IDS,
34         GET_MAIN_DISPLAY_ID,
35         SET_BRIGHTNESS,
36         DISCOUNT_BRIGHTNESS,
37         OVERRIDE_BRIGHTNESS,
38         RESTORE_BRIGHTNESS,
39         GET_BRIGHTNESS,
40         GET_DEFAULT_BRIGHTNESS,
41         GET_MAX_BRIGHTNESS,
42         GET_MIN_BRIGHTNESS,
43         ADJUST_BRIGHTNESS,
44         AUTO_ADJUST_BRIGHTNESS,
45         IS_AUTO_ADJUST_BRIGHTNESS,
46         REGISTER_CALLBACK,
47         BOOST_BRIGHTNESS,
48         CANCEL_BOOST_BRIGHTNESS,
49         GET_DEVICE_BRIGHTNESS
50     };
51 
52     virtual bool SetDisplayState(uint32_t id, DisplayState state, uint32_t reason) = 0;
53     virtual DisplayState GetDisplayState(uint32_t id) = 0;
54     virtual std::vector<uint32_t> GetDisplayIds() = 0;
55     virtual uint32_t GetMainDisplayId() = 0;
56     virtual bool SetBrightness(uint32_t value, uint32_t displayId) = 0;
57     virtual bool DiscountBrightness(double discount, uint32_t displayId) = 0;
58     virtual bool OverrideBrightness(uint32_t value, uint32_t displayId) = 0;
59     virtual bool RestoreBrightness(uint32_t displayId) = 0;
60     virtual uint32_t GetBrightness(uint32_t displayId) = 0;
61     virtual uint32_t GetDefaultBrightness() = 0;
62     virtual uint32_t GetMaxBrightness() = 0;
63     virtual uint32_t GetMinBrightness() = 0;
64     virtual bool AdjustBrightness(uint32_t id, int32_t value, uint32_t duration) = 0;
65     virtual bool AutoAdjustBrightness(bool enable) = 0;
66     virtual bool IsAutoAdjustBrightness() = 0;
67     virtual bool RegisterCallback(sptr<IDisplayPowerCallback> callback) = 0;
68     virtual bool BoostBrightness(int32_t timeoutMs, uint32_t displayId) = 0;
69     virtual bool CancelBoostBrightness(uint32_t displayId) = 0;
70     virtual uint32_t GetDeviceBrightness(uint32_t displayId) = 0;
71     virtual DisplayErrors GetError() = 0;
72 
73     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.displaypowermgr.IDisplayPowerMgr");
74 };
75 } // namespace DisplayPowerMgr
76 } // namespace OHOS
77 #endif // DISPLAYMGR_IDISPLAY_MGR_H
78