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 OHOS_WINDOW_MANAGER_PROXY_H 17 #define OHOS_WINDOW_MANAGER_PROXY_H 18 19 #include <iremote_proxy.h> 20 #include "window_manager_interface.h" 21 22 namespace OHOS { 23 namespace Rosen { 24 class WindowManagerProxy : public IRemoteProxy<IWindowManager> { 25 public: WindowManagerProxy(const sptr<IRemoteObject> & impl)26 explicit WindowManagerProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<IWindowManager>(impl) {}; 27 ~WindowManagerProxy()28 ~WindowManagerProxy() {}; 29 30 WMError CreateWindow(sptr<IWindow>& window, sptr<WindowProperty>& property, 31 const std::shared_ptr<RSSurfaceNode>& surfaceNode, 32 uint32_t& windowId, sptr<IRemoteObject> token) override; 33 WMError AddWindow(sptr<WindowProperty>& property) override; 34 WMError RemoveWindow(uint32_t windowId) override; 35 WMError NotifyWindowTransition(sptr<WindowTransitionInfo>& from, sptr<WindowTransitionInfo>& to, 36 bool isFromClient = false) override; 37 WMError DestroyWindow(uint32_t windowId, bool onlySelf = false) override; 38 WMError RequestFocus(uint32_t windowId) override; 39 AvoidArea GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type) override; 40 WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId) override; 41 void NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty, 42 sptr<MoveDragProperty>& moveDragProperty) override; 43 void ProcessPointDown(uint32_t windowId, bool isPointDown) override; 44 void ProcessPointUp(uint32_t windowId) override; 45 void MinimizeAllAppWindows(DisplayId displayId) override; 46 WMError ToggleShownStateForAllAppWindows() override; 47 WMError SetWindowLayoutMode(WindowLayoutMode mode) override; 48 WMError UpdateProperty(sptr<WindowProperty>& windowProperty, PropertyChangeAction action, 49 bool isAsyncTask = false) override; 50 bool RegisterWindowManagerAgent(WindowManagerAgentType type, 51 const sptr<IWindowManagerAgent>& windowManagerAgent) override; 52 bool UnregisterWindowManagerAgent(WindowManagerAgentType type, 53 const sptr<IWindowManagerAgent>& windowManagerAgent) override; 54 WMError SetWindowAnimationController(const sptr<RSIWindowAnimationController>& controller) override; 55 56 WMError GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>>& infos) override; 57 WMError GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>>& infos) override; 58 WMError GetSystemConfig(SystemConfig& systemConfig) override; 59 WMError GetModeChangeHotZones(DisplayId displayId, ModeChangeHotZones& hotZones) override; 60 void MinimizeWindowsByLauncher(std::vector<uint32_t> windowIds, bool isAnimated, 61 sptr<RSIWindowAnimationFinishedCallback>& finishCallback) override; 62 WMError UpdateAvoidAreaListener(uint32_t windowId, bool haveListener) override; 63 WMError UpdateRsTree(uint32_t windowId, bool isAdd) override; 64 WMError BindDialogTarget(uint32_t& windowId, sptr<IRemoteObject> targetToken) override; 65 void SetAnchorAndScale(int32_t x, int32_t y, float scale) override; 66 void SetAnchorOffset(int32_t deltaX, int32_t deltaY) override; 67 void OffWindowZoom() override; 68 std::shared_ptr<Media::PixelMap> GetSnapshot(int32_t windowId) override; 69 void NotifyDumpInfoResult(const std::vector<std::string>& info) override; 70 private: 71 static inline BrokerDelegator<WindowManagerProxy> delegator_; 72 }; 73 } 74 } 75 #endif // OHOS_WINDOW_MANAGER_PROXY_H 76