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 { paramMock } from "../utils" 17 18export function mockWindowAnimationManager() { 19 const RRect = { 20 left: '[PC preview] unknow left', 21 top: '[PC preview] unknow top', 22 width: '[PC preview] unknow width', 23 height: '[PC preview] unknow height', 24 radius: '[PC preview] unknow radius', 25 } 26 const WindowAnimationTarget = { 27 bundleName: '[PC preview] unknow bundleName', 28 abilityName: '[PC preview] unknow abilityName', 29 windowBounds: RRect, 30 } 31 const WindowAnimationFinishedCallback = { 32 onAnimationFinish: function (...args) { 33 console.warn("WindowAnimationFinishedCallback.onAnimationFinish interface mocked in the Previewer. How this interface works on the" + 34 " Previewer may be different from that on a real device.") 35 }, 36 } 37 const WindowAnimationController = { 38 onStartAppFromLauncher: function (...args) { 39 console.warn("WindowAnimationController.onStartAppFromLauncher interface mocked in the Previewer. How this interface works on the" + 40 " Previewer may be different from that on a real device.") 41 }, 42 onStartAppFromRecent: function (...args) { 43 console.warn("WindowAnimationController.onStartAppFromRecent interface mocked in the Previewer. How this interface works on the" + 44 " Previewer may be different from that on a real device.") 45 }, 46 onStartAppFromOther: function (...args) { 47 console.warn("WindowAnimationController.onStartAppFromOther interface mocked in the Previewer. How this interface works on the" + 48 " Previewer may be different from that on a real device.") 49 }, 50 onAppTransition: function (...args) { 51 console.warn("WindowAnimationController.onAppTransition interface mocked in the Previewer. How this interface works on the" + 52 " Previewer may be different from that on a real device.") 53 }, 54 onMinimizeWindow: function (...args) { 55 console.warn("WindowAnimationController.onMinimizeWindow interface mocked in the Previewer. How this interface works on the" + 56 " Previewer may be different from that on a real device.") 57 }, 58 onCloseWindow: function (...args) { 59 console.warn("WindowAnimationController.onCloseWindow interface mocked in the Previewer. How this interface works on the" + 60 " Previewer may be different from that on a real device.") 61 }, 62 onScreenUnlock: function (...args) { 63 console.warn("WindowAnimationController.onScreenUnlock interface mocked in the Previewer. How this interface works on the" + 64 " Previewer may be different from that on a real device.") 65 }, 66 } 67 68 const windowAnimationManager = { 69 WindowAnimationController, 70 WindowAnimationFinishedCallback, 71 WindowAnimationTarget, 72 RRect, 73 setController: function (...args) { 74 console.warn("windowAnimationManager.setController interface mocked in the Previewer. How this interface works on the" + 75 " Previewer may be different from that on a real device.") 76 } 77 } 78 return windowAnimationManager 79}