1 /* 2 * Copyright (c) 2022-2025 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_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_H 17 #define OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_H 18 19 #ifdef SUPPORT_SCREEN 20 #include "iremote_broker.h" 21 #include "window_info.h" 22 23 namespace OHOS { 24 namespace Media { 25 class PixelMap; 26 } 27 namespace AAFwk { 28 /** 29 * @class IWindowManagerServiceHandler 30 * Window Manager Service Handler, use to call methods of WMS 31 */ 32 class IWindowManagerServiceHandler : public OHOS::IRemoteBroker { 33 public: 34 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.WindowManagerServiceHandler"); 35 36 virtual void NotifyWindowTransition(sptr<AbilityTransitionInfo> fromInfo, sptr<AbilityTransitionInfo> toInfo, 37 bool& animaEnabled) = 0; 38 39 virtual int32_t GetFocusWindow(sptr<IRemoteObject>& abilityToken) = 0; 40 41 virtual void StartingWindow(sptr<AbilityTransitionInfo> info, 42 std::shared_ptr<Media::PixelMap> pixelMap, uint32_t bgColor) = 0; 43 44 virtual void StartingWindow(sptr<AbilityTransitionInfo> info, std::shared_ptr<Media::PixelMap> pixelMap) = 0; 45 46 virtual void CancelStartingWindow(sptr<IRemoteObject> abilityToken) = 0; 47 48 virtual void NotifyAnimationAbilityDied(sptr<AbilityTransitionInfo> info) = 0; 49 50 virtual int32_t MoveMissionsToForeground(const std::vector<int32_t>& missionIds, int32_t topMissionId) = 0; 51 52 virtual int32_t MoveMissionsToBackground(const std::vector<int32_t>& missionIds, std::vector<int32_t>& result) = 0; 53 54 enum WMSCmd { 55 // ipc id for NotifyWindowTransition 56 ON_NOTIFY_WINDOW_TRANSITION, 57 58 // ipc id for GetFocusWindow 59 ON_GET_FOCUS_ABILITY, 60 61 // ipc id for Cold StartingWindow 62 ON_COLD_STARTING_WINDOW, 63 64 // ipc id for Hot StartingWindow 65 ON_HOT_STARTING_WINDOW, 66 67 // ipc id for CancelStartingWindow 68 ON_CANCEL_STARTING_WINDOW, 69 70 // ipc id for NotifyAnimationAbilityDied 71 ON_NOTIFY_ANIMATION_ABILITY_DIED, 72 73 // ipc id for MoveMissionsToForeground 74 ON_MOVE_MISSINONS_TO_FOREGROUND, 75 76 // ipc id for MoveMissionsToBackground 77 ON_MOVE_MISSIONS_TO_BACKGROUND, 78 }; 79 }; 80 } // namespace AAFwk 81 } // namespace OHOS 82 #endif 83 #endif // OHOS_ABILITY_RUNTIME_WINDOW_MANAGER_SERVICE_HANDLER_H 84