• 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_power_info.h"
23 #include "idisplay_power_callback.h"
24 
25 namespace OHOS {
26 namespace DisplayPowerMgr {
27 class IDisplayPowerMgr : public IRemoteBroker {
28 public:
29     enum {
30         SET_DISPLAY_STATE = 0,
31         GET_DISPLAY_STATE,
32         GET_DISPLAY_IDS,
33         GET_MAIN_DISPLAY_ID,
34         SET_BRIGHTNESS,
35         OVERRIDE_BRIGHTNESS,
36         RESTORE_BRIGHTNESS,
37         GET_BRIGHTNESS,
38         ADJUST_BRIGHTNESS,
39         AUTO_ADJUST_BRIGHTNESS,
40         IS_AUTO_ADJUST_BRIGHTNESS,
41         SET_STATE_CONFIG,
42         REGISTER_CALLBACK,
43     };
44 
45     virtual bool SetDisplayState(uint32_t id, DisplayState state, uint32_t reason) = 0;
46     virtual DisplayState GetDisplayState(uint32_t id) = 0;
47     virtual std::vector<uint32_t> GetDisplayIds() = 0;
48     virtual uint32_t GetMainDisplayId() = 0;
49     virtual bool SetBrightness(uint32_t value, uint32_t displayId) = 0;
50     virtual bool OverrideBrightness(uint32_t value, uint32_t displayId) = 0;
51     virtual bool RestoreBrightness(uint32_t displayId) = 0;
52     virtual uint32_t GetBrightness(uint32_t displayId) = 0;
53     virtual bool AdjustBrightness(uint32_t id, int32_t value, uint32_t duration) = 0;
54     virtual bool AutoAdjustBrightness(bool enable) = 0;
55     virtual bool IsAutoAdjustBrightness() = 0;
56     virtual bool SetStateConfig(uint32_t id, DisplayState state, int32_t value) = 0;
57     virtual bool RegisterCallback(sptr<IDisplayPowerCallback> callback) = 0;
58 
59     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.displaypowermgr.IDisplayPowerMgr");
60 };
61 } // namespace DisplayPowerMgr
62 } // namespace OHOS
63 #endif // DISPLAYMGR_IDISPLAY_MGR_H
64