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