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_INTERFACE_H 17 #define OHOS_ROSEN_SCREEN_SESSION_MANAGER_INTERFACE_H 18 19 #include <ui/rs_display_node.h> 20 21 #include "display_manager_interface.h" 22 #include "dm_common.h" 23 #include "session/screen/include/screen_property.h" 24 #include "zidl/screen_session_manager_client_interface.h" 25 26 namespace OHOS { 27 namespace Rosen { 28 template<typename T> 29 class RRectT; 30 31 class IScreenSessionManager : public IDisplayManager { 32 public: 33 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IScreenSessionManager"); 34 GetDefaultDisplayInfo()35 virtual sptr<DisplayInfo> GetDefaultDisplayInfo() override { return nullptr; } GetDisplayInfoById(DisplayId displayId)36 virtual sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId) override { return nullptr; } GetDisplayInfoByScreen(ScreenId screenId)37 virtual sptr<DisplayInfo> GetDisplayInfoByScreen(ScreenId screenId) override {return nullptr; } HasPrivateWindow(DisplayId displayId,bool & hasPrivateWindow)38 virtual DMError HasPrivateWindow(DisplayId displayId, bool& hasPrivateWindow) override { return DMError::DM_OK; } ConvertScreenIdToRsScreenId(ScreenId screenId,ScreenId & rsScreenId)39 virtual bool ConvertScreenIdToRsScreenId(ScreenId screenId, ScreenId& rsScreenId) override { return true; } 40 CreateVirtualScreen(VirtualScreenOption option,const sptr<IRemoteObject> & displayManagerAgent)41 virtual ScreenId CreateVirtualScreen(VirtualScreenOption option, 42 const sptr<IRemoteObject>& displayManagerAgent) override { return -1; } DestroyVirtualScreen(ScreenId screenId)43 virtual DMError DestroyVirtualScreen(ScreenId screenId) override { return DMError::DM_OK; } SetVirtualScreenSurface(ScreenId screenId,sptr<IBufferProducer> surface)44 virtual DMError SetVirtualScreenSurface(ScreenId screenId, sptr<IBufferProducer> surface) override 45 { 46 return DMError::DM_OK; 47 } SetVirtualMirrorScreenCanvasRotation(ScreenId screenId,bool autoRotate)48 virtual DMError SetVirtualMirrorScreenCanvasRotation(ScreenId screenId, bool autoRotate) override 49 { 50 return DMError::DM_OK; 51 } SetOrientation(ScreenId screenId,Orientation orientation)52 virtual DMError SetOrientation(ScreenId screenId, Orientation orientation) override { return DMError::DM_OK; } 53 virtual std::shared_ptr<Media::PixelMap> GetDisplaySnapshot(DisplayId displayId, 54 DmErrorCode* errorCode = nullptr) override { return nullptr; } SetScreenRotationLocked(bool isLocked)55 virtual DMError SetScreenRotationLocked(bool isLocked) override { return DMError::DM_OK; } IsScreenRotationLocked(bool & isLocked)56 virtual DMError IsScreenRotationLocked(bool& isLocked) override { return DMError::DM_OK; } 57 58 // colorspace, gamut GetScreenSupportedColorGamuts(ScreenId screenId,std::vector<ScreenColorGamut> & colorGamuts)59 virtual DMError GetScreenSupportedColorGamuts(ScreenId screenId, 60 std::vector<ScreenColorGamut>& colorGamuts) override 61 { 62 return DMError::DM_OK; 63 } GetScreenColorGamut(ScreenId screenId,ScreenColorGamut & colorGamut)64 virtual DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) override 65 { 66 return DMError::DM_OK; 67 } SetScreenColorGamut(ScreenId screenId,int32_t colorGamutIdx)68 virtual DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) override { return DMError::DM_OK; } GetScreenGamutMap(ScreenId screenId,ScreenGamutMap & gamutMap)69 virtual DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) override { return DMError::DM_OK; } SetScreenGamutMap(ScreenId screenId,ScreenGamutMap gamutMap)70 virtual DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) override { return DMError::DM_OK; } SetScreenColorTransform(ScreenId screenId)71 virtual DMError SetScreenColorTransform(ScreenId screenId) override { return DMError::DM_OK; } 72 RegisterDisplayManagerAgent(const sptr<IDisplayManagerAgent> & displayManagerAgent,DisplayManagerAgentType type)73 virtual DMError RegisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent, 74 DisplayManagerAgentType type) override { return DMError::DM_OK; } UnregisterDisplayManagerAgent(const sptr<IDisplayManagerAgent> & displayManagerAgent,DisplayManagerAgentType type)75 virtual DMError UnregisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent, 76 DisplayManagerAgentType type) override { return DMError::DM_OK; } WakeUpBegin(PowerStateChangeReason reason)77 virtual bool WakeUpBegin(PowerStateChangeReason reason) override { return false; } WakeUpEnd()78 virtual bool WakeUpEnd() override { return false; } SuspendBegin(PowerStateChangeReason reason)79 virtual bool SuspendBegin(PowerStateChangeReason reason) override { return false; } SuspendEnd()80 virtual bool SuspendEnd() override { return false; } SetSpecifiedScreenPower(ScreenId,ScreenPowerState,PowerStateChangeReason)81 virtual bool SetSpecifiedScreenPower(ScreenId, ScreenPowerState, PowerStateChangeReason) override { return false; } SetScreenPowerForAll(ScreenPowerState state,PowerStateChangeReason reason)82 virtual bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason) override { return false; } GetScreenPower(ScreenId dmsScreenId)83 virtual ScreenPowerState GetScreenPower(ScreenId dmsScreenId) override { return ScreenPowerState::INVALID_STATE; } SetDisplayState(DisplayState state)84 virtual bool SetDisplayState(DisplayState state) override { return false; } GetDisplayState(DisplayId displayId)85 virtual DisplayState GetDisplayState(DisplayId displayId) override {return DisplayState::UNKNOWN; } GetAllDisplayIds()86 virtual std::vector<DisplayId> GetAllDisplayIds() override { return std::vector<DisplayId>{}; } GetCutoutInfo(DisplayId displayId)87 virtual sptr<CutoutInfo> GetCutoutInfo(DisplayId displayId) override { return nullptr; } NotifyDisplayEvent(DisplayEvent event)88 virtual void NotifyDisplayEvent(DisplayEvent event) override {} SetFreeze(std::vector<DisplayId> displayIds,bool isFreeze)89 virtual bool SetFreeze(std::vector<DisplayId> displayIds, bool isFreeze) override { return false; } GetScreenInfoById(ScreenId screenId)90 virtual sptr<ScreenInfo> GetScreenInfoById(ScreenId screenId) override { return nullptr; } GetScreenGroupInfoById(ScreenId screenId)91 virtual sptr<ScreenGroupInfo> GetScreenGroupInfoById(ScreenId screenId) override { return nullptr; } GetAllScreenInfos(std::vector<sptr<ScreenInfo>> & screenInfos)92 virtual DMError GetAllScreenInfos(std::vector<sptr<ScreenInfo>>& screenInfos) override { return DMError::DM_OK; } MakeMirror(ScreenId mainScreenId,std::vector<ScreenId> mirrorScreenIds,ScreenId & screenGroupId)93 virtual DMError MakeMirror(ScreenId mainScreenId, std::vector<ScreenId> mirrorScreenIds, 94 ScreenId& screenGroupId) override { return DMError::DM_OK; } MakeExpand(std::vector<ScreenId> screenId,std::vector<Point> startPoints,ScreenId & screenGroupId)95 virtual DMError MakeExpand(std::vector<ScreenId> screenId, std::vector<Point> startPoints, 96 ScreenId& screenGroupId) override { return DMError::DM_OK; } StopMirror(const std::vector<ScreenId> & mirrorScreenIds)97 virtual DMError StopMirror(const std::vector<ScreenId>& mirrorScreenIds) override { return DMError::DM_OK; } StopExpand(const std::vector<ScreenId> & expandScreenIds)98 virtual DMError StopExpand(const std::vector<ScreenId>& expandScreenIds) override { return DMError::DM_OK; } RemoveVirtualScreenFromGroup(std::vector<ScreenId> screens)99 virtual void RemoveVirtualScreenFromGroup(std::vector<ScreenId> screens) override {} SetScreenActiveMode(ScreenId screenId,uint32_t modeId)100 virtual DMError SetScreenActiveMode(ScreenId screenId, uint32_t modeId) override { return DMError::DM_OK; } SetVirtualPixelRatio(ScreenId screenId,float virtualPixelRatio)101 virtual DMError SetVirtualPixelRatio(ScreenId screenId, float virtualPixelRatio) override { return DMError::DM_OK; } SetResolution(ScreenId screenId,uint32_t width,uint32_t height,float virtualPixelRatio)102 virtual DMError SetResolution(ScreenId screenId, uint32_t width, uint32_t height, 103 float virtualPixelRatio) override { return DMError::DM_OK; } GetDensityInCurResolution(ScreenId screenId,float & virtualPixelRatio)104 virtual DMError GetDensityInCurResolution(ScreenId screenId, 105 float& virtualPixelRatio) override { return DMError::DM_OK; } ResizeVirtualScreen(ScreenId screenId,uint32_t width,uint32_t height)106 virtual DMError ResizeVirtualScreen(ScreenId screenId, uint32_t width, 107 uint32_t height) override { return DMError::DM_OK; } 108 virtual DMError AddSurfaceNodeToDisplay(DisplayId displayId, 109 std::shared_ptr<class RSSurfaceNode>& surfaceNode, bool onTop = true) override { return DMError::DM_OK; } RemoveSurfaceNodeFromDisplay(DisplayId displayId,std::shared_ptr<class RSSurfaceNode> & surfaceNode)110 virtual DMError RemoveSurfaceNodeFromDisplay(DisplayId displayId, 111 std::shared_ptr<class RSSurfaceNode>& surfaceNode) override { return DMError::DM_OK; } DumpAllScreensInfo(std::string & dumpInfo)112 virtual void DumpAllScreensInfo(std::string& dumpInfo) {} DumpSpecialScreenInfo(ScreenId id,std::string & dumpInfo)113 virtual void DumpSpecialScreenInfo(ScreenId id, std::string& dumpInfo) {} 114 // Fold Screen SetFoldDisplayMode(const FoldDisplayMode displayMode)115 void SetFoldDisplayMode(const FoldDisplayMode displayMode) override {} 116 SetFoldStatusLocked(bool locked)117 void SetFoldStatusLocked(bool locked) override {} 118 GetFoldDisplayMode()119 FoldDisplayMode GetFoldDisplayMode() override { return FoldDisplayMode::UNKNOWN; } 120 IsFoldable()121 bool IsFoldable() override { return false; }; 122 GetFoldStatus()123 FoldStatus GetFoldStatus() override { return FoldStatus::UNKNOWN; }; 124 GetCurrentFoldCreaseRegion()125 sptr<FoldCreaseRegion> GetCurrentFoldCreaseRegion() override { return nullptr; }; 126 MakeUniqueScreen(const std::vector<ScreenId> & screenIds)127 virtual DMError MakeUniqueScreen(const std::vector<ScreenId>& screenIds) override { return DMError::DM_OK; }; 128 SetClient(const sptr<IScreenSessionManagerClient> & client,int32_t userId)129 virtual void SetClient(const sptr<IScreenSessionManagerClient>& client, int32_t userId) {} GetScreenProperty(ScreenId screenId)130 virtual ScreenProperty GetScreenProperty(ScreenId screenId) { return ScreenProperty(); } GetDisplayNode(ScreenId screenId)131 virtual std::shared_ptr<RSDisplayNode> GetDisplayNode(ScreenId screenId) { return nullptr; } UpdateScreenRotationProperty(ScreenId screenId,const RRectT<float> & bounds,float rotation)132 virtual void UpdateScreenRotationProperty(ScreenId screenId, const RRectT<float>& bounds, float rotation) {} UpdateAvailableArea(ScreenId screenId,DMRect area)133 virtual void UpdateAvailableArea(ScreenId screenId, DMRect area) {} GetCurvedCompressionArea()134 virtual uint32_t GetCurvedCompressionArea() { return 0; } GetPhyScreenProperty(ScreenId screenId)135 virtual ScreenProperty GetPhyScreenProperty(ScreenId screenId) { return ScreenProperty(); } NotifyDisplayChangeInfoChanged(const sptr<DisplayChangeInfo> & info)136 virtual void NotifyDisplayChangeInfoChanged(const sptr<DisplayChangeInfo>& info) {} SetScreenPrivacyState(bool hasPrivate)137 virtual void SetScreenPrivacyState(bool hasPrivate) {} NotifyFoldToExpandCompletion(bool foldToExpand)138 virtual void NotifyFoldToExpandCompletion(bool foldToExpand) {} 139 }; 140 } // namespace Rosen 141 } // namespace OHOS 142 143 #endif // OHOS_ROSEN_SCREEN_SESSION_MANAGER_INTERFACE_H 144