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 WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H
17 #define WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H
18 
19 #include <vector>
20 
21 #include <iremote_broker.h>
22 
23 namespace OHOS {
24 namespace Rosen {
25 struct RSWindowAnimationTarget;
26 class RSIWindowAnimationFinishedCallback;
27 
28 enum StartingAppType {
29     FROM_LAUNCHER,
30     FROM_RECENT,
31     FROM_OTHER,
32 };
33 
34 class RSIWindowAnimationController : public IRemoteBroker {
35 public:
36     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.rosen.RSIWindowAnimationController");
37 
38     enum {
39         ON_START_APP,
40         ON_APP_TRANSITION,
41         ON_APP_BACK_TRANSITION,
42         ON_MINIMIZE_WINDOW,
43         ON_MINIMIZE_ALLWINDOW,
44         ON_CLOSE_WINDOW,
45         ON_SCREEN_UNLOCK,
46         ON_WINDOW_ANIMATION_TARGETS_UPDATE,
47         ON_WALLPAPER_UPDATE,
48     };
49 
50     virtual void OnStartApp(StartingAppType type, const sptr<RSWindowAnimationTarget>& startingWindowTarget,
51         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) = 0;
52 
53     virtual void OnAppTransition(const sptr<RSWindowAnimationTarget>& from, const sptr<RSWindowAnimationTarget>& to,
54         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) = 0;
55 
56     virtual void OnAppBackTransition(const sptr<RSWindowAnimationTarget>& from, const sptr<RSWindowAnimationTarget>& to,
57         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) = 0;
58 
59     virtual void OnMinimizeWindow(const sptr<RSWindowAnimationTarget>& minimizingWindow,
60         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) = 0;
61 
62     virtual void OnMinimizeAllWindow(std::vector<sptr<RSWindowAnimationTarget>> minimizingWindows,
63         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) = 0;
64 
65     virtual void OnCloseWindow(const sptr<RSWindowAnimationTarget>& closingWindow,
66         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) = 0;
67 
68     virtual void OnScreenUnlock(const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) = 0;
69 
70     virtual void OnWindowAnimationTargetsUpdate(const sptr<RSWindowAnimationTarget>& fullScreenWindowTarget,
71         const std::vector<sptr<RSWindowAnimationTarget>>& floatingWindowTargets) = 0;
72 
73     virtual void OnWallpaperUpdate(const sptr<RSWindowAnimationTarget>& wallpaperTarget) = 0;
74 };
75 } // namespace Rosen
76 } // namespace OHOS
77 
78 #endif // WINDOW_ANIMATION_RS_IWINDOW_ANIMATION_CONTROLLER_H
79