1/**
2 * Copyright (c) 2022-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
16import { Log } from '../utils/Log';
17
18const TAG = 'BaseRemoteAnimationHandler';
19
20interface appIconInfo {
21    appIconSize: number,
22    appIconPositionX: number,
23    appIconPositionY: number
24}
25
26/**
27 * remote animation base class
28 */
29export abstract class BaseRemoteAnimationHandler {
30    public mAppIconSize: number = 0;
31    public mAppIconPositionX: number = 0;
32    public mAppIconPositionY: number = 0;
33    public mAppIconHeight: number = 0;
34
35    constructor() {
36    }
37
38    /**
39     * set app icon size
40     *
41     * @param appIconSize appIconSize
42    */
43    public setAppIconSize(appIconSize: number, appIconHeight?: number): void {
44        this.mAppIconHeight = appIconHeight;
45        this.mAppIconSize = appIconSize;
46        Log.showDebug(TAG, `setAppIconSize appIconSize is ${appIconSize} , appIconHeight is ${appIconHeight}`);
47    }
48
49    /**
50     * calculate app icon position.
51     */
52    protected abstract calculateAppIconPosition(): void;
53
54    /**
55     * set app icon info.
56     */
57    public setAppIconInfo(): void {
58        this.calculateAppIconPosition();
59        Log.showDebug(TAG, `setAppIconInfo appIconSize is ${this.mAppIconSize} , appIconHeight is ${this.mAppIconHeight} ,
60      appIconPositionX ${this.mAppIconPositionX} , appIconPositionY ${this.mAppIconPositionY}`);
61    }
62}
63