161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit ArkUI 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Window animation manager. 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @namespace windowAnimationManager 2761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 2861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 2961847f8eSopenharmony_ci * @since 9 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_cideclare namespace windowAnimationManager { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Set the window animation controller. 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @param { WindowAnimationController } controller - Window animation controller. 3661847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 3761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 3861847f8eSopenharmony_ci * @since 9 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_ci function setController(controller: WindowAnimationController): void; 4161847f8eSopenharmony_ci 4261847f8eSopenharmony_ci /** 4361847f8eSopenharmony_ci * Minimize the window target with animation. 4461847f8eSopenharmony_ci * 4561847f8eSopenharmony_ci * @param { WindowAnimationTarget } windowTarget - The window target to be minimized. 4661847f8eSopenharmony_ci * @param { AsyncCallback<WindowAnimationFinishedCallback> } callback - Returns the animation finished callback. 4761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 4861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 4961847f8eSopenharmony_ci * @since 9 5061847f8eSopenharmony_ci */ 5161847f8eSopenharmony_ci function minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget, 5261847f8eSopenharmony_ci callback: AsyncCallback<WindowAnimationFinishedCallback>): void; 5361847f8eSopenharmony_ci 5461847f8eSopenharmony_ci /** 5561847f8eSopenharmony_ci * Minimize the window target with animation. 5661847f8eSopenharmony_ci * 5761847f8eSopenharmony_ci * @param { WindowAnimationTarget }windowTarget - The window target to be minimized. 5861847f8eSopenharmony_ci * @returns { Promise<WindowAnimationFinishedCallback> } Promise used to return the animation finished callback. 5961847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 6061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 6161847f8eSopenharmony_ci * @since 9 6261847f8eSopenharmony_ci */ 6361847f8eSopenharmony_ci function minimizeWindowWithAnimation(windowTarget: WindowAnimationTarget): Promise<WindowAnimationFinishedCallback>; 6461847f8eSopenharmony_ci 6561847f8eSopenharmony_ci /** 6661847f8eSopenharmony_ci * Round rect. 6761847f8eSopenharmony_ci * 6861847f8eSopenharmony_ci * @interface RRect 6961847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 7061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 7161847f8eSopenharmony_ci * @since 9 7261847f8eSopenharmony_ci */ 7361847f8eSopenharmony_ci export interface RRect { 7461847f8eSopenharmony_ci /** 7561847f8eSopenharmony_ci * The X-axis coordinate of the upper left vertex of the round rect, in pixels. 7661847f8eSopenharmony_ci * @type { number } 7761847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 7861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 7961847f8eSopenharmony_ci * @since 9 8061847f8eSopenharmony_ci */ 8161847f8eSopenharmony_ci left: number; 8261847f8eSopenharmony_ci 8361847f8eSopenharmony_ci /** 8461847f8eSopenharmony_ci * The Y-axis coordinate of the upper left vertex of the round rect, in pixels. 8561847f8eSopenharmony_ci * @type { number } 8661847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 8761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 8861847f8eSopenharmony_ci * @since 9 8961847f8eSopenharmony_ci */ 9061847f8eSopenharmony_ci top: number; 9161847f8eSopenharmony_ci 9261847f8eSopenharmony_ci /** 9361847f8eSopenharmony_ci * Width of the round rect, in pixels. 9461847f8eSopenharmony_ci * @type { number } 9561847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 9661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 9761847f8eSopenharmony_ci * @since 9 9861847f8eSopenharmony_ci */ 9961847f8eSopenharmony_ci width: number; 10061847f8eSopenharmony_ci 10161847f8eSopenharmony_ci /** 10261847f8eSopenharmony_ci * Height of the round rect, in pixels. 10361847f8eSopenharmony_ci * @type { number } 10461847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 10561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 10661847f8eSopenharmony_ci * @since 9 10761847f8eSopenharmony_ci */ 10861847f8eSopenharmony_ci height: number; 10961847f8eSopenharmony_ci 11061847f8eSopenharmony_ci /** 11161847f8eSopenharmony_ci * Radius of the round corner of the round rect, in pixels. 11261847f8eSopenharmony_ci * @type { number } 11361847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 11461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 11561847f8eSopenharmony_ci * @since 9 11661847f8eSopenharmony_ci */ 11761847f8eSopenharmony_ci radius: number; 11861847f8eSopenharmony_ci } 11961847f8eSopenharmony_ci 12061847f8eSopenharmony_ci /** 12161847f8eSopenharmony_ci * Window animation target. 12261847f8eSopenharmony_ci * 12361847f8eSopenharmony_ci * @interface WindowAnimationTarget 12461847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 12561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 12661847f8eSopenharmony_ci * @since 9 12761847f8eSopenharmony_ci */ 12861847f8eSopenharmony_ci export interface WindowAnimationTarget { 12961847f8eSopenharmony_ci /** 13061847f8eSopenharmony_ci * The bundle name of the window animation target. 13161847f8eSopenharmony_ci * @type { string } 13261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 13361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 13461847f8eSopenharmony_ci * @since 9 13561847f8eSopenharmony_ci */ 13661847f8eSopenharmony_ci readonly bundleName: string; 13761847f8eSopenharmony_ci 13861847f8eSopenharmony_ci /** 13961847f8eSopenharmony_ci /* The ability name of the window animation target. 14061847f8eSopenharmony_ci * @type { string } 14161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 14261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 14361847f8eSopenharmony_ci * @since 9 14461847f8eSopenharmony_ci */ 14561847f8eSopenharmony_ci readonly abilityName: string; 14661847f8eSopenharmony_ci 14761847f8eSopenharmony_ci /** 14861847f8eSopenharmony_ci /* The window bounds of the window animation target. 14961847f8eSopenharmony_ci * @type { RRect } 15061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 15161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 15261847f8eSopenharmony_ci * @since 9 15361847f8eSopenharmony_ci */ 15461847f8eSopenharmony_ci readonly windowBounds: RRect; 15561847f8eSopenharmony_ci 15661847f8eSopenharmony_ci /** 15761847f8eSopenharmony_ci /* The mission id of the window animation target. 15861847f8eSopenharmony_ci * @type { number } 15961847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 16061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 16161847f8eSopenharmony_ci * @since 9 16261847f8eSopenharmony_ci */ 16361847f8eSopenharmony_ci readonly missionId: number; 16461847f8eSopenharmony_ci } 16561847f8eSopenharmony_ci 16661847f8eSopenharmony_ci /** 16761847f8eSopenharmony_ci * Window animation finished callback. 16861847f8eSopenharmony_ci * 16961847f8eSopenharmony_ci * @interface WindowAnimationFinishedCallback 17061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 17161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 17261847f8eSopenharmony_ci * @since 9 17361847f8eSopenharmony_ci */ 17461847f8eSopenharmony_ci export interface WindowAnimationFinishedCallback { 17561847f8eSopenharmony_ci /** 17661847f8eSopenharmony_ci * The function of window animation finished callback. 17761847f8eSopenharmony_ci * 17861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 17961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 18061847f8eSopenharmony_ci * @since 9 18161847f8eSopenharmony_ci */ 18261847f8eSopenharmony_ci onAnimationFinish(): void; 18361847f8eSopenharmony_ci } 18461847f8eSopenharmony_ci 18561847f8eSopenharmony_ci /** 18661847f8eSopenharmony_ci * Window animation controller. 18761847f8eSopenharmony_ci * 18861847f8eSopenharmony_ci * @interface WindowAnimationController 18961847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 19061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 19161847f8eSopenharmony_ci * @since 9 19261847f8eSopenharmony_ci */ 19361847f8eSopenharmony_ci export interface WindowAnimationController { 19461847f8eSopenharmony_ci /** 19561847f8eSopenharmony_ci * Called on starting an application form launcher. 19661847f8eSopenharmony_ci * 19761847f8eSopenharmony_ci * @param { WindowAnimationTarget } startingWindowTarget - indicates Window target of the starting application. 19861847f8eSopenharmony_ci * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback. 19961847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 20061847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 20161847f8eSopenharmony_ci * @since 9 20261847f8eSopenharmony_ci */ 20361847f8eSopenharmony_ci onStartAppFromLauncher(startingWindowTarget: WindowAnimationTarget, 20461847f8eSopenharmony_ci finishCallback: WindowAnimationFinishedCallback): void; 20561847f8eSopenharmony_ci 20661847f8eSopenharmony_ci /** 20761847f8eSopenharmony_ci * Called on starting an application form recent. 20861847f8eSopenharmony_ci * 20961847f8eSopenharmony_ci * @param { WindowAnimationTarget } startingWindowTarget - Window target of the starting application. 21061847f8eSopenharmony_ci * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback. 21161847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 21261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 21361847f8eSopenharmony_ci * @since 9 21461847f8eSopenharmony_ci */ 21561847f8eSopenharmony_ci onStartAppFromRecent(startingWindowTarget: WindowAnimationTarget, 21661847f8eSopenharmony_ci finishCallback: WindowAnimationFinishedCallback): void; 21761847f8eSopenharmony_ci 21861847f8eSopenharmony_ci /** 21961847f8eSopenharmony_ci * Called on starting an application form other. 22061847f8eSopenharmony_ci * 22161847f8eSopenharmony_ci * @param { WindowAnimationTarget } startingWindowTarget - Window target of the starting application. 22261847f8eSopenharmony_ci * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback. 22361847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 22461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 22561847f8eSopenharmony_ci * @since 9 22661847f8eSopenharmony_ci */ 22761847f8eSopenharmony_ci onStartAppFromOther(startingWindowTarget: WindowAnimationTarget, 22861847f8eSopenharmony_ci finishCallback: WindowAnimationFinishedCallback): void; 22961847f8eSopenharmony_ci 23061847f8eSopenharmony_ci /** 23161847f8eSopenharmony_ci * Called on application transition. 23261847f8eSopenharmony_ci * 23361847f8eSopenharmony_ci * @param { WindowAnimationTarget } fromWindowTarget - Window target of the source application. 23461847f8eSopenharmony_ci * @param { WindowAnimationTarget } toWindowTarget - Window target of the destination application. 23561847f8eSopenharmony_ci * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback. 23661847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 23761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 23861847f8eSopenharmony_ci * @since 9 23961847f8eSopenharmony_ci */ 24061847f8eSopenharmony_ci onAppTransition(fromWindowTarget: WindowAnimationTarget, toWindowTarget: WindowAnimationTarget, 24161847f8eSopenharmony_ci finishCallback: WindowAnimationFinishedCallback): void; 24261847f8eSopenharmony_ci 24361847f8eSopenharmony_ci /** 24461847f8eSopenharmony_ci * Called on minimizing a window. 24561847f8eSopenharmony_ci * 24661847f8eSopenharmony_ci * @param { WindowAnimationTarget } minimizingWindowTarget - Window target of the minimizing window. 24761847f8eSopenharmony_ci * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback. 24861847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 24961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 25061847f8eSopenharmony_ci * @since 9 25161847f8eSopenharmony_ci */ 25261847f8eSopenharmony_ci onMinimizeWindow(minimizingWindowTarget: WindowAnimationTarget, 25361847f8eSopenharmony_ci finishCallback: WindowAnimationFinishedCallback): void; 25461847f8eSopenharmony_ci 25561847f8eSopenharmony_ci /** 25661847f8eSopenharmony_ci * Called on closing a window. 25761847f8eSopenharmony_ci * 25861847f8eSopenharmony_ci * @param { WindowAnimationTarget }closingWindowTarget - Window target of the closing window. 25961847f8eSopenharmony_ci * @param { WindowAnimationFinishedCallback } finishCallback - Animation finished callback. 26061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 26161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 26261847f8eSopenharmony_ci * @since 9 26361847f8eSopenharmony_ci */ 26461847f8eSopenharmony_ci onCloseWindow(closingWindowTarget: WindowAnimationTarget, finishCallback: WindowAnimationFinishedCallback): void; 26561847f8eSopenharmony_ci 26661847f8eSopenharmony_ci /** 26761847f8eSopenharmony_ci * Called on unlocking the screen. 26861847f8eSopenharmony_ci * 26961847f8eSopenharmony_ci * @param {WindowAnimationFinishedCallback } finishCallback - Animation finished callback. 27061847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 27161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 27261847f8eSopenharmony_ci * @since 9 27361847f8eSopenharmony_ci */ 27461847f8eSopenharmony_ci onScreenUnlock(finishCallback: WindowAnimationFinishedCallback): void; 27561847f8eSopenharmony_ci 27661847f8eSopenharmony_ci 27761847f8eSopenharmony_ci /** 27861847f8eSopenharmony_ci * Called on window animation targets update. 27961847f8eSopenharmony_ci * 28061847f8eSopenharmony_ci * @param { WindowAnimationTarget } fullScreenWindowTarget - The fullscreen window target. 28161847f8eSopenharmony_ci * @param { Array<WindowAnimationTarget> } floatingWindowTargets - All the floating window targets. 28261847f8eSopenharmony_ci * @syscap SystemCapability.WindowManager.WindowManager.Core 28361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 28461847f8eSopenharmony_ci * @since 9 28561847f8eSopenharmony_ci */ 28661847f8eSopenharmony_ci onWindowAnimationTargetsUpdate(fullScreenWindowTarget: WindowAnimationTarget, 28761847f8eSopenharmony_ci floatingWindowTargets: Array<WindowAnimationTarget>): void; 28861847f8eSopenharmony_ci } 28961847f8eSopenharmony_ci} 29061847f8eSopenharmony_ci 29161847f8eSopenharmony_ciexport default windowAnimationManager; 292