161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2024 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 AbilityKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport ExtensionAbility from './@ohos.app.ability.ExtensionAbility';
2261847f8eSopenharmony_ciimport PhotoEditorExtensionContext from './application/PhotoEditorExtensionContext';
2361847f8eSopenharmony_ciimport type UIExtensionContentSession from './@ohos.app.ability.UIExtensionContentSession';
2461847f8eSopenharmony_ciimport type Want from './@ohos.app.ability.Want';
2561847f8eSopenharmony_ci
2661847f8eSopenharmony_ci/**
2761847f8eSopenharmony_ci * Class of the photo editor ExtensionAbility, which provides APIs for you to edit photos.
2861847f8eSopenharmony_ci *
2961847f8eSopenharmony_ci * @extends ExtensionAbility
3061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AppExtension.PhotoEditorExtension
3161847f8eSopenharmony_ci * @StageModelOnly
3261847f8eSopenharmony_ci * @since 12
3361847f8eSopenharmony_ci */
3461847f8eSopenharmony_ciexport default class PhotoEditorExtensionAbility extends ExtensionAbility {
3561847f8eSopenharmony_ci     /**
3661847f8eSopenharmony_ci      * Indicates configuration information about an Photo editor extension ability context.
3761847f8eSopenharmony_ci      *
3861847f8eSopenharmony_ci      * @type { PhotoEditorExtensionContext }
3961847f8eSopenharmony_ci      * @syscap SystemCapability.Ability.AppExtension.PhotoEditorExtension
4061847f8eSopenharmony_ci      * @StageModelOnly
4161847f8eSopenharmony_ci      * @since 12
4261847f8eSopenharmony_ci      */
4361847f8eSopenharmony_ci    context: PhotoEditorExtensionContext;
4461847f8eSopenharmony_ci
4561847f8eSopenharmony_ci    /**
4661847f8eSopenharmony_ci     * Called back when an UI extension is started for initialization.
4761847f8eSopenharmony_ci     *
4861847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AppExtension.PhotoEditorExtension
4961847f8eSopenharmony_ci     * @StageModelOnly
5061847f8eSopenharmony_ci     * @since 12
5161847f8eSopenharmony_ci     */
5261847f8eSopenharmony_ci    onCreate(): void;
5361847f8eSopenharmony_ci
5461847f8eSopenharmony_ci    /**
5561847f8eSopenharmony_ci     * Called back when the state of an UI extension changes to foreground.
5661847f8eSopenharmony_ci     *
5761847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
5861847f8eSopenharmony_ci     * @StageModelOnly
5961847f8eSopenharmony_ci     * @since 12
6061847f8eSopenharmony_ci     */
6161847f8eSopenharmony_ci    onForeground(): void;
6261847f8eSopenharmony_ci
6361847f8eSopenharmony_ci    /**
6461847f8eSopenharmony_ci     * Called back when the state of an UI extension changes to background.
6561847f8eSopenharmony_ci     *
6661847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
6761847f8eSopenharmony_ci     * @StageModelOnly
6861847f8eSopenharmony_ci     * @since 12
6961847f8eSopenharmony_ci     */
7061847f8eSopenharmony_ci    onBackground(): void;
7161847f8eSopenharmony_ci
7261847f8eSopenharmony_ci    /**
7361847f8eSopenharmony_ci     * Called back before an UI extension is destroyed.
7461847f8eSopenharmony_ci     *
7561847f8eSopenharmony_ci     * @returns { void | Promise<void> } the promise returned by the function.
7661847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AppExtension.PhotoEditorExtension
7761847f8eSopenharmony_ci     * @StageModelOnly
7861847f8eSopenharmony_ci     * @since 12
7961847f8eSopenharmony_ci     */
8061847f8eSopenharmony_ci    onDestroy(): void | Promise<void>;
8161847f8eSopenharmony_ci
8261847f8eSopenharmony_ci    /**
8361847f8eSopenharmony_ci     * Called back when an UI extension session is created and original image is ready.
8461847f8eSopenharmony_ci     *
8561847f8eSopenharmony_ci     * @param { string } uri - Indicates the uri info of the original image.
8661847f8eSopenharmony_ci     * @param { Want } want - Indicates the want info of the UI extension.
8761847f8eSopenharmony_ci     * @param { UIExtensionContentSession } session - Indicates the session of the UI extension page.
8861847f8eSopenharmony_ci     * @syscap SystemCapability.Ability.AppExtension.PhotoEditorExtension
8961847f8eSopenharmony_ci     * @StageModelOnly
9061847f8eSopenharmony_ci     * @since 12
9161847f8eSopenharmony_ci     */
9261847f8eSopenharmony_ci    onStartContentEditing(uri: string, want: Want, session: UIExtensionContentSession): void;
9361847f8eSopenharmony_ci}