• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 OHOS_ROSEN_SCREEN_SESSION_MANAGER_PROXY_H
17 #define OHOS_ROSEN_SCREEN_SESSION_MANAGER_PROXY_H
18 
19 #include "screen_session_manager_interface.h"
20 
21 #include "iremote_proxy.h"
22 
23 namespace OHOS {
24 namespace Rosen {
25 
26 class ScreenSessionManagerProxy : public IRemoteProxy<IScreenSessionManager> {
27 public:
ScreenSessionManagerProxy(const sptr<IRemoteObject> & impl)28     explicit ScreenSessionManagerProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy(impl) {}
29 
30     ~ScreenSessionManagerProxy() = default;
31 
32     virtual sptr<DisplayInfo> GetDefaultDisplayInfo() override;
33     virtual DMError SetScreenActiveMode(ScreenId screenId, uint32_t modeId) override;
34     virtual DMError SetVirtualPixelRatio(ScreenId screenId, float virtualPixelRatio) override;
35 
36     virtual DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) override;
37     virtual DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) override;
38     virtual DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) override;
39     virtual DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) override;
40     virtual DMError SetScreenColorTransform(ScreenId screenId) override;
41 
42     virtual DMError RegisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent,
43         DisplayManagerAgentType type) override;
44 
45     virtual DMError UnregisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent,
46         DisplayManagerAgentType type) override;
47 
48     virtual void NotifyDisplayEvent(DisplayEvent event) override;
49     virtual bool WakeUpBegin(PowerStateChangeReason reason) override;
50     virtual bool WakeUpEnd() override;
51     virtual bool SuspendBegin(PowerStateChangeReason reason) override;
52     virtual bool SuspendEnd() override;
53     virtual bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason) override;
54     virtual ScreenPowerState GetScreenPower(ScreenId dmsScreenId) override;
55     virtual bool SetDisplayState(DisplayState state) override;
56     virtual DisplayState GetDisplayState(DisplayId displayId) override;
57     virtual ScreenId CreateVirtualScreen(VirtualScreenOption option,
58         const sptr<IRemoteObject>& displayManagerAgent) override;
59 
60     virtual DMError DestroyVirtualScreen(ScreenId screenId) override;
61 
62     virtual DMError SetVirtualScreenSurface(ScreenId screenId, sptr<IBufferProducer> surface) override;
63 
64     virtual DMError MakeMirror(ScreenId mainScreenId, std::vector<ScreenId> mirrorScreenIds,
65         ScreenId& screenGroupId) override;
66 
67     virtual sptr<ScreenGroupInfo> GetScreenGroupInfoById(ScreenId screenId) override;
68 
69     virtual void RemoveVirtualScreenFromGroup(std::vector<ScreenId> screens) override;
70 
71     virtual std::shared_ptr<Media::PixelMap> GetDisplaySnapshot(DisplayId displayId, DmErrorCode* errorCode) override;
72 
73     virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId) override;
74     virtual sptr<DisplayInfo> GetDisplayInfoByScreen(ScreenId screenId) override;
75     virtual std::vector<DisplayId> GetAllDisplayIds() override;
76 
77     virtual sptr<ScreenInfo> GetScreenInfoById(ScreenId screenId) override;
78 
79     virtual DMError GetAllScreenInfos(std::vector<sptr<ScreenInfo>>& screenInfos) override;
80 
81     virtual DMError GetScreenSupportedColorGamuts(ScreenId screenId,
82         std::vector<ScreenColorGamut>& colorGamuts) override;
83 
84     virtual DMError SetOrientation(ScreenId screenId, Orientation orientation) override;
85     virtual DMError SetScreenRotationLocked(bool isLocked) override;
86     virtual DMError IsScreenRotationLocked(bool& isLocked) override;
87     virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) override;
88 
89     virtual DMError HasPrivateWindow(DisplayId displayId, bool& hasPrivateWindow) override;
90 
91     virtual void DumpAllScreensInfo(std::string& dumpInfo) override;
92     virtual void DumpSpecialScreenInfo(ScreenId id, std::string& dumpInfo) override;
93     //Fold Screen
94     void SetFoldDisplayMode(const FoldDisplayMode displayMode) override;
95 
96     FoldDisplayMode GetFoldDisplayMode() override;
97 
98     bool IsFoldable() override;
99 
100     FoldStatus GetFoldStatus() override;
101 
102     sptr<FoldCreaseRegion> GetCurrentFoldCreaseRegion() override;
103 private:
104     static inline BrokerDelegator<ScreenSessionManagerProxy> delegator_;
105 };
106 
107 } // namespace Rosen
108 } // namespace OHOS
109 
110 #endif // OHOS_ROSEN_SCREEN_SESSION_MANAGER_PROXY_H