• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 OHOS_ROSEN_DISPLAY_MANAGER_LITE_PROXY_H
17 #define OHOS_ROSEN_DISPLAY_MANAGER_LITE_PROXY_H
18 
19 #include "display_manager_interface_code.h"
20 
21 #include <iremote_broker.h>
22 #include <iremote_proxy.h>
23 #include <cinttypes>
24 #include "dm_common.h"
25 #include "zidl/display_manager_agent_interface.h"
26 #include "display_info.h"
27 #include "fold_screen_info.h"
28 #include "screen_group_info.h"
29 
30 namespace OHOS {
31 namespace Rosen {
32 
33 class DisplayManagerLiteProxy : public IRemoteBroker {
34 public:
35 #ifdef SCENE_BOARD_ENABLED
36     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IScreenSessionManager");
37 #else
38     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IDisplayManager");
39 #endif
40 
DisplayManagerLiteProxy(const sptr<IRemoteObject> & impl)41     explicit DisplayManagerLiteProxy(const sptr<IRemoteObject>& impl) : remoteObject(impl) {}
42 
43     ~DisplayManagerLiteProxy() = default;
44 
AsObject()45     sptr<IRemoteObject> AsObject() { return remoteObject; };
46     virtual DMError RegisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent,
47         DisplayManagerAgentType type);
48     virtual DMError UnregisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent,
49         DisplayManagerAgentType type);
50 
51     virtual FoldDisplayMode GetFoldDisplayMode();
52     virtual void SetFoldDisplayMode(const FoldDisplayMode displayMode);
53     virtual bool IsFoldable();
54     FoldStatus GetFoldStatus();
55     virtual sptr<DisplayInfo> GetDefaultDisplayInfo();
56     virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId);
57     virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId);
58     virtual VirtualScreenFlag GetVirtualScreenFlag(ScreenId screenId);
59     /*
60      * used by powermgr
61      */
62     virtual bool WakeUpBegin(PowerStateChangeReason reason);
63     virtual bool WakeUpEnd();
64     virtual bool SuspendBegin(PowerStateChangeReason reason);
65     virtual bool SuspendEnd();
66     virtual ScreenId GetInternalScreenId();
67     virtual bool SetScreenPowerById(ScreenId screenId, ScreenPowerState state, PowerStateChangeReason reason);
68     virtual bool SetSpecifiedScreenPower(ScreenId, ScreenPowerState, PowerStateChangeReason);
69     virtual bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason);
70     virtual ScreenPowerState GetScreenPower(ScreenId dmsScreenId);
71     virtual ScreenPowerState GetScreenPower();
72     virtual bool SetDisplayState(DisplayState state);
73     virtual DisplayState GetDisplayState(DisplayId displayId);
74     virtual bool TryToCancelScreenOff();
75     virtual bool SetScreenBrightness(uint64_t screenId, uint32_t level);
76     virtual uint32_t GetScreenBrightness(uint64_t screenId);
77     virtual std::vector<DisplayId> GetAllDisplayIds();
78     virtual DMError GetAllScreenInfos(std::vector<sptr<ScreenInfo>>& screenInfos);
79     virtual DMError SetSystemKeyboardStatus(bool isOn = false);
80 private:
Remote()81     sptr<IRemoteObject> Remote() { return remoteObject; };
82     sptr<IRemoteObject> remoteObject = nullptr;
83 };
84 } // namespace Rosen
85 } // namespace OHOS
86 
87 #endif // OHOS_ROSEN_SCREEN_SESSION_MANAGER_LITE_PROXY_H