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_ROSEN_WINDOW_SCENE_SCENE_SESSION_MANAGER_LITE_H 17 #define OHOS_ROSEN_WINDOW_SCENE_SCENE_SESSION_MANAGER_LITE_H 18 19 #include "session_manager/include/zidl/scene_session_manager_lite_stub.h" 20 #include "wm_single_instance.h" 21 22 namespace OHOS::Rosen { 23 24 class SceneSessionManagerLite : public SceneSessionManagerLiteStub { 25 WM_DECLARE_SINGLE_INSTANCE(SceneSessionManagerLite) 26 public: 27 WSError SetSessionLabel(const sptr<IRemoteObject>& token, const std::string& label) override; 28 WSError SetSessionIcon(const sptr<IRemoteObject>& token, const std::shared_ptr<Media::PixelMap>& icon) override; 29 WSError IsValidSessionIds(const std::vector<int32_t>& sessionIds, std::vector<bool>& results) override; 30 WSError PendingSessionToForeground(const sptr<IRemoteObject>& token) override; 31 WSError PendingSessionToBackground(const sptr<IRemoteObject>& token, const BackgroundParams& params) override; 32 WSError PendingSessionToBackgroundForDelegator(const sptr<IRemoteObject>& token, 33 bool shouldBackToCaller = true) override; 34 WSError GetFocusSessionToken(sptr<IRemoteObject>& token, DisplayId displayId = DEFAULT_DISPLAY_ID) override; 35 WSError GetFocusSessionElement(AppExecFwk::ElementName& element, DisplayId displayId = DEFAULT_DISPLAY_ID) override; 36 WSError IsFocusWindowParent(const sptr<IRemoteObject>& token, bool& isParent) override; 37 WSError RegisterSessionListener(const sptr<ISessionListener>& listener, bool isRecover = false) override; 38 WSError UnRegisterSessionListener(const sptr<ISessionListener>& listener) override; 39 WSError GetSessionInfos(const std::string& deviceId, int32_t numMax, 40 std::vector<SessionInfoBean>& sessionInfos) override; 41 WSError GetMainWindowStatesByPid(int32_t pid, std::vector<MainWindowState>& windowStates) override; 42 WSError GetSessionInfo(const std::string& deviceId, int32_t persistentId, SessionInfoBean& sessionInfo) override; 43 WSError GetSessionInfoByContinueSessionId(const std::string& continueSessionId, 44 SessionInfoBean& sessionInfo) override; 45 WSError TerminateSessionNew( 46 const sptr<AAFwk::SessionInfo> info, bool needStartCaller, bool isFromBroker = false) override; 47 WSError GetSessionSnapshot(const std::string& deviceId, int32_t persistentId, 48 SessionSnapshot& snapshot, bool isLowResolution) override; 49 WSError SetSessionContinueState(const sptr<IRemoteObject>& token, const ContinueState& continueState) override; 50 WSError ClearSession(int32_t persistentId) override; 51 WSError ClearAllSessions() override; 52 WSError LockSession(int32_t sessionId) override; 53 WSError UnlockSession(int32_t sessionId) override; 54 WSError MoveSessionsToForeground(const std::vector<int32_t>& sessionIds, int32_t topSessionId) override; 55 WSError MoveSessionsToBackground(const std::vector<int32_t>& sessionIds, std::vector<int32_t>& result) override; 56 57 void GetFocusWindowInfo(FocusChangeInfo& focusInfo, DisplayId displayId = DEFAULT_DISPLAY_ID) override; 58 WMError RegisterWindowManagerAgent(WindowManagerAgentType type, 59 const sptr<IWindowManagerAgent>& windowManagerAgent) override; 60 WMError UnregisterWindowManagerAgent(WindowManagerAgentType type, 61 const sptr<IWindowManagerAgent>& windowManagerAgent) override; 62 WMError CheckWindowId(int32_t windowId, int32_t& pid) override; 63 WMError UpdateWindowModeByIdForUITest(int32_t windowId, int32_t updateMode) override; 64 WMError CheckUIExtensionCreation(int32_t windowId, uint32_t tokenId, const AppExecFwk::ElementName& element, 65 AppExecFwk::ExtensionAbilityType extensionAbilityType, int32_t& pid) override; 66 WMError GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>>& infos) override; 67 WSError UpdateWindowMode(int32_t persistentId, int32_t windowMode); 68 WMError GetWindowModeType(WindowModeType& windowModeType) override; 69 WMError GetMainWindowInfos(int32_t topNum, std::vector<MainWindowInfo>& topNInfo) override; 70 WMError GetAllMainWindowInfos(std::vector<MainWindowInfo>& infos) override; 71 WMError ClearMainSessions(const std::vector<int32_t>& persistentIds, std::vector<int32_t>& clearFailedIds) override; 72 WSError RaiseWindowToTop(int32_t persistentId) override; 73 WSError RegisterIAbilityManagerCollaborator(int32_t type, 74 const sptr<AAFwk::IAbilityManagerCollaborator>& impl) override; 75 WSError UnregisterIAbilityManagerCollaborator(int32_t type) override; 76 WMError GetWindowStyleType(WindowStyleType& windowStyletype) override; 77 WMError TerminateSessionByPersistentId(int32_t persistentId) override; 78 WMError CloseTargetFloatWindow(const std::string& bundleName) override; 79 WMError CloseTargetPiPWindow(const std::string& bundleName) override; 80 WMError GetCurrentPiPWindowInfo(std::string& bundleName) override; 81 WMError GetRootMainWindowId(int32_t persistentId, int32_t& hostWindowId) override; 82 WMError GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>>& infos) override; 83 WSError NotifyAppUseControlList(ControlAppType type, int32_t userId, 84 const std::vector<AppUseControlInfo>& controlList) override; 85 WMError MinimizeMainSession(const std::string& bundleName, int32_t appIndex, int32_t userId) override; 86 WMError LockSessionByAbilityInfo(const AbilityInfoBase& abilityInfo, bool isLock) override; 87 WMError HasFloatingWindowForeground(const sptr<IRemoteObject>& abilityToken, 88 bool& hasOrNot) override; 89 WMError GetCallingWindowInfo(CallingWindowInfo& callingWindowInfo) override; 90 WMError RegisterSessionLifecycleListenerByIds(const sptr<ISessionLifecycleListener>& listener, 91 const std::vector<int32_t>& persistentIdList) override; 92 WMError RegisterSessionLifecycleListenerByBundles(const sptr<ISessionLifecycleListener>& listener, 93 const std::vector<std::string>& bundleNameList) override; 94 WMError UnregisterSessionLifecycleListener(const sptr<ISessionLifecycleListener>& listener) override; 95 WMError ListWindowInfo(const WindowInfoOption& windowInfoOption, std::vector<sptr<WindowInfo>>& infos) override; 96 WMError TransferSessionToTargetScreen(const TransferSessionInfo& info) override; 97 WSError GetRecentMainSessionInfoList(std::vector<RecentSessionInfo>& recentSessionInfoList) override; 98 WMError GetRouterStackInfo(int32_t persistentId, const sptr<ISessionRouterStackListener>& listener) override; 99 WSError PendingSessionToBackgroundByPersistentId(const int32_t persistentId, 100 bool shouldBackToCaller = true) override; 101 WMError CreateNewInstanceKey(const std::string& bundleName, std::string& instanceKey) override; 102 WMError RemoveInstanceKey(const std::string& bundleName, const std::string& instanceKey) override; 103 WMError UpdateKioskAppList(const std::vector<std::string>& kioskAppList) override; 104 WMError EnterKioskMode(const sptr<IRemoteObject>& token) override; 105 WMError ExitKioskMode(const sptr<IRemoteObject>& token) override; 106 WSError SendPointerEventForHover(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) override; 107 }; 108 } // namespace OHOS::Rosen 109 110 #endif // OHOS_ROSEN_WINDOW_SCENE_SCENE_SESSION_MANAGER_LITE_H 111