• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/**
17 * @file
18 * @kit ArkUI
19 */
20
21import { AsyncCallback } from './@ohos.base';
22
23/**
24 * Window animation manager.
25 *
26 * @namespace windowAnimationManager
27 * @syscap SystemCapability.WindowManager.WindowManager.Core
28 * @systemapi Hide this for inner system use.
29 * @since 9
30 */
31declare namespace windowAnimationManager {
32  /**
33   * Set the window animation controller.
34   *
35   * @param { WindowAnimationController } controller - Window animation controller.
36   * @syscap SystemCapability.WindowManager.WindowManager.Core
37   * @systemapi Hide this for inner system use.
38   * @since 9
39   */
40  function setController(controller: WindowAnimationController): void;
41
42  /**
43   * Minimize the window target with animation.
44   *
45   * @param { WindowAnimationTarget } windowTarget - The window target to be minimized.
46   * @param { AsyncCallback<WindowAnimationFinishedCallback> } callback - Returns the animation finished callback.
47   * @syscap SystemCapability.WindowManager.WindowManager.Core
48   * @systemapi Hide this for inner system use.
49   * @since 9
50   */
51  function minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget,
52    callback: AsyncCallback<WindowAnimationFinishedCallback>): void;
53
54  /**
55   * Minimize the window target with animation.
56   *
57   * @param { WindowAnimationTarget }windowTarget - The window target to be minimized.
58   * @returns { Promise<WindowAnimationFinishedCallback> } Promise used to return the animation finished callback.
59   * @syscap SystemCapability.WindowManager.WindowManager.Core
60   * @systemapi Hide this for inner system use.
61   * @since 9
62   */
63  function minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget): Promise<WindowAnimationFinishedCallback>;
64
65  /**
66   * Round rect.
67   *
68   * @interface RRect
69   * @syscap SystemCapability.WindowManager.WindowManager.Core
70   * @systemapi Hide this for inner system use.
71   * @since 9
72   */
73  export interface RRect {
74    /**
75     * The X-axis coordinate of the upper left vertex of the round rect, in pixels.
76     * @type { number }
77     * @syscap SystemCapability.WindowManager.WindowManager.Core
78     * @systemapi Hide this for inner system use.
79     * @since 9
80     */
81    left: number;
82
83    /**
84     * The Y-axis coordinate of the upper left vertex of the round rect, in pixels.
85     * @type { number }
86     * @syscap SystemCapability.WindowManager.WindowManager.Core
87     * @systemapi Hide this for inner system use.
88     * @since 9
89     */
90    top: number;
91
92    /**
93     * Width of the round rect, in pixels.
94     * @type { number }
95     * @syscap SystemCapability.WindowManager.WindowManager.Core
96     * @systemapi Hide this for inner system use.
97     * @since 9
98     */
99    width: number;
100
101    /**
102     * Height of the round rect, in pixels.
103     * @type { number }
104     * @syscap SystemCapability.WindowManager.WindowManager.Core
105     * @systemapi Hide this for inner system use.
106     * @since 9
107     */
108    height: number;
109
110    /**
111     * Radius of the round corner of the round rect, in pixels.
112     * @type { number }
113     * @syscap SystemCapability.WindowManager.WindowManager.Core
114     * @systemapi Hide this for inner system use.
115     * @since 9
116     */
117    radius: number;
118  }
119
120  /**
121   * Window animation target.
122   *
123   * @interface WindowAnimationTarget
124   * @syscap SystemCapability.WindowManager.WindowManager.Core
125   * @systemapi Hide this for inner system use.
126   * @since 9
127   */
128  export interface WindowAnimationTarget {
129    /**
130     * The bundle name of the window animation target.
131     * @type { string }
132     * @syscap SystemCapability.WindowManager.WindowManager.Core
133     * @systemapi Hide this for inner system use.
134     * @since 9
135     */
136    readonly bundleName: string;
137
138    /**
139    /* The ability name of the window animation target.
140     * @type { string }
141     * @syscap SystemCapability.WindowManager.WindowManager.Core
142     * @systemapi Hide this for inner system use.
143     * @since 9
144     */
145    readonly abilityName: string;
146
147    /**
148    /* The window bounds of the window animation target.
149     * @type { RRect }
150     * @syscap SystemCapability.WindowManager.WindowManager.Core
151     * @systemapi Hide this for inner system use.
152     * @since 9
153     */
154    readonly windowBounds: RRect;
155
156    /**
157    /* The mission id of the window animation target.
158     * @type { number }
159     * @syscap SystemCapability.WindowManager.WindowManager.Core
160     * @systemapi Hide this for inner system use.
161     * @since 9
162     */
163    readonly missionId: number;
164  }
165
166  /**
167   * Window animation finished callback.
168   *
169   * @interface WindowAnimationFinishedCallback
170   * @syscap SystemCapability.WindowManager.WindowManager.Core
171   * @systemapi Hide this for inner system use.
172   * @since 9
173   */
174  export interface WindowAnimationFinishedCallback {
175    /**
176     * The function of window animation finished callback.
177     *
178     * @syscap SystemCapability.WindowManager.WindowManager.Core
179     * @systemapi Hide this for inner system use.
180     * @since 9
181     */
182    onAnimationFinish(): void;
183  }
184
185  /**
186   * Window animation controller.
187   *
188   * @interface WindowAnimationController
189   * @syscap SystemCapability.WindowManager.WindowManager.Core
190   * @systemapi Hide this for inner system use.
191   * @since 9
192   */
193  export interface WindowAnimationController {
194    /**
195     * Called on starting an application form launcher.
196     *
197     * @param { WindowAnimationTarget } startingWindowTarget  - indicates Window target of the starting application.
198     * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback.
199     * @syscap SystemCapability.WindowManager.WindowManager.Core
200     * @systemapi Hide this for inner system use.
201     * @since 9
202     */
203    onStartAppFromLauncher(startingWindowTarget: WindowAnimationTarget,
204      finishCallback: WindowAnimationFinishedCallback): void;
205
206    /**
207     * Called on starting an application form recent.
208     *
209     * @param { WindowAnimationTarget } startingWindowTarget - Window target of the starting application.
210     * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback.
211     * @syscap SystemCapability.WindowManager.WindowManager.Core
212     * @systemapi Hide this for inner system use.
213     * @since 9
214     */
215    onStartAppFromRecent(startingWindowTarget: WindowAnimationTarget,
216      finishCallback: WindowAnimationFinishedCallback): void;
217
218    /**
219     * Called on starting an application form other.
220     *
221     * @param { WindowAnimationTarget } startingWindowTarget - Window target of the starting application.
222     * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback.
223     * @syscap SystemCapability.WindowManager.WindowManager.Core
224     * @systemapi Hide this for inner system use.
225     * @since 9
226     */
227    onStartAppFromOther(startingWindowTarget: WindowAnimationTarget,
228      finishCallback: WindowAnimationFinishedCallback): void;
229
230    /**
231     * Called on application transition.
232     *
233     * @param { WindowAnimationTarget } fromWindowTarget - Window target of the source application.
234     * @param { WindowAnimationTarget } toWindowTarget - Window target of the destination application.
235     * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback.
236     * @syscap SystemCapability.WindowManager.WindowManager.Core
237     * @systemapi Hide this for inner system use.
238     * @since 9
239     */
240    onAppTransition(fromWindowTarget: WindowAnimationTarget, toWindowTarget: WindowAnimationTarget,
241      finishCallback: WindowAnimationFinishedCallback): void;
242
243    /**
244     * Called on minimizing a window.
245     *
246     * @param { WindowAnimationTarget } minimizingWindowTarget - Window target of the minimizing window.
247     * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback.
248     * @syscap SystemCapability.WindowManager.WindowManager.Core
249     * @systemapi Hide this for inner system use.
250     * @since 9
251     */
252    onMinimizeWindow(minimizingWindowTarget: WindowAnimationTarget,
253      finishCallback: WindowAnimationFinishedCallback): void;
254
255    /**
256     * Called on closing a window.
257     *
258     * @param { WindowAnimationTarget }closingWindowTarget - Window target of the closing window.
259     * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback.
260     * @syscap SystemCapability.WindowManager.WindowManager.Core
261     * @systemapi Hide this for inner system use.
262     * @since 9
263     */
264    onCloseWindow(closingWindowTarget: WindowAnimationTarget, finishCallback: WindowAnimationFinishedCallback): void;
265
266    /**
267     * Called on unlocking the screen.
268     *
269     * @param {WindowAnimationFinishedCallback } finishCallback - Animation finished callback.
270     * @syscap SystemCapability.WindowManager.WindowManager.Core
271     * @systemapi Hide this for inner system use.
272     * @since 9
273     */
274    onScreenUnlock(finishCallback: WindowAnimationFinishedCallback): void;
275
276
277    /**
278     * Called on window animation targets update.
279     *
280     * @param { WindowAnimationTarget } fullScreenWindowTarget - The fullscreen window target.
281     * @param { Array<WindowAnimationTarget> } floatingWindowTargets - All the floating window targets.
282     * @syscap SystemCapability.WindowManager.WindowManager.Core
283     * @systemapi Hide this for inner system use.
284     * @since 9
285     */
286    onWindowAnimationTargetsUpdate(fullScreenWindowTarget: WindowAnimationTarget,
287      floatingWindowTargets: Array<WindowAnimationTarget>): void;
288  }
289}
290
291export default windowAnimationManager;
292