• 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_DISPLAY_MGR_PROXY_H
17 #define DISPLAYMGR_DISPLAY_MGR_PROXY_H
18 
19 #include <iremote_proxy.h>
20 
21 #include "idisplay_power_mgr.h"
22 
23 namespace OHOS {
24 namespace DisplayPowerMgr {
25 class DisplayPowerMgrProxy : public IRemoteProxy<IDisplayPowerMgr> {
26 public:
DisplayPowerMgrProxy(const sptr<IRemoteObject> & impl)27     explicit DisplayPowerMgrProxy(const sptr<IRemoteObject>& impl)
28         : IRemoteProxy<IDisplayPowerMgr>(impl) {}
29     ~DisplayPowerMgrProxy() override = default;
30 
31     virtual bool SetDisplayState(uint32_t id, DisplayState state, uint32_t reason) override;
32     virtual DisplayState GetDisplayState(uint32_t id) override;
33     virtual std::vector<uint32_t> GetDisplayIds() override;
34     virtual uint32_t GetMainDisplayId() override;
35 
36     virtual bool SetBrightness(uint32_t value, uint32_t displayId) override;
37     virtual bool OverrideBrightness(uint32_t value, uint32_t displayId) override;
38     virtual bool RestoreBrightness(uint32_t displayId) override;
39     virtual uint32_t GetBrightness(uint32_t displayId) override;
40     virtual bool AdjustBrightness(uint32_t id, int32_t value, uint32_t duration) override;
41     virtual bool AutoAdjustBrightness(bool enable) override;
42     virtual bool IsAutoAdjustBrightness() override;
43     virtual bool SetStateConfig(uint32_t id, DisplayState state, int32_t value) override;
44     virtual bool RegisterCallback(sptr<IDisplayPowerCallback> callback) override;
45 
46 private:
47     static inline BrokerDelegator<DisplayPowerMgrProxy> delegator_;
48 };
49 } // namespace DisplayPowerMgr
50 } // namespace OHOS
51 #endif // DISPLAYMGR_DISPLAY_MGR_PROXY_H
52