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