1e0dac50fSopenharmony_ci/* 2e0dac50fSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3e0dac50fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e0dac50fSopenharmony_ci * you may not use this file except in compliance with the License. 5e0dac50fSopenharmony_ci * You may obtain a copy of the License at 6e0dac50fSopenharmony_ci * 7e0dac50fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e0dac50fSopenharmony_ci * 9e0dac50fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e0dac50fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e0dac50fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e0dac50fSopenharmony_ci * See the License for the specific language governing permissions and 13e0dac50fSopenharmony_ci * limitations under the License. 14e0dac50fSopenharmony_ci */ 15e0dac50fSopenharmony_ci 16e0dac50fSopenharmony_ci#ifndef FRAMEWORKS_WM_TEST_UT_MOCK_WINDOW_ADAPTER_H 17e0dac50fSopenharmony_ci#define FRAMEWORKS_WM_TEST_UT_MOCK_WINDOW_ADAPTER_H 18e0dac50fSopenharmony_ci#include <gmock/gmock.h> 19e0dac50fSopenharmony_ci 20e0dac50fSopenharmony_ci#include "window_adapter.h" 21e0dac50fSopenharmony_ci 22e0dac50fSopenharmony_cinamespace OHOS { 23e0dac50fSopenharmony_cinamespace Rosen { 24e0dac50fSopenharmony_ciclass MockWindowAdapter : public WindowAdapter { 25e0dac50fSopenharmony_cipublic: 26e0dac50fSopenharmony_ci MOCK_METHOD5(CreateWindow, WMError(sptr<IWindow>& window, sptr<WindowProperty>& windowProperty, 27e0dac50fSopenharmony_ci std::shared_ptr<RSSurfaceNode> surfaceNode, uint32_t& windowId, const sptr<IRemoteObject>& token)); 28e0dac50fSopenharmony_ci MOCK_METHOD1(AddWindow, WMError(sptr<WindowProperty>& windowProperty)); 29e0dac50fSopenharmony_ci MOCK_METHOD2(RemoveWindow, WMError(uint32_t windowId, bool isFromInnerkits)); 30e0dac50fSopenharmony_ci MOCK_METHOD0(ClearWindowAdapter, void()); 31e0dac50fSopenharmony_ci MOCK_METHOD1(DestroyWindow, WMError(uint32_t windowId)); 32e0dac50fSopenharmony_ci MOCK_METHOD2(UpdateProperty, WMError(sptr<WindowProperty>& windowProperty, PropertyChangeAction action)); 33e0dac50fSopenharmony_ci MOCK_METHOD2(GetTopWindowId, WMError(uint32_t mainWinId, uint32_t& topWinId)); 34e0dac50fSopenharmony_ci MOCK_METHOD3(GetAvoidAreaByType, WMError(uint32_t windowId, AvoidAreaType type, AvoidArea& avoidArea)); 35e0dac50fSopenharmony_ci MOCK_METHOD2(BindDialogTarget, WMError(uint32_t& windowId, sptr<IRemoteObject> targetToken)); 36e0dac50fSopenharmony_ci MOCK_METHOD2(UpdateRsTree, WMError(uint32_t windowId, bool isAdd)); 37e0dac50fSopenharmony_ci MOCK_METHOD1(MinimizeAllAppWindows, WMError(DisplayId displayId)); 38e0dac50fSopenharmony_ci MOCK_METHOD0(ToggleShownStateForAllAppWindows, WMError()); 39e0dac50fSopenharmony_ci MOCK_METHOD2(ProcessPointDown, void(uint32_t windowId, bool isPointDown)); 40e0dac50fSopenharmony_ci MOCK_METHOD1(ProcessPointUp, void(uint32_t windowId)); 41e0dac50fSopenharmony_ci MOCK_METHOD1(RequestFocus, WMError(uint32_t windowId)); 42e0dac50fSopenharmony_ci MOCK_METHOD2(NotifyWindowTransition, WMError(sptr<WindowTransitionInfo> from, sptr<WindowTransitionInfo> to)); 43e0dac50fSopenharmony_ci MOCK_METHOD2(GetModeChangeHotZones, WMError(DisplayId displayId, ModeChangeHotZones& hotZones)); 44e0dac50fSopenharmony_ci MOCK_METHOD3(NotifyServerReadyToMoveOrDrag, void(uint32_t windowId, sptr<WindowProperty>& windowProperty, 45e0dac50fSopenharmony_ci sptr<MoveDragProperty>& moveDragProperty)); 46e0dac50fSopenharmony_ci MOCK_METHOD2(RegisterWindowManagerAgent, WMError(WindowManagerAgentType type, 47e0dac50fSopenharmony_ci const sptr<IWindowManagerAgent>& windowManagerAgent)); 48e0dac50fSopenharmony_ci MOCK_METHOD2(UnregisterWindowManagerAgent, WMError(WindowManagerAgentType type, 49e0dac50fSopenharmony_ci const sptr<IWindowManagerAgent>& windowManagerAgent)); 50e0dac50fSopenharmony_ci MOCK_METHOD1(GetVisibilityWindowInfo, WMError(std::vector<sptr<WindowVisibilityInfo>>& infos)); 51e0dac50fSopenharmony_ci MOCK_METHOD1(GetAccessibilityWindowInfo, WMError(std::vector<sptr<AccessibilityWindowInfo>>& infos)); 52e0dac50fSopenharmony_ci MOCK_METHOD2(GetUnreliableWindowInfo, WMError(int32_t windowId, std::vector<sptr<UnreliableWindowInfo>>& infos)); 53e0dac50fSopenharmony_ci MOCK_METHOD1(RaiseToAppTop, WMError(uint32_t windowId)); 54e0dac50fSopenharmony_ci MOCK_METHOD1(GetSystemConfig, WMError(SystemConfig& systemConfig)); 55e0dac50fSopenharmony_ci MOCK_METHOD2(DispatchKeyEvent, void(uint32_t windowId, std::shared_ptr<MMI::KeyEvent> event)); 56e0dac50fSopenharmony_ci MOCK_METHOD0(GetMaximizeMode, MaximizeMode()); 57e0dac50fSopenharmony_ci MOCK_METHOD1(GetWindowModeType, WMError(WindowModeType& windowModeType)); 58e0dac50fSopenharmony_ci MOCK_METHOD6(RecoverAndReconnectSceneSession, WMError(const sptr<ISessionStage>& sessionStage, 59e0dac50fSopenharmony_ci const sptr<IWindowEventChannel>& eventChannel, const std::shared_ptr<RSSurfaceNode>& surfaceNode, 60e0dac50fSopenharmony_ci sptr<ISession>& session, sptr<WindowSessionProperty> property, sptr<IRemoteObject> token)); 61e0dac50fSopenharmony_ci MOCK_METHOD6(RecoverAndConnectSpecificSession, void(const sptr<ISessionStage>& sessionStage, 62e0dac50fSopenharmony_ci const sptr<IWindowEventChannel>& eventChannel, const std::shared_ptr<RSSurfaceNode>& surfaceNode, 63e0dac50fSopenharmony_ci sptr<WindowSessionProperty> property, sptr<ISession>& session, sptr<IRemoteObject> token)); 64e0dac50fSopenharmony_ci}; 65e0dac50fSopenharmony_ci} 66e0dac50fSopenharmony_ci} // namespace OHOS 67e0dac50fSopenharmony_ci 68e0dac50fSopenharmony_ci#endif // FRAMEWORKS_WM_TEST_UT_MOCK_WINDOW_ADAPTER_H