17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci/** 177777dab0Sopenharmony_ci * @addtogroup ArkUI_NativeModule 187777dab0Sopenharmony_ci * @{ 197777dab0Sopenharmony_ci * 207777dab0Sopenharmony_ci * @brief Provides UI capabilities of ArkUI on the native side, such as UI component creation and destruction, 217777dab0Sopenharmony_ci * tree node operations, attribute setting, and event listening. 227777dab0Sopenharmony_ci * 237777dab0Sopenharmony_ci * @since 12 247777dab0Sopenharmony_ci */ 257777dab0Sopenharmony_ci 267777dab0Sopenharmony_ci/** 277777dab0Sopenharmony_ci * @file drawable_descriptor.h 287777dab0Sopenharmony_ci * 297777dab0Sopenharmony_ci * @brief Defines theNativeDrawableDescriptor for the native module. 307777dab0Sopenharmony_ci * 317777dab0Sopenharmony_ci * @library libace_ndk.z.so 327777dab0Sopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 337777dab0Sopenharmony_ci * @kit ArkUI 347777dab0Sopenharmony_ci * @since 12 357777dab0Sopenharmony_ci */ 367777dab0Sopenharmony_ci 377777dab0Sopenharmony_ci#ifndef ARKUI_NATIVE_DRAWABLE_DESCRIPTOR_H 387777dab0Sopenharmony_ci#define ARKUI_NATIVE_DRAWABLE_DESCRIPTOR_H 397777dab0Sopenharmony_ci 407777dab0Sopenharmony_ci#include <stdint.h> 417777dab0Sopenharmony_ci 427777dab0Sopenharmony_ci#ifdef __cplusplus 437777dab0Sopenharmony_ciextern "C" { 447777dab0Sopenharmony_ci#endif 457777dab0Sopenharmony_ci 467777dab0Sopenharmony_ci/** 477777dab0Sopenharmony_ci * @brief Defines the drawable descriptor. 487777dab0Sopenharmony_ci * 497777dab0Sopenharmony_ci * @since 12 507777dab0Sopenharmony_ci */ 517777dab0Sopenharmony_citypedef struct ArkUI_DrawableDescriptor ArkUI_DrawableDescriptor; 527777dab0Sopenharmony_ci 537777dab0Sopenharmony_ci/** 547777dab0Sopenharmony_ci * @brief Introduces the native pixel map information defined by Image Kit. 557777dab0Sopenharmony_ci * 567777dab0Sopenharmony_ci * @since 12 577777dab0Sopenharmony_ci */ 587777dab0Sopenharmony_cistruct OH_PixelmapNative; 597777dab0Sopenharmony_ci 607777dab0Sopenharmony_ci/** 617777dab0Sopenharmony_ci * @brief Defines the pointer to OH_PixelmapNative. 627777dab0Sopenharmony_ci * 637777dab0Sopenharmony_ci * @since 12 647777dab0Sopenharmony_ci */ 657777dab0Sopenharmony_citypedef struct OH_PixelmapNative* OH_PixelmapNativeHandle; 667777dab0Sopenharmony_ci 677777dab0Sopenharmony_ci/** 687777dab0Sopenharmony_ci * @brief Creates a DrawableDescriptor from a Pixelmap. 697777dab0Sopenharmony_ci * 707777dab0Sopenharmony_ci * @param pixelMap Indicates the pointer to a Pixelmap 717777dab0Sopenharmony_ci * @return Returns the pointer to the drawableDescriptor. 727777dab0Sopenharmony_ci * @since 12 737777dab0Sopenharmony_ci*/ 747777dab0Sopenharmony_ciArkUI_DrawableDescriptor* OH_ArkUI_DrawableDescriptor_CreateFromPixelMap(OH_PixelmapNativeHandle pixelMap); 757777dab0Sopenharmony_ci 767777dab0Sopenharmony_ci/** 777777dab0Sopenharmony_ci * @brief Creates a DrawableDescriptor from a Pixelmap array. 787777dab0Sopenharmony_ci * 797777dab0Sopenharmony_ci * @param array Indicates the pointer to a Pixelmap array. 807777dab0Sopenharmony_ci * @param size Indicates the size of the Pixelmap array. 817777dab0Sopenharmony_ci * @return Returns the pointer to the drawableDescriptor. 827777dab0Sopenharmony_ci * @since 12 837777dab0Sopenharmony_ci*/ 847777dab0Sopenharmony_ciArkUI_DrawableDescriptor* OH_ArkUI_DrawableDescriptor_CreateFromAnimatedPixelMap( 857777dab0Sopenharmony_ci OH_PixelmapNativeHandle* array, int32_t size); 867777dab0Sopenharmony_ci 877777dab0Sopenharmony_ci/** 887777dab0Sopenharmony_ci * @brief Destroys the pointer to the drawableDescriptor. 897777dab0Sopenharmony_ci * 907777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 917777dab0Sopenharmony_ci * @since 12 927777dab0Sopenharmony_ci*/ 937777dab0Sopenharmony_civoid OH_ArkUI_DrawableDescriptor_Dispose(ArkUI_DrawableDescriptor* drawableDescriptor); 947777dab0Sopenharmony_ci 957777dab0Sopenharmony_ci/** 967777dab0Sopenharmony_ci * @brief Obtains the Pixelmap object. 977777dab0Sopenharmony_ci * 987777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 997777dab0Sopenharmony_ci * @return Returns the pointer to the PixelMap. 1007777dab0Sopenharmony_ci * @since 12 1017777dab0Sopenharmony_ci*/ 1027777dab0Sopenharmony_ciOH_PixelmapNativeHandle OH_ArkUI_DrawableDescriptor_GetStaticPixelMap(ArkUI_DrawableDescriptor* drawableDescriptor); 1037777dab0Sopenharmony_ci 1047777dab0Sopenharmony_ci/** 1057777dab0Sopenharmony_ci * @brief Obtains the Pixelmap array used to play the animation. 1067777dab0Sopenharmony_ci * 1077777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 1087777dab0Sopenharmony_ci * @return Returns the pointer to the PixelMap array. 1097777dab0Sopenharmony_ci * @since 12 1107777dab0Sopenharmony_ci*/ 1117777dab0Sopenharmony_ciOH_PixelmapNativeHandle* OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArray( 1127777dab0Sopenharmony_ci ArkUI_DrawableDescriptor* drawableDescriptor); 1137777dab0Sopenharmony_ci 1147777dab0Sopenharmony_ci/** 1157777dab0Sopenharmony_ci * @brief Obtains the size of the Pixelmap array used to play the animation. 1167777dab0Sopenharmony_ci * 1177777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 1187777dab0Sopenharmony_ci * @return Returns the size of the Pixelmap array. 1197777dab0Sopenharmony_ci * @since 12 1207777dab0Sopenharmony_ci*/ 1217777dab0Sopenharmony_ciint32_t OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArraySize(ArkUI_DrawableDescriptor* drawableDescriptor); 1227777dab0Sopenharmony_ci 1237777dab0Sopenharmony_ci/** 1247777dab0Sopenharmony_ci * @brief Sets the total playback duration. 1257777dab0Sopenharmony_ci * 1267777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 1277777dab0Sopenharmony_ci * @param duration Indicates the total playback duration. The unit is millisecond. 1287777dab0Sopenharmony_ci * @since 12 1297777dab0Sopenharmony_ci*/ 1307777dab0Sopenharmony_civoid OH_ArkUI_DrawableDescriptor_SetAnimationDuration(ArkUI_DrawableDescriptor* drawableDescriptor, int32_t duration); 1317777dab0Sopenharmony_ci 1327777dab0Sopenharmony_ci/** 1337777dab0Sopenharmony_ci * @brief Obtains the total playback duration. 1347777dab0Sopenharmony_ci * 1357777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 1367777dab0Sopenharmony_ci * @return Return the total playback duration. The unit is millisecond. 1377777dab0Sopenharmony_ci * @since 12 1387777dab0Sopenharmony_ci*/ 1397777dab0Sopenharmony_ciint32_t OH_ArkUI_DrawableDescriptor_GetAnimationDuration(ArkUI_DrawableDescriptor* drawableDescriptor); 1407777dab0Sopenharmony_ci 1417777dab0Sopenharmony_ci/** 1427777dab0Sopenharmony_ci * @brief Sets the number of playback times. 1437777dab0Sopenharmony_ci * 1447777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 1457777dab0Sopenharmony_ci * @param iterations Indicates the number of playback times. 1467777dab0Sopenharmony_ci * @since 12 1477777dab0Sopenharmony_ci*/ 1487777dab0Sopenharmony_civoid OH_ArkUI_DrawableDescriptor_SetAnimationIteration( 1497777dab0Sopenharmony_ci ArkUI_DrawableDescriptor* drawableDescriptor, int32_t iteration); 1507777dab0Sopenharmony_ci 1517777dab0Sopenharmony_ci/** 1527777dab0Sopenharmony_ci * @brief Obtains the number of playback times. 1537777dab0Sopenharmony_ci * 1547777dab0Sopenharmony_ci * @param drawableDescriptor Indicates the pointer to the drawableDescriptor. 1557777dab0Sopenharmony_ci * @return Returns the number of playback times. 1567777dab0Sopenharmony_ci * @since 12 1577777dab0Sopenharmony_ci*/ 1587777dab0Sopenharmony_ciint32_t OH_ArkUI_DrawableDescriptor_GetAnimationIteration(ArkUI_DrawableDescriptor* drawableDescriptor); 1597777dab0Sopenharmony_ci#ifdef __cplusplus 1607777dab0Sopenharmony_ci}; 1617777dab0Sopenharmony_ci#endif 1627777dab0Sopenharmony_ci 1637777dab0Sopenharmony_ci#endif // ARKUI_NATIVE_DRAWABLE_DESCRIPTOR_H 1647777dab0Sopenharmony_ci/** @} */ 165