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_WINDOW_ANIMATION_PROXY_H
17 #define WINDOW_ANIMATION_RS_WINDOW_ANIMATION_PROXY_H
18 
19 #include <string>
20 
21 #include <iremote_proxy.h>
22 
23 #include "rs_iwindow_animation_controller.h"
24 
25 namespace OHOS {
26 namespace Rosen {
27 class RSWindowAnimationProxy : public IRemoteProxy<RSIWindowAnimationController> {
28 public:
29     explicit RSWindowAnimationProxy(const sptr<IRemoteObject>& impl);
30     virtual ~RSWindowAnimationProxy() = default;
31 
32     void OnStartApp(StartingAppType type, const sptr<RSWindowAnimationTarget>& startingWindowTarget,
33         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) override;
34 
35     void OnAppTransition(const sptr<RSWindowAnimationTarget>& fromWindowTarget,
36         const sptr<RSWindowAnimationTarget>& toWindowTarget,
37         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) override;
38 
39     void OnAppBackTransition(const sptr<RSWindowAnimationTarget>& fromWindowTarget,
40         const sptr<RSWindowAnimationTarget>& toWindowTarget,
41         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) override;
42 
43     void OnMinimizeWindow(const sptr<RSWindowAnimationTarget>& minimizingWindowTarget,
44         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) override;
45 
46     void OnMinimizeAllWindow(std::vector<sptr<RSWindowAnimationTarget>> minimizingWindowsTarget,
47         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) override;
48 
49     void OnCloseWindow(const sptr<RSWindowAnimationTarget>& closingWindowTarget,
50         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) override;
51 
52     void OnScreenUnlock(const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback) override;
53 
54     void OnWindowAnimationTargetsUpdate(const sptr<RSWindowAnimationTarget>& fullScreenWindowTarget,
55         const std::vector<sptr<RSWindowAnimationTarget>>& floatingWindowTargets) override;
56 
57     void OnWallpaperUpdate(const sptr<RSWindowAnimationTarget>& wallpaperTarget) override;
58 private:
59     bool WriteInterfaceToken(MessageParcel& data);
60     bool WriteTargetAndCallback(MessageParcel& data, const sptr<RSWindowAnimationTarget>& windowTarget,
61         const sptr<RSIWindowAnimationFinishedCallback>& finishedCallback);
62     static inline BrokerDelegator<RSWindowAnimationProxy> delegator_;
63 };
64 } // namespace Rosen
65 } // namespace OHOS
66 
67 #endif // WINDOW_ANIMATION_RS_WINDOW_ANIMATION_PROXY_H
68