/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FRAMEWORKS_WM_TEST_UT_MOCK_WINDOW_ADAPTER_H #define FRAMEWORKS_WM_TEST_UT_MOCK_WINDOW_ADAPTER_H #include #include "window_adapter.h" namespace OHOS { namespace Rosen { class MockWindowAdapter : public WindowAdapter { public: MOCK_METHOD5(CreateWindow, WMError(sptr& window, sptr& windowProperty, std::shared_ptr surfaceNode, uint32_t& windowId, const sptr& token)); MOCK_METHOD1(AddWindow, WMError(sptr& windowProperty)); MOCK_METHOD2(RemoveWindow, WMError(uint32_t windowId, bool isFromInnerkits)); MOCK_METHOD0(ClearWindowAdapter, void()); MOCK_METHOD1(DestroyWindow, WMError(uint32_t windowId)); MOCK_METHOD2(UpdateProperty, WMError(sptr& windowProperty, PropertyChangeAction action)); MOCK_METHOD2(GetTopWindowId, WMError(uint32_t mainWinId, uint32_t& topWinId)); MOCK_METHOD3(GetAvoidAreaByType, WMError(uint32_t windowId, AvoidAreaType type, AvoidArea& avoidArea)); MOCK_METHOD2(BindDialogTarget, WMError(uint32_t& windowId, sptr targetToken)); MOCK_METHOD2(UpdateRsTree, WMError(uint32_t windowId, bool isAdd)); MOCK_METHOD1(MinimizeAllAppWindows, WMError(DisplayId displayId)); MOCK_METHOD0(ToggleShownStateForAllAppWindows, WMError()); MOCK_METHOD2(ProcessPointDown, void(uint32_t windowId, bool isPointDown)); MOCK_METHOD1(ProcessPointUp, void(uint32_t windowId)); MOCK_METHOD1(RequestFocus, WMError(uint32_t windowId)); MOCK_METHOD2(NotifyWindowTransition, WMError(sptr from, sptr to)); MOCK_METHOD2(GetModeChangeHotZones, WMError(DisplayId displayId, ModeChangeHotZones& hotZones)); MOCK_METHOD3(NotifyServerReadyToMoveOrDrag, void(uint32_t windowId, sptr& windowProperty, sptr& moveDragProperty)); MOCK_METHOD2(RegisterWindowManagerAgent, WMError(WindowManagerAgentType type, const sptr& windowManagerAgent)); MOCK_METHOD2(UnregisterWindowManagerAgent, WMError(WindowManagerAgentType type, const sptr& windowManagerAgent)); MOCK_METHOD1(GetVisibilityWindowInfo, WMError(std::vector>& infos)); MOCK_METHOD1(GetAccessibilityWindowInfo, WMError(std::vector>& infos)); MOCK_METHOD2(GetUnreliableWindowInfo, WMError(int32_t windowId, std::vector>& infos)); MOCK_METHOD1(RaiseToAppTop, WMError(uint32_t windowId)); MOCK_METHOD1(GetSystemConfig, WMError(SystemConfig& systemConfig)); MOCK_METHOD2(DispatchKeyEvent, void(uint32_t windowId, std::shared_ptr event)); MOCK_METHOD0(GetMaximizeMode, MaximizeMode()); MOCK_METHOD1(GetWindowModeType, WMError(WindowModeType& windowModeType)); }; } } // namespace OHOS #endif // FRAMEWORKS_WM_TEST_UT_MOCK_WINDOW_ADAPTER_H