Skip to main content

arkui_sys/drawable_descriptor/
drawable_descriptor_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6use crate::native_type::*;
7pub use ohos_sys_opaque_types::OH_PixelmapNative;
8
9/// Defines the drawable descriptor.
10///
11///
12/// Available since API-level: 12
13#[cfg(feature = "api-12")]
14#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
15#[repr(C)]
16pub struct ArkUI_DrawableDescriptor {
17    _unused: [u8; 0],
18}
19/// Defines the pointer to OH_PixelmapNative.
20///
21///
22/// Available since API-level: 12
23#[cfg(feature = "api-12")]
24#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
25pub type OH_PixelmapNativeHandle = *mut OH_PixelmapNative;
26/// Defines the animation controller of arkui drawable descriptor.
27///
28///
29/// Available since API-level: 22
30#[cfg(feature = "api-22")]
31#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
32#[repr(C)]
33pub struct ArkUI_DrawableDescriptor_AnimationController {
34    _unused: [u8; 0],
35}
36#[cfg(feature = "api-22")]
37#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
38impl DrawableDescriptor_AnimationStatus {
39    /// animation is initial.
40    pub const DRAWABLE_DESCRIPTOR_ANIMATION_STATUS_INITIAL: DrawableDescriptor_AnimationStatus =
41        DrawableDescriptor_AnimationStatus(0);
42    /// animation is playing.
43    pub const DRAWABLE_DESCRIPTOR_ANIMATION_STATUS_RUNNING: DrawableDescriptor_AnimationStatus =
44        DrawableDescriptor_AnimationStatus(1);
45    /// animation is paused.
46    pub const DRAWABLE_DESCRIPTOR_ANIMATION_STATUS_PAUSED: DrawableDescriptor_AnimationStatus =
47        DrawableDescriptor_AnimationStatus(2);
48    /// animation is stopped.
49    pub const DRAWABLE_DESCRIPTOR_ANIMATION_STATUS_STOPPED: DrawableDescriptor_AnimationStatus =
50        DrawableDescriptor_AnimationStatus(3);
51}
52#[repr(transparent)]
53/// Defines the animation status of the drawable descriptor.
54///
55///
56/// Available since API-level: 22
57#[cfg(feature = "api-22")]
58#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
59#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
60pub struct DrawableDescriptor_AnimationStatus(pub ::core::ffi::c_uint);
61extern "C" {
62    /// Creates a DrawableDescriptor from a Pixelmap.
63    ///
64    /// # Arguments
65    ///
66    /// * `pixelMap` - Indicates the pointer to a Pixelmap
67    ///
68    /// # Returns
69    ///
70    /// * Returns the pointer to the drawableDescriptor.
71    ///
72    /// Available since API-level: 12
73    #[cfg(feature = "api-12")]
74    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
75    pub fn OH_ArkUI_DrawableDescriptor_CreateFromPixelMap(
76        pixelMap: OH_PixelmapNativeHandle,
77    ) -> *mut ArkUI_DrawableDescriptor;
78    /// Creates a DrawableDescriptor from a Pixelmap array.
79    ///
80    /// # Arguments
81    ///
82    /// * `array` - Indicates the pointer to a Pixelmap array.
83    ///
84    /// * `size` - Indicates the size of the Pixelmap array.
85    ///
86    /// # Returns
87    ///
88    /// * Returns the pointer to the drawableDescriptor.
89    ///
90    /// Available since API-level: 12
91    #[cfg(feature = "api-12")]
92    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
93    pub fn OH_ArkUI_DrawableDescriptor_CreateFromAnimatedPixelMap(
94        array: *mut OH_PixelmapNativeHandle,
95        size: i32,
96    ) -> *mut ArkUI_DrawableDescriptor;
97    /// Destroys the pointer to the drawableDescriptor.
98    ///
99    /// # Arguments
100    ///
101    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
102    ///
103    /// Available since API-level: 12
104    #[cfg(feature = "api-12")]
105    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
106    pub fn OH_ArkUI_DrawableDescriptor_Dispose(drawableDescriptor: *mut ArkUI_DrawableDescriptor);
107    /// Obtains the Pixelmap object.
108    ///
109    /// # Arguments
110    ///
111    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
112    ///
113    /// # Returns
114    ///
115    /// * Returns the pointer to the PixelMap.
116    ///
117    /// Available since API-level: 12
118    #[cfg(feature = "api-12")]
119    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
120    pub fn OH_ArkUI_DrawableDescriptor_GetStaticPixelMap(
121        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
122    ) -> OH_PixelmapNativeHandle;
123    /// Obtains the Pixelmap array used to play the animation.
124    ///
125    /// # Arguments
126    ///
127    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
128    ///
129    /// # Returns
130    ///
131    /// * Returns the pointer to the PixelMap array.
132    ///
133    /// Available since API-level: 12
134    #[cfg(feature = "api-12")]
135    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
136    pub fn OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArray(
137        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
138    ) -> *mut OH_PixelmapNativeHandle;
139    /// Obtains the size of the Pixelmap array used to play the animation.
140    ///
141    /// # Arguments
142    ///
143    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
144    ///
145    /// # Returns
146    ///
147    /// * Returns the size of the Pixelmap array.
148    ///
149    /// Available since API-level: 12
150    #[cfg(feature = "api-12")]
151    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
152    pub fn OH_ArkUI_DrawableDescriptor_GetAnimatedPixelMapArraySize(
153        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
154    ) -> i32;
155    /// Sets the total playback duration.
156    ///
157    /// # Arguments
158    ///
159    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
160    ///
161    /// * `duration` - Indicates the total playback duration. The unit is millisecond.
162    ///
163    /// Available since API-level: 12
164    #[cfg(feature = "api-12")]
165    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
166    pub fn OH_ArkUI_DrawableDescriptor_SetAnimationDuration(
167        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
168        duration: i32,
169    );
170    /// Obtains the total playback duration.
171    ///
172    /// # Arguments
173    ///
174    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
175    ///
176    /// # Returns
177    ///
178    /// * Return the total playback duration. The unit is millisecond.
179    ///
180    /// Available since API-level: 12
181    #[cfg(feature = "api-12")]
182    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
183    pub fn OH_ArkUI_DrawableDescriptor_GetAnimationDuration(
184        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
185    ) -> i32;
186    /// Sets the number of playback times.
187    ///
188    /// # Arguments
189    ///
190    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
191    ///
192    /// * `iteration` - Indicates the number of playback times.
193    ///
194    /// Available since API-level: 12
195    #[cfg(feature = "api-12")]
196    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
197    pub fn OH_ArkUI_DrawableDescriptor_SetAnimationIteration(
198        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
199        iteration: i32,
200    );
201    /// Obtains the number of playback times.
202    ///
203    /// # Arguments
204    ///
205    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
206    ///
207    /// # Returns
208    ///
209    /// * Returns the number of playback times.
210    ///
211    /// Available since API-level: 12
212    #[cfg(feature = "api-12")]
213    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
214    pub fn OH_ArkUI_DrawableDescriptor_GetAnimationIteration(
215        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
216    ) -> i32;
217    /// Sets the frame duration array.
218    ///
219    /// # Arguments
220    ///
221    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
222    ///
223    /// * `durations` - Indicates the pointer to the frame duration array.
224    ///
225    /// * `size` - Indicates the size of the frame duration array.
226    ///
227    /// # Returns
228    ///
229    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
230    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
231    ///
232    /// Available since API-level: 22
233    #[cfg(feature = "api-22")]
234    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
235    pub fn OH_ArkUI_DrawableDescriptor_SetAnimationFrameDurations(
236        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
237        durations: *mut u32,
238        size: usize,
239    ) -> i32;
240    /// Obtains the frame duration array.
241    ///
242    /// # Arguments
243    ///
244    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
245    ///
246    /// * `durations` - Indicates the pointer to the frame duration array.
247    ///
248    /// * `size` - Indicates the size of the frame duration array.
249    ///
250    /// # Returns
251    ///
252    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
253    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
254    ///
255    /// Available since API-level: 22
256    #[cfg(feature = "api-22")]
257    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
258    pub fn OH_ArkUI_DrawableDescriptor_GetAnimationFrameDurations(
259        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
260        durations: *mut u32,
261        size: *mut usize,
262    ) -> i32;
263    /// Sets whether to play the animation automatically.
264    ///
265    /// # Arguments
266    ///
267    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
268    ///
269    /// * `autoPlay` - Indicates whether to play the animation automatically.
270    /// default value is 1, which means to play the animation automatically.
271    /// value 0 means not to play the animation automatically.
272    ///
273    /// # Returns
274    ///
275    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
276    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
277    ///
278    /// Available since API-level: 22
279    #[cfg(feature = "api-22")]
280    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
281    pub fn OH_ArkUI_DrawableDescriptor_SetAnimationAutoPlay(
282        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
283        autoPlay: u32,
284    ) -> i32;
285    /// Obtains whether to play the animation automatically.
286    ///
287    /// # Arguments
288    ///
289    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
290    ///
291    /// * `autoPlay` - Indicates whether to play the animation automatically.
292    ///
293    /// # Returns
294    ///
295    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
296    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
297    ///
298    /// Available since API-level: 22
299    #[cfg(feature = "api-22")]
300    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
301    pub fn OH_ArkUI_DrawableDescriptor_GetAnimationAutoPlay(
302        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
303        autoPlay: *mut u32,
304    ) -> i32;
305    /// Obtains the animation controller.
306    ///
307    /// # Arguments
308    ///
309    /// * `drawableDescriptor` - Indicates the pointer to the drawableDescriptor.
310    ///
311    /// * `node` - Indicates the node handle.
312    ///
313    /// * `controller` - Indicates the pointer to the animation controller.
314    ///
315    /// # Returns
316    ///
317    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
318    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
319    ///
320    /// Available since API-level: 22
321    #[cfg(feature = "api-22")]
322    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
323    pub fn OH_ArkUI_DrawableDescriptor_CreateAnimationController(
324        drawableDescriptor: *mut ArkUI_DrawableDescriptor,
325        node: ArkUI_NodeHandle,
326        controller: *mut *mut ArkUI_DrawableDescriptor_AnimationController,
327    ) -> i32;
328    /// Releases the animation controller.
329    ///
330    /// # Arguments
331    ///
332    /// * `controller` - Indicates the pointer to the animation controller.
333    ///
334    /// Available since API-level: 22
335    #[cfg(feature = "api-22")]
336    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
337    pub fn OH_ArkUI_DrawableDescriptor_DisposeAnimationController(
338        controller: *mut ArkUI_DrawableDescriptor_AnimationController,
339    );
340    /// Starts the animation from first frame.
341    ///
342    /// # Arguments
343    ///
344    /// * `controller` - Indicates the pointer to the animation controller.
345    ///
346    /// # Returns
347    ///
348    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
349    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
350    ///
351    /// Available since API-level: 22
352    #[cfg(feature = "api-22")]
353    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
354    pub fn OH_ArkUI_DrawableDescriptor_StartAnimation(
355        controller: *mut ArkUI_DrawableDescriptor_AnimationController,
356    ) -> i32;
357    /// Stops the animation and back to first frame.
358    ///
359    /// # Arguments
360    ///
361    /// * `controller` - Indicates the pointer to the animation controller.
362    ///
363    /// # Returns
364    ///
365    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
366    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
367    ///
368    /// Available since API-level: 22
369    #[cfg(feature = "api-22")]
370    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
371    pub fn OH_ArkUI_DrawableDescriptor_StopAnimation(
372        controller: *mut ArkUI_DrawableDescriptor_AnimationController,
373    ) -> i32;
374    /// Resumes the animation at the current frame.
375    ///
376    /// # Arguments
377    ///
378    /// * `controller` - Indicates the pointer to the animation controller.
379    ///
380    /// # Returns
381    ///
382    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
383    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
384    ///
385    /// Available since API-level: 22
386    #[cfg(feature = "api-22")]
387    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
388    pub fn OH_ArkUI_DrawableDescriptor_ResumeAnimation(
389        controller: *mut ArkUI_DrawableDescriptor_AnimationController,
390    ) -> i32;
391    /// Pauses the animation at the current frame.
392    ///
393    /// # Arguments
394    ///
395    /// * `controller` - Indicates the pointer to the animation controller.
396    ///
397    /// # Returns
398    ///
399    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
400    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
401    ///
402    /// Available since API-level: 22
403    #[cfg(feature = "api-22")]
404    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
405    pub fn OH_ArkUI_DrawableDescriptor_PauseAnimation(
406        controller: *mut ArkUI_DrawableDescriptor_AnimationController,
407    ) -> i32;
408    /// Obtains the animation playback status.
409    ///
410    /// # Arguments
411    ///
412    /// * `controller` - Indicates the pointer to the animation controller.
413    ///
414    /// * `status` - Indicates the pointer to the animation playback status.
415    ///
416    /// # Returns
417    ///
418    /// * Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful;
419    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
420    ///
421    /// Available since API-level: 22
422    #[cfg(feature = "api-22")]
423    #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
424    pub fn OH_ArkUI_DrawableDescriptor_GetAnimationStatus(
425        controller: *mut ArkUI_DrawableDescriptor_AnimationController,
426        status: *mut DrawableDescriptor_AnimationStatus,
427    ) -> i32;
428}