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 FOUNDATION_DMSERVER_DISPLAY_MANAGER_PROXY_H 17 #define FOUNDATION_DMSERVER_DISPLAY_MANAGER_PROXY_H 18 19 #include "display_manager_interface.h" 20 21 #include "dm_common.h" 22 23 #include "screen.h" 24 25 #include <iremote_proxy.h> 26 27 namespace OHOS::Rosen { 28 class DisplayManagerProxy : public IRemoteProxy<IDisplayManager> { 29 public: DisplayManagerProxy(const sptr<IRemoteObject> & impl)30 explicit DisplayManagerProxy(const sptr<IRemoteObject> &impl) 31 : IRemoteProxy<IDisplayManager>(impl) {}; ~DisplayManagerProxy()32 ~DisplayManagerProxy() {}; 33 34 DisplayId GetDefaultDisplayId() override; 35 sptr<DisplayInfo> GetDisplayInfoById(DisplayId displayId) override; 36 sptr<DisplayInfo> GetDisplayInfoByScreen(ScreenId screenId) override; 37 38 ScreenId CreateVirtualScreen(VirtualScreenOption option) override; 39 DMError DestroyVirtualScreen(ScreenId screenId) override; 40 DMError SetVirtualScreenSurface(ScreenId screenId, sptr<Surface> surface) override; 41 bool SetOrientation(ScreenId screenId, Orientation orientation) override; 42 std::shared_ptr<Media::PixelMap> GetDisplaySnapshot(DisplayId displayId) override; 43 44 // colorspace, gamut 45 DMError GetScreenSupportedColorGamuts(ScreenId screenId, std::vector<ScreenColorGamut>& colorGamuts) override; 46 DMError GetScreenColorGamut(ScreenId screenId, ScreenColorGamut& colorGamut) override; 47 DMError SetScreenColorGamut(ScreenId screenId, int32_t colorGamutIdx) override; 48 DMError GetScreenGamutMap(ScreenId screenId, ScreenGamutMap& gamutMap) override; 49 DMError SetScreenGamutMap(ScreenId screenId, ScreenGamutMap gamutMap) override; 50 DMError SetScreenColorTransform(ScreenId screenId) override; 51 52 bool RegisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent, 53 DisplayManagerAgentType type) override; 54 bool UnregisterDisplayManagerAgent(const sptr<IDisplayManagerAgent>& displayManagerAgent, 55 DisplayManagerAgentType type) override; 56 bool WakeUpBegin(PowerStateChangeReason reason) override; 57 bool WakeUpEnd() override; 58 bool SuspendBegin(PowerStateChangeReason reason) override; 59 bool SuspendEnd() override; 60 bool SetScreenPowerForAll(ScreenPowerState state, PowerStateChangeReason reason) override; 61 ScreenPowerState GetScreenPower(ScreenId dmsScreenId) override; 62 bool SetDisplayState(DisplayState state) override; 63 std::vector<DisplayId> GetAllDisplayIds() override; 64 DisplayState GetDisplayState(DisplayId displayId) override; 65 void NotifyDisplayEvent(DisplayEvent event) override; 66 bool SetFreeze(std::vector<DisplayId> displayIds, bool isFreeze) override; 67 ScreenId MakeMirror(ScreenId mainScreenId, std::vector<ScreenId> mirrorScreenId) override; 68 sptr<ScreenInfo> GetScreenInfoById(ScreenId screenId) override; 69 sptr<ScreenGroupInfo> GetScreenGroupInfoById(ScreenId screenId) override; 70 std::vector<sptr<ScreenInfo>> GetAllScreenInfos() override; 71 ScreenId MakeExpand(std::vector<ScreenId> screenId, std::vector<Point> startPoint) override; 72 void RemoveVirtualScreenFromGroup(std::vector<ScreenId> screens) override; 73 bool SetScreenActiveMode(ScreenId screenId, uint32_t modeId) override; 74 75 private: 76 static inline BrokerDelegator<DisplayManagerProxy> delegator_; 77 }; 78 } // namespace OHOS::Rosen 79 80 #endif // FOUNDATION_DMSERVER_DISPLAY_MANAGER_PROXY_H