161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2023-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 ArkUI 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport image from './@ohos.multimedia.image'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Use the DrawableDescriptor class to get drawable image. 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 2761847f8eSopenharmony_ci * @since 10 2861847f8eSopenharmony_ci */ 2961847f8eSopenharmony_ci/** 3061847f8eSopenharmony_ci * Use the DrawableDescriptor class to get drawable image. 3161847f8eSopenharmony_ci * 3261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 3361847f8eSopenharmony_ci * @atomicservice 3461847f8eSopenharmony_ci * @since 11 3561847f8eSopenharmony_ci */ 3661847f8eSopenharmony_ci/** 3761847f8eSopenharmony_ci * Use the DrawableDescriptor class to get drawable image. 3861847f8eSopenharmony_ci * 3961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 4061847f8eSopenharmony_ci * @crossplatform 4161847f8eSopenharmony_ci * @atomicservice 4261847f8eSopenharmony_ci * @since 12 4361847f8eSopenharmony_ci */ 4461847f8eSopenharmony_ciexport class DrawableDescriptor { 4561847f8eSopenharmony_ci /** 4661847f8eSopenharmony_ci * Creates a new DrawableDescriptor. 4761847f8eSopenharmony_ci * 4861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 4961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 5061847f8eSopenharmony_ci * @since 10 5161847f8eSopenharmony_ci */ 5261847f8eSopenharmony_ci constructor(); 5361847f8eSopenharmony_ci 5461847f8eSopenharmony_ci /** 5561847f8eSopenharmony_ci * Get pixelMap of drawable image. 5661847f8eSopenharmony_ci * 5761847f8eSopenharmony_ci * @returns { image.PixelMap } Return the PixelMap of the calling DrawableDescriptor object. 5861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 5961847f8eSopenharmony_ci * @since 10 6061847f8eSopenharmony_ci */ 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * Get pixelMap of drawable image. 6361847f8eSopenharmony_ci * 6461847f8eSopenharmony_ci * @returns { image.PixelMap } Return the PixelMap of the calling DrawableDescriptor object. 6561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 6661847f8eSopenharmony_ci * @atomicservice 6761847f8eSopenharmony_ci * @since 11 6861847f8eSopenharmony_ci */ 6961847f8eSopenharmony_ci /** 7061847f8eSopenharmony_ci * Get pixelMap of drawable image. 7161847f8eSopenharmony_ci * 7261847f8eSopenharmony_ci * @returns { image.PixelMap } Return the PixelMap of the calling DrawableDescriptor object. 7361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 7461847f8eSopenharmony_ci * @crossplatform 7561847f8eSopenharmony_ci * @atomicservice 7661847f8eSopenharmony_ci * @since 12 7761847f8eSopenharmony_ci */ 7861847f8eSopenharmony_ci getPixelMap(): image.PixelMap; 7961847f8eSopenharmony_ci} 8061847f8eSopenharmony_ci 8161847f8eSopenharmony_ci/** 8261847f8eSopenharmony_ci * Use the LayeredDrawableDescriptor class to get the foreground, the background and the mask DrawableDescriptor. 8361847f8eSopenharmony_ci * 8461847f8eSopenharmony_ci * @extends DrawableDescriptor 8561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 8661847f8eSopenharmony_ci * @since 10 8761847f8eSopenharmony_ci */ 8861847f8eSopenharmony_ci/** 8961847f8eSopenharmony_ci * Use the LayeredDrawableDescriptor class to get the foreground, the background and the mask DrawableDescriptor. 9061847f8eSopenharmony_ci * 9161847f8eSopenharmony_ci * @extends DrawableDescriptor 9261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 9361847f8eSopenharmony_ci * @atomicservice 9461847f8eSopenharmony_ci * @since 11 9561847f8eSopenharmony_ci */ 9661847f8eSopenharmony_ci/** 9761847f8eSopenharmony_ci * Use the LayeredDrawableDescriptor class to get the foreground, the background and the mask DrawableDescriptor. 9861847f8eSopenharmony_ci * 9961847f8eSopenharmony_ci * @extends DrawableDescriptor 10061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 10161847f8eSopenharmony_ci * @crossplatform 10261847f8eSopenharmony_ci * @atomicservice 10361847f8eSopenharmony_ci * @since 12 10461847f8eSopenharmony_ci */ 10561847f8eSopenharmony_ciexport class LayeredDrawableDescriptor extends DrawableDescriptor { 10661847f8eSopenharmony_ci /** 10761847f8eSopenharmony_ci * Creates a new LayeredDrawableDescriptor. 10861847f8eSopenharmony_ci * 10961847f8eSopenharmony_ci * @param { DrawableDescriptor } [foreground] - Indicates the foreground option to create LayeredDrawableDescriptor. 11061847f8eSopenharmony_ci * @param { DrawableDescriptor } [background] - Indicates the background option to create LayeredDrawableDescriptor. 11161847f8eSopenharmony_ci * @param { DrawableDescriptor } [mask] - Indicates the mask option to create LayeredDrawableDescriptor. 11261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 11361847f8eSopenharmony_ci * @atomicservice 11461847f8eSopenharmony_ci * @since 12 11561847f8eSopenharmony_ci */ 11661847f8eSopenharmony_ci constructor( 11761847f8eSopenharmony_ci foreground?: DrawableDescriptor, 11861847f8eSopenharmony_ci background?: DrawableDescriptor, 11961847f8eSopenharmony_ci mask?: DrawableDescriptor 12061847f8eSopenharmony_ci ); 12161847f8eSopenharmony_ci 12261847f8eSopenharmony_ci /** 12361847f8eSopenharmony_ci * Get DrawableDescriptor for the foreground. 12461847f8eSopenharmony_ci * 12561847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of foreground. 12661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 12761847f8eSopenharmony_ci * @since 10 12861847f8eSopenharmony_ci */ 12961847f8eSopenharmony_ci /** 13061847f8eSopenharmony_ci * Get DrawableDescriptor for the foreground. 13161847f8eSopenharmony_ci * 13261847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of foreground. 13361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 13461847f8eSopenharmony_ci * @atomicservice 13561847f8eSopenharmony_ci * @since 11 13661847f8eSopenharmony_ci */ 13761847f8eSopenharmony_ci /** 13861847f8eSopenharmony_ci * Get DrawableDescriptor for the foreground. 13961847f8eSopenharmony_ci * 14061847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of foreground. 14161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 14261847f8eSopenharmony_ci * @crossplatform 14361847f8eSopenharmony_ci * @atomicservice 14461847f8eSopenharmony_ci * @since 12 14561847f8eSopenharmony_ci */ 14661847f8eSopenharmony_ci getForeground(): DrawableDescriptor; 14761847f8eSopenharmony_ci 14861847f8eSopenharmony_ci /** 14961847f8eSopenharmony_ci * Get DrawableDescriptor for the background. 15061847f8eSopenharmony_ci * 15161847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of background. 15261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 15361847f8eSopenharmony_ci * @since 10 15461847f8eSopenharmony_ci */ 15561847f8eSopenharmony_ci /** 15661847f8eSopenharmony_ci * Get DrawableDescriptor for the background. 15761847f8eSopenharmony_ci * 15861847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of background. 15961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 16061847f8eSopenharmony_ci * @atomicservice 16161847f8eSopenharmony_ci * @since 11 16261847f8eSopenharmony_ci */ 16361847f8eSopenharmony_ci /** 16461847f8eSopenharmony_ci * Get DrawableDescriptor for the background. 16561847f8eSopenharmony_ci * 16661847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of background. 16761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 16861847f8eSopenharmony_ci * @crossplatform 16961847f8eSopenharmony_ci * @atomicservice 17061847f8eSopenharmony_ci * @since 12 17161847f8eSopenharmony_ci */ 17261847f8eSopenharmony_ci getBackground(): DrawableDescriptor; 17361847f8eSopenharmony_ci 17461847f8eSopenharmony_ci /** 17561847f8eSopenharmony_ci * Get DrawableDescriptor for the mask. 17661847f8eSopenharmony_ci * 17761847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of mask. 17861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 17961847f8eSopenharmony_ci * @since 10 18061847f8eSopenharmony_ci */ 18161847f8eSopenharmony_ci /** 18261847f8eSopenharmony_ci * Get DrawableDescriptor for the mask. 18361847f8eSopenharmony_ci * 18461847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of mask. 18561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 18661847f8eSopenharmony_ci * @atomicservice 18761847f8eSopenharmony_ci * @since 11 18861847f8eSopenharmony_ci */ 18961847f8eSopenharmony_ci /** 19061847f8eSopenharmony_ci * Get DrawableDescriptor for the mask. 19161847f8eSopenharmony_ci * 19261847f8eSopenharmony_ci * @returns { DrawableDescriptor } Return the DrawableDescriptor object of mask. 19361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 19461847f8eSopenharmony_ci * @crossplatform 19561847f8eSopenharmony_ci * @atomicservice 19661847f8eSopenharmony_ci * @since 12 19761847f8eSopenharmony_ci */ 19861847f8eSopenharmony_ci getMask(): DrawableDescriptor; 19961847f8eSopenharmony_ci 20061847f8eSopenharmony_ci 20161847f8eSopenharmony_ci /** 20261847f8eSopenharmony_ci * Get the clip path info of the adaptive icon mask. 20361847f8eSopenharmony_ci * 20461847f8eSopenharmony_ci * @returns { string } Return the clip path info of mask. 20561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 20661847f8eSopenharmony_ci * @since 10 20761847f8eSopenharmony_ci */ 20861847f8eSopenharmony_ci /** 20961847f8eSopenharmony_ci * Get the clip path info of the adaptive icon mask. 21061847f8eSopenharmony_ci * 21161847f8eSopenharmony_ci * @returns { string } Return the clip path info of mask. 21261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 21361847f8eSopenharmony_ci * @atomicservice 21461847f8eSopenharmony_ci * @since 11 21561847f8eSopenharmony_ci */ 21661847f8eSopenharmony_ci /** 21761847f8eSopenharmony_ci * Get the clip path info of the adaptive icon mask. 21861847f8eSopenharmony_ci * 21961847f8eSopenharmony_ci * @returns { string } Return the clip path info of mask. 22061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 22161847f8eSopenharmony_ci * @crossplatform 22261847f8eSopenharmony_ci * @atomicservice 22361847f8eSopenharmony_ci * @since 12 22461847f8eSopenharmony_ci */ 22561847f8eSopenharmony_ci static getMaskClipPath(): string; 22661847f8eSopenharmony_ci} 22761847f8eSopenharmony_ci 22861847f8eSopenharmony_ci/** 22961847f8eSopenharmony_ci * Use the PixelMapDrawableDescriptor class to get the resource of pixelmap or resource descriptor information. 23061847f8eSopenharmony_ci * 23161847f8eSopenharmony_ci * @extends DrawableDescriptor 23261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 23361847f8eSopenharmony_ci * @atomicservice 23461847f8eSopenharmony_ci * @since 12 23561847f8eSopenharmony_ci */ 23661847f8eSopenharmony_ciexport class PixelMapDrawableDescriptor extends DrawableDescriptor { 23761847f8eSopenharmony_ci /** 23861847f8eSopenharmony_ci * Creates a new PixelMapDrawableDescriptor. 23961847f8eSopenharmony_ci * @param { image.PixelMap } src - Indicates the resource to create PixelMapDrawableDescriptor. 24061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 24161847f8eSopenharmony_ci * @atomicservice 24261847f8eSopenharmony_ci * @since 12 24361847f8eSopenharmony_ci */ 24461847f8eSopenharmony_ci constructor(src?: image.PixelMap); 24561847f8eSopenharmony_ci} 24661847f8eSopenharmony_ci 24761847f8eSopenharmony_ci/** 24861847f8eSopenharmony_ci * Animation control options 24961847f8eSopenharmony_ci * 25061847f8eSopenharmony_ci * @interface AnimationOptions 25161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 25261847f8eSopenharmony_ci * @crossplatform 25361847f8eSopenharmony_ci * @atomicservice 25461847f8eSopenharmony_ci * @since 12 25561847f8eSopenharmony_ci */ 25661847f8eSopenharmony_cideclare interface AnimationOptions { 25761847f8eSopenharmony_ci /** 25861847f8eSopenharmony_ci * The duration of animation playback once. 25961847f8eSopenharmony_ci * 26061847f8eSopenharmony_ci * @type { ?number } 26161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 26261847f8eSopenharmony_ci * @crossplatform 26361847f8eSopenharmony_ci * @atomicservice 26461847f8eSopenharmony_ci * @since 12 26561847f8eSopenharmony_ci */ 26661847f8eSopenharmony_ci duration?: number; 26761847f8eSopenharmony_ci /** 26861847f8eSopenharmony_ci * Animation playback times. 26961847f8eSopenharmony_ci * 27061847f8eSopenharmony_ci * @type { ?number } 27161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 27261847f8eSopenharmony_ci * @crossplatform 27361847f8eSopenharmony_ci * @atomicservice 27461847f8eSopenharmony_ci * @since 12 27561847f8eSopenharmony_ci */ 27661847f8eSopenharmony_ci iterations?: number; 27761847f8eSopenharmony_ci} 27861847f8eSopenharmony_ci 27961847f8eSopenharmony_ci/** 28061847f8eSopenharmony_ci * Define the data structure for PixelMap animations. 28161847f8eSopenharmony_ci * 28261847f8eSopenharmony_ci * @extends DrawableDescriptor 28361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 28461847f8eSopenharmony_ci * @crossplatform 28561847f8eSopenharmony_ci * @atomicservice 28661847f8eSopenharmony_ci * @since 12 28761847f8eSopenharmony_ci */ 28861847f8eSopenharmony_ciexport class AnimatedDrawableDescriptor extends DrawableDescriptor { 28961847f8eSopenharmony_ci /** 29061847f8eSopenharmony_ci * Creates a new AnimatedDrawableDescriptor. 29161847f8eSopenharmony_ci * 29261847f8eSopenharmony_ci * @param { Array<image.PixelMap> } pixelMaps - PixelMap List. 29361847f8eSopenharmony_ci * @param { AnimationOptions } [options] - Animation control options. 29461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 29561847f8eSopenharmony_ci * @crossplatform 29661847f8eSopenharmony_ci * @atomicservice 29761847f8eSopenharmony_ci * @since 12 29861847f8eSopenharmony_ci */ 29961847f8eSopenharmony_ci constructor(pixelMaps: Array<image.PixelMap>, options?: AnimationOptions); 30061847f8eSopenharmony_ci} 301