1 /* 2 * Copyright (c) 2023 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_LITE_INTERFACE_H 17 #define OHOS_WINDOW_MANAGER_LITE_INTERFACE_H 18 19 #include <iremote_broker.h> 20 21 #include "interfaces/include/ws_common.h" 22 #include "window_property.h" 23 #include "window_transition_info.h" 24 #include "zidl/window_manager_agent_interface.h" 25 26 namespace OHOS { 27 namespace MMI { 28 class KeyEvent; 29 } 30 namespace Rosen { 31 32 class IWindowManagerLite : public IRemoteBroker { 33 public: 34 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IWindowManagerLite"); 35 // do not need enum 36 virtual WMError RegisterWindowManagerAgent(WindowManagerAgentType type, 37 const sptr<IWindowManagerAgent>& windowManagerAgent) = 0; 38 virtual WMError UnregisterWindowManagerAgent(WindowManagerAgentType type, 39 const sptr<IWindowManagerAgent>& windowManagerAgent) = 0; GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>>& infos)40 virtual WMError GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>>& infos) { return WMError::WM_OK; }; 41 virtual void GetFocusWindowInfo(FocusChangeInfo& focusInfo) = 0; 42 virtual WMError CheckWindowId(int32_t windowId, int32_t& pid) = 0; GetWindowModeType(WindowModeType& windowModeType)43 virtual WMError GetWindowModeType(WindowModeType& windowModeType) { return WMError::WM_OK; } 44 virtual WMError GetMainWindowInfos(int32_t topNum, std::vector<MainWindowInfo>& topNInfo) = 0; 45 virtual WMError GetAllMainWindowInfos(std::vector<MainWindowInfo>& infos) = 0; 46 virtual WMError ClearMainSessions(const std::vector<int32_t>& persistentIds, 47 std::vector<int32_t>& clearFailedIds) = 0; RaiseWindowToTop(int32_t persistentId)48 virtual WSError RaiseWindowToTop(int32_t persistentId) { return WSError::WS_OK; } 49 virtual WMError GetWindowStyleType(WindowStyleType& windowStyleType) = 0; 50 virtual WMError TerminateSessionByPersistentId(int32_t persistentId) = 0; 51 virtual WMError CloseTargetFloatWindow(const std::string& bundleName) = 0; 52 virtual WMError CloseTargetPiPWindow(const std::string& bundleName) = 0; 53 virtual WMError GetCurrentPiPWindowInfo(std::string& bundleName) = 0; 54 virtual WMError GetRootMainWindowId(int32_t persistentId, int32_t& hostWindowId) = 0; 55 virtual WMError GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>>& infos) = 0; 56 }; 57 } 58 } 59 #endif // OHOS_WINDOW_MANAGER_LITE_INTERFACE_H 60