1/* 2 * Copyright (c) 2022-2023 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 rpc from './@ohos.rpc'; 22import _WindowExtensionContext from './application/WindowExtensionContext'; 23import Want from './@ohos.app.ability.Want'; 24import window from './@ohos.window'; 25 26/** 27 * class of window extension ability. 28 * 29 * @syscap SystemCapability.WindowManager.WindowManager.Core 30 * @systemapi hide for inner use. 31 * @StageModelOnly 32 * @since 9 33 */ 34export default class WindowExtensionAbility { 35 /** 36 * Indicates window extension ability context. 37 * 38 * @type { WindowExtensionContext } 39 * @syscap SystemCapability.WindowManager.WindowManager.Core 40 * @systemapi hide for inner use. 41 * @StageModelOnly 42 * @since 9 43 */ 44 context: WindowExtensionContext; 45 46 /** 47 * Called back when a window extension is first connected to an ability. 48 * 49 * @param { Want } want Indicates connection information about the Window ability. 50 * @syscap SystemCapability.WindowManager.WindowManager.Core 51 * @systemapi hide for inner use. 52 * @StageModelOnly 53 * @since 9 54 */ 55 onConnect(want: Want): void; 56 57 /** 58 * Called back when all abilities connected to a window extension are disconnected. 59 * 60 * @param { Want } want Indicates disconnection information about the window extension. 61 * @syscap SystemCapability.WindowManager.WindowManager.Core 62 * @systemapi hide for inner use. 63 * @StageModelOnly 64 * @since 9 65 */ 66 onDisconnect(want: Want): void; 67 68 /** 69 * Called back when window is created. 70 * 71 * @param { window.Window } window Current Window instance. 72 * @syscap SystemCapability.WindowManager.WindowManager.Core 73 * @systemapi hide for inner use. 74 * @StageModelOnly 75 * @since 9 76 */ 77 onWindowReady(window: window.Window): void; 78} 79 80/** 81 * The context of window extension. It allows access to 82 * windowExtension-specific resources. 83 * 84 * @typedef { _WindowExtensionContext } 85 * @syscap SystemCapability.WindowManager.WindowManager.Core 86 * @systemapi 87 * @stagemodelonly 88 * @since 9 89 */ 90export type WindowExtensionContext = _WindowExtensionContext; 91