• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 #include "window_manager_stub.h"
17 #include "window_manager_agent.h"
18 #include <rs_iwindow_animation_controller.h>
19 #include "window_impl.h"
20 #include "window_agent.h"
21 
22 namespace OHOS {
23 namespace Rosen {
24 class WindowManagerStubImpl : public WindowManagerStub {
CreateWindow(sptr<IWindow> & window,sptr<WindowProperty> & property,const std::shared_ptr<RSSurfaceNode> & surfaceNode,uint32_t & windowId,sptr<IRemoteObject> token)25 WMError CreateWindow(sptr<IWindow>& window, sptr<WindowProperty>& property,
26     const std::shared_ptr<RSSurfaceNode>& surfaceNode,
27     uint32_t& windowId, sptr<IRemoteObject> token)
28 {
29     return WMError::WM_OK;
30 };
AddWindow(sptr<WindowProperty> & property)31 WMError AddWindow(sptr<WindowProperty>& property)
32 {
33     return WMError::WM_OK;
34 };
RemoveWindow(uint32_t windowId)35 WMError RemoveWindow(uint32_t windowId)
36 {
37     return WMError::WM_OK;
38 };
39 WMError DestroyWindow(uint32_t windowId, bool onlySelf = false)
40 {
41     return WMError::WM_OK;
42 };
RequestFocus(uint32_t windowId)43 WMError RequestFocus(uint32_t windowId)
44 {
45     return WMError::WM_OK;
46 };
GetAvoidAreaByType(uint32_t windowId,AvoidAreaType type)47 AvoidArea GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type)
48 {
49     AvoidArea area;
50     return area;
51 };
GetTopWindowId(uint32_t mainWinId,uint32_t & topWinId)52 WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId)
53 {
54     return WMError::WM_OK;
55 };
NotifyServerReadyToMoveOrDrag(uint32_t windowId,sptr<WindowProperty> & windowProperty,sptr<MoveDragProperty> & moveDragProperty)56 void NotifyServerReadyToMoveOrDrag(uint32_t windowId, sptr<WindowProperty>& windowProperty,
57     sptr<MoveDragProperty>& moveDragProperty){};
ProcessPointDown(uint32_t windowId,bool isPointDown)58 void ProcessPointDown(uint32_t windowId, bool isPointDown){};
ProcessPointUp(uint32_t windowId)59 void ProcessPointUp(uint32_t windowId){};
MinimizeAllAppWindows(DisplayId displayId)60 void MinimizeAllAppWindows(DisplayId displayId){};
ToggleShownStateForAllAppWindows()61 WMError ToggleShownStateForAllAppWindows()
62 {
63     return WMError::WM_OK;
64 };
SetWindowLayoutMode(WindowLayoutMode mode)65 WMError SetWindowLayoutMode(WindowLayoutMode mode)
66 {
67     return WMError::WM_OK;
68 };
69 WMError UpdateProperty(sptr<WindowProperty>& windowProperty, PropertyChangeAction action,
70     bool isAsyncTask = false)
71 {
72     return WMError::WM_OK;
73 };
RegisterWindowManagerAgent(WindowManagerAgentType type,const sptr<IWindowManagerAgent> & windowManagerAgent)74 bool RegisterWindowManagerAgent(WindowManagerAgentType type,
75     const sptr<IWindowManagerAgent>& windowManagerAgent)
76 {
77     return true;
78 };
UnregisterWindowManagerAgent(WindowManagerAgentType type,const sptr<IWindowManagerAgent> & windowManagerAgent)79 bool UnregisterWindowManagerAgent(WindowManagerAgentType type,
80     const sptr<IWindowManagerAgent>& windowManagerAgent)
81 {
82     return true;
83 };
GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>> & infos)84 WMError GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>>& infos)
85 {
86     return WMError::WM_OK;
87 };
GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>> & infos)88 WMError GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>>& infos)
89 {
90     return WMError::WM_OK;
91 };
SetWindowAnimationController(const sptr<RSIWindowAnimationController> & controller)92 WMError SetWindowAnimationController(const sptr<RSIWindowAnimationController>& controller)
93 {
94     return WMError::WM_OK;
95 };
GetSystemConfig(SystemConfig & systemConfig)96 WMError GetSystemConfig(SystemConfig& systemConfig)
97 {
98     return WMError::WM_OK;
99 };
100 WMError NotifyWindowTransition(sptr<WindowTransitionInfo>& from, sptr<WindowTransitionInfo>& to,
101     bool isFromClient = false)
102 {
103     return WMError::WM_OK;
104 };
GetModeChangeHotZones(DisplayId displayId,ModeChangeHotZones & hotZones)105 WMError GetModeChangeHotZones(DisplayId displayId, ModeChangeHotZones& hotZones)
106 {
107     return WMError::WM_OK;
108 };
MinimizeWindowsByLauncher(std::vector<uint32_t> windowIds,bool isAnimated,sptr<RSIWindowAnimationFinishedCallback> & finishCallback)109 void MinimizeWindowsByLauncher(std::vector<uint32_t> windowIds, bool isAnimated,
110     sptr<RSIWindowAnimationFinishedCallback>& finishCallback){};
UpdateAvoidAreaListener(uint32_t windowId,bool haveListener)111 WMError UpdateAvoidAreaListener(uint32_t windowId, bool haveListener)
112 {
113     return WMError::WM_OK;
114 };
UpdateRsTree(uint32_t windowId,bool isAdd)115 WMError UpdateRsTree(uint32_t windowId, bool isAdd)
116 {
117     return WMError::WM_OK;
118 };
BindDialogTarget(uint32_t & windowId,sptr<IRemoteObject> targetToken)119 WMError BindDialogTarget(uint32_t& windowId, sptr<IRemoteObject> targetToken)
120 {
121     return WMError::WM_OK;
122 };
SetAnchorAndScale(int32_t x,int32_t y,float scale)123 void SetAnchorAndScale(int32_t x, int32_t y, float scale){};
SetAnchorOffset(int32_t deltaX,int32_t deltaY)124 void SetAnchorOffset(int32_t deltaX, int32_t deltaY){};
OffWindowZoom()125 void OffWindowZoom(){};
GetSnapshot(int32_t windowId)126 std::shared_ptr<Media::PixelMap> GetSnapshot(int32_t windowId) override
127 {
128     return nullptr;
129 }
130 };
131 }
132 }