arkui_sys/drag_and_drop/drag_and_drop_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#[cfg(feature = "api-15")]
9use ohos_sys_opaque_types::OH_UdmfGetDataParams;
10
11#[cfg(feature = "api-12")]
12#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
13impl ArkUI_DragResult {
14 /// The drag and drop operation succeeded.
15 pub const SUCCESSFUL: ArkUI_DragResult = ArkUI_DragResult(0);
16 /// The drag and drop operation failed.
17 pub const FAILED: ArkUI_DragResult = ArkUI_DragResult(1);
18 /// The drag and drop operation was canceled.
19 pub const CANCELED: ArkUI_DragResult = ArkUI_DragResult(2);
20}
21#[repr(transparent)]
22/// Defines an enum for drag results, which are set by the data receiver and transferred by the system to the
23/// drag source so that the drag source is aware of the data processing result of the receiver.
24///
25///
26/// Available since API-level: 12
27#[cfg(feature = "api-12")]
28#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
29#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
30pub struct ArkUI_DragResult(pub ::core::ffi::c_uint);
31#[cfg(feature = "api-12")]
32#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
33impl ArkUI_DropOperation {
34 /// Copy.
35 pub const ARKUI_DROP_OPERATION_COPY: ArkUI_DropOperation = ArkUI_DropOperation(0);
36 /// Cut.
37 pub const ARKUI_DROP_OPERATION_MOVE: ArkUI_DropOperation = ArkUI_DropOperation(1);
38}
39#[repr(transparent)]
40/// Defines an enum for data processing modes used when data is dropped, which affects the display of the badge.
41///
42///
43/// Available since API-level: 12
44#[cfg(feature = "api-12")]
45#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
46#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
47pub struct ArkUI_DropOperation(pub ::core::ffi::c_uint);
48#[cfg(feature = "api-12")]
49#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
50impl ArkUI_PreDragStatus {
51 /// Unknown.
52 pub const ARKUI_PRE_DRAG_STATUS_UNKNOWN: ArkUI_PreDragStatus = ArkUI_PreDragStatus(-1);
53 /// A drag gesture is being detected.
54 pub const ARKUI_PRE_DRAG_STATUS_ACTION_DETECTING: ArkUI_PreDragStatus = ArkUI_PreDragStatus(0);
55 /// The component is ready to be dragged.
56 pub const ARKUI_PRE_DRAG_STATUS_READY_TO_TRIGGER_DRAG: ArkUI_PreDragStatus =
57 ArkUI_PreDragStatus(1);
58 /// A lift animation is started.
59 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_STARTED: ArkUI_PreDragStatus =
60 ArkUI_PreDragStatus(2);
61 /// A lift animation is finished.
62 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_FINISHED: ArkUI_PreDragStatus =
63 ArkUI_PreDragStatus(3);
64 /// A drop animation is started.
65 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_STARTED: ArkUI_PreDragStatus =
66 ArkUI_PreDragStatus(4);
67 /// A drop animation is finished.
68 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_FINISHED: ArkUI_PreDragStatus =
69 ArkUI_PreDragStatus(5);
70 /// A drop animation is terminated.
71 pub const ARKUI_PRE_DRAG_STATUS_CANCELED_BEFORE_DRAG: ArkUI_PreDragStatus =
72 ArkUI_PreDragStatus(6);
73}
74#[repr(transparent)]
75/// Defines an enum for interaction states prior to a drop and drop operation.
76///
77///
78/// Available since API-level: 12
79#[cfg(feature = "api-12")]
80#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
81#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
82pub struct ArkUI_PreDragStatus(pub ::core::ffi::c_int);
83#[cfg(feature = "api-12")]
84#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
85impl ArkUI_DragPreviewScaleMode {
86 /// The system automatically changes the position of the dragged point based on the scenario and
87 /// scales the drag preview based on set rules.
88 pub const ARKUI_DRAG_PREVIEW_SCALE_AUTO: ArkUI_DragPreviewScaleMode =
89 ArkUI_DragPreviewScaleMode(0);
90 /// The system does not scale the drag preview.
91 pub const ARKUI_DRAG_PREVIEW_SCALE_DISABLED: ArkUI_DragPreviewScaleMode =
92 ArkUI_DragPreviewScaleMode(1);
93}
94#[repr(transparent)]
95/// Defines an enum for drag preview scale modes.
96///
97///
98/// Available since API-level: 12
99#[cfg(feature = "api-12")]
100#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
101#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
102pub struct ArkUI_DragPreviewScaleMode(pub ::core::ffi::c_uint);
103#[cfg(feature = "api-12")]
104#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
105impl ArkUI_DragStatus {
106 /// Unknown.
107 pub const ARKUI_DRAG_STATUS_UNKNOWN: ArkUI_DragStatus = ArkUI_DragStatus(-1);
108 /// Started.
109 pub const ARKUI_DRAG_STATUS_STARTED: ArkUI_DragStatus = ArkUI_DragStatus(0);
110 /// Ended.
111 pub const ARKUI_DRAG_STATUS_ENDED: ArkUI_DragStatus = ArkUI_DragStatus(1);
112}
113#[repr(transparent)]
114/// Defines an enum for drag states.
115///
116///
117/// Available since API-level: 12
118#[cfg(feature = "api-12")]
119#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
120#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
121pub struct ArkUI_DragStatus(pub ::core::ffi::c_int);
122/// Defines a struct for a component event.
123///
124///
125/// Available since API-level: 12
126#[cfg(feature = "api-12")]
127#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
128#[repr(C)]
129pub struct ArkUI_NodeEvent {
130 _unused: [u8; 0],
131}
132/// Defines a struct for a drag event.
133///
134///
135/// Available since API-level: 12
136#[cfg(feature = "api-12")]
137#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
138#[repr(C)]
139pub struct ArkUI_DragEvent {
140 _unused: [u8; 0],
141}
142/// Defines a struct for custom drag preview options.
143///
144///
145/// Available since API-level: 12
146#[cfg(feature = "api-12")]
147#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
148#[repr(C)]
149pub struct ArkUI_DragPreviewOption {
150 _unused: [u8; 0],
151}
152/// Defines a struct for a drag action.
153///
154///
155/// Available since API-level: 12
156#[cfg(feature = "api-12")]
157#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
158#[repr(C)]
159pub struct ArkUI_DragAction {
160 _unused: [u8; 0],
161}
162/// Defines a struct for drag and drop information returned through a drag status listener.
163///
164///
165/// Available since API-level: 12
166#[cfg(feature = "api-12")]
167#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
168#[repr(C)]
169pub struct ArkUI_DragAndDropInfo {
170 _unused: [u8; 0],
171}
172extern "C" {
173 /// Obtains a <b>ArkUI_DragEvent</b> object from the specified <b>ArkUI_NodeEvent</b> object.
174 ///
175 /// # Arguments
176 ///
177 /// * `nodeEvent` - Indicates the pointer to an <b>ArkUI_NodeEvent</b> object.
178 ///
179 /// # Returns
180 ///
181 /// * Returns the pointer to an <b>ArkUI_DragEvent</b> object.
182 /// Returns <b>null</b> if the parameter passed in is invalid or is not a drag-related event.
183 ///
184 /// Available since API-level: 12
185 #[cfg(feature = "api-12")]
186 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
187 pub fn OH_ArkUI_NodeEvent_GetDragEvent(nodeEvent: *mut ArkUI_NodeEvent)
188 -> *mut ArkUI_DragEvent;
189 /// Obtains the interaction state prior to a drop and drop operation.
190 ///
191 /// # Arguments
192 ///
193 /// * `nodeEvent` - Indicates the pointer to an <b>ArkUI_NodeEvent</b> object.
194 ///
195 /// # Returns
196 ///
197 /// * Returns the interaction state prior to the drop and drop operation.
198 ///
199 /// Available since API-level: 12
200 #[cfg(feature = "api-12")]
201 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
202 pub fn OH_ArkUI_NodeEvent_GetPreDragStatus(
203 nodeEvent: *mut ArkUI_NodeEvent,
204 ) -> ArkUI_PreDragStatus;
205 /// Sets whether to disable the default drop animation.
206 /// The default drop animation is enabled by default and can be disabled to apply a custom drop animation.
207 ///
208 /// # Arguments
209 ///
210 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
211 ///
212 /// * `disable` - Indicates whether to disable the default drop animation.
213 /// The value <b>true</b> means to disable the default drop animation, and <b>false</b> means the opposite.
214 ///
215 /// # Returns
216 ///
217 /// * Returns the result code.
218 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
219 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
220 ///
221 /// Available since API-level: 12
222 #[cfg(feature = "api-12")]
223 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
224 pub fn OH_ArkUI_DragEvent_DisableDefaultDropAnimation(
225 event: *mut ArkUI_DragEvent,
226 disable: bool,
227 ) -> i32;
228 /// Sets the data processing mode.
229 ///
230 /// # Arguments
231 ///
232 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
233 ///
234 /// * `dropOperation` - Indicates the data processing mode.
235 ///
236 /// # Returns
237 ///
238 /// * Returns the result code.
239 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
240 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
241 ///
242 /// Available since API-level: 12
243 #[cfg(feature = "api-12")]
244 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
245 pub fn OH_ArkUI_DragEvent_SetSuggestedDropOperation(
246 event: *mut ArkUI_DragEvent,
247 dropOperation: ArkUI_DropOperation,
248 ) -> i32;
249 /// Sets the result for a drag event.
250 ///
251 /// # Arguments
252 ///
253 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
254 ///
255 /// * `result` - Indicates the drag result.
256 ///
257 /// # Returns
258 ///
259 /// * Returns the result code.
260 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
261 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
262 ///
263 /// Available since API-level: 12
264 #[cfg(feature = "api-12")]
265 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
266 pub fn OH_ArkUI_DragEvent_SetDragResult(
267 event: *mut ArkUI_DragEvent,
268 result: ArkUI_DragResult,
269 ) -> i32;
270 /// Obtains the number of drag data types from a drag event.
271 ///
272 /// # Arguments
273 ///
274 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
275 ///
276 /// * `count` - Indicates the number of drag data types returned.
277 ///
278 /// # Returns
279 ///
280 /// * Returns the result code.
281 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
282 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
283 ///
284 /// Available since API-level: 12
285 #[cfg(feature = "api-12")]
286 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
287 pub fn OH_ArkUI_DragEvent_GetDataTypeCount(event: *mut ArkUI_DragEvent, count: *mut i32)
288 -> i32;
289 /// Obtains the list of drag data types from a drag event.
290 ///
291 /// # Arguments
292 ///
293 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
294 ///
295 /// * `eventTypeArray` - Indicates the list of the drag data types. You need to create a string array first.
296 ///
297 /// * `length` - Indicates the total length of the list array. It must be greater than or equal to the number obtained
298 /// by using [`OH_ArkUI_DragEvent_GetDataTypeCount`].
299 ///
300 /// * `maxStrLen` - Indicates the max string length of drag data types.
301 ///
302 /// # Returns
303 ///
304 /// * Returns the result code.
305 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
306 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
307 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] if the giving buffer is not enough for string copy.
308 ///
309 /// Available since API-level: 12
310 #[cfg(feature = "api-12")]
311 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
312 pub fn OH_ArkUI_DragEvent_GetDataTypes(
313 event: *mut ArkUI_DragEvent,
314 eventTypeArray: *mut *mut ::core::ffi::c_char,
315 length: i32,
316 maxStrLen: i32,
317 ) -> i32;
318 /// Obtains the drag result from a drag event.
319 ///
320 /// # Arguments
321 ///
322 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
323 ///
324 /// * `result` - Indicates the drag result returned.
325 ///
326 /// # Returns
327 ///
328 /// * Returns the result code.
329 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
330 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
331 ///
332 /// Available since API-level: 12
333 #[cfg(feature = "api-12")]
334 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
335 pub fn OH_ArkUI_DragEvent_GetDragResult(
336 event: *mut ArkUI_DragEvent,
337 result: *mut ArkUI_DragResult,
338 ) -> i32;
339 /// Obtains the drop operation from a drag event.
340 ///
341 /// # Arguments
342 ///
343 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
344 ///
345 /// * `operation` - Indicates the drop operation which the data receiver set.
346 ///
347 /// # Returns
348 ///
349 /// * Returns the result code.
350 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
351 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
352 /// Possible causes: 1. The given parameters are null or the given event is not a valid DragEvent.
353 ///
354 /// Available since API-level: 12
355 #[cfg(feature = "api-12")]
356 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
357 pub fn OH_ArkUI_DragEvent_GetDropOperation(
358 event: *mut ArkUI_DragEvent,
359 operation: *mut ArkUI_DropOperation,
360 ) -> i32;
361 /// Obtains the X coordinate of the touch point for a drag preview from a drag event.
362 ///
363 /// # Arguments
364 ///
365 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
366 ///
367 /// # Returns
368 ///
369 /// * Returns the X coordinate of the touch point, in px.
370 /// Returns the default value <b>0</b> if the input parameter is invalid.
371 ///
372 /// Available since API-level: 12
373 #[cfg(feature = "api-12")]
374 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
375 pub fn OH_ArkUI_DragEvent_GetPreviewTouchPointX(event: *mut ArkUI_DragEvent) -> f32;
376 /// Obtains the Y coordinate of the touch point for a drag preview from a drag event.
377 ///
378 /// # Arguments
379 ///
380 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
381 ///
382 /// # Returns
383 ///
384 /// * Returns the Y coordinate of the touch point, in px.
385 /// Returns the default value <b>0</b> if the input parameter is invalid.
386 ///
387 /// Available since API-level: 12
388 #[cfg(feature = "api-12")]
389 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
390 pub fn OH_ArkUI_DragEvent_GetPreviewTouchPointY(event: *mut ArkUI_DragEvent) -> f32;
391 /// Obtains the width of a drag preview from a drag event.
392 ///
393 /// # Arguments
394 ///
395 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
396 ///
397 /// # Returns
398 ///
399 /// * Returns the width of the drag preview, in px.
400 /// Returns the default value <b>0</b> if the input parameter is invalid.
401 ///
402 /// Available since API-level: 12
403 #[cfg(feature = "api-12")]
404 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
405 pub fn OH_ArkUI_DragEvent_GetPreviewRectWidth(event: *mut ArkUI_DragEvent) -> f32;
406 /// Obtains the height of a drag preview from a drag event.
407 ///
408 /// # Arguments
409 ///
410 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
411 ///
412 /// # Returns
413 ///
414 /// * Returns the height of the drag preview, in px.
415 /// Returns the default value <b>0</b> if the input parameter is invalid.
416 ///
417 /// Available since API-level: 12
418 #[cfg(feature = "api-12")]
419 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
420 pub fn OH_ArkUI_DragEvent_GetPreviewRectHeight(event: *mut ArkUI_DragEvent) -> f32;
421 /// Obtains the X coordinate of the touch point relative to the window from a drag event.
422 ///
423 /// # Arguments
424 ///
425 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
426 ///
427 /// # Returns
428 ///
429 /// * Returns the X coordinate of the touch point relative to the window, in px.
430 /// Returns the default value <b>0</b> if the input parameter is invalid.
431 ///
432 /// Available since API-level: 12
433 #[cfg(feature = "api-12")]
434 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
435 pub fn OH_ArkUI_DragEvent_GetTouchPointXToWindow(event: *mut ArkUI_DragEvent) -> f32;
436 /// Obtains the Y coordinate of the touch point relative to the window from a drag event.
437 ///
438 /// # Arguments
439 ///
440 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
441 ///
442 /// # Returns
443 ///
444 /// * Returns the Y coordinate of the touch point relative to the window, in px.
445 /// Returns the default value <b>0</b> if the input parameter is invalid.
446 ///
447 /// Available since API-level: 12
448 #[cfg(feature = "api-12")]
449 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
450 pub fn OH_ArkUI_DragEvent_GetTouchPointYToWindow(event: *mut ArkUI_DragEvent) -> f32;
451 /// Obtains the X coordinate of the touch point relative to the current display from a drag event.
452 ///
453 /// # Arguments
454 ///
455 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
456 ///
457 /// # Returns
458 ///
459 /// * Returns the X coordinate of the touch point relative to the current display, in px.
460 /// Returns the default value <b>0</b> if the input parameter is invalid.
461 ///
462 /// Available since API-level: 12
463 #[cfg(feature = "api-12")]
464 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
465 pub fn OH_ArkUI_DragEvent_GetTouchPointXToDisplay(event: *mut ArkUI_DragEvent) -> f32;
466 /// Obtains the Y coordinate of the touch point relative to the current display from a drag event.
467 ///
468 /// # Arguments
469 ///
470 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
471 ///
472 /// # Returns
473 ///
474 /// * Returns the Y coordinate of the touch point relative to the current display, in px.
475 /// Returns the default value <b>0</b> if the input parameter is invalid.
476 ///
477 /// Available since API-level: 12
478 #[cfg(feature = "api-12")]
479 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
480 pub fn OH_ArkUI_DragEvent_GetTouchPointYToDisplay(event: *mut ArkUI_DragEvent) -> f32;
481 /// Obtains the dragging velocity along the x-axis.
482 ///
483 /// # Arguments
484 ///
485 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
486 ///
487 /// # Returns
488 ///
489 /// * Returns the dragging velocity along the x-axis, in px.
490 /// Returns the default value <b>0</b> if the input parameter is invalid.
491 ///
492 /// Available since API-level: 12
493 #[cfg(feature = "api-12")]
494 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
495 pub fn OH_ArkUI_DragEvent_GetVelocityX(event: *mut ArkUI_DragEvent) -> f32;
496 /// Obtains the dragging velocity along the y-axis.
497 ///
498 /// # Arguments
499 ///
500 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
501 ///
502 /// # Returns
503 ///
504 /// * Returns the dragging velocity along the y-axis, in px.
505 /// Returns the default value <b>0</b> if the input parameter is invalid.
506 ///
507 /// Available since API-level: 12
508 #[cfg(feature = "api-12")]
509 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
510 pub fn OH_ArkUI_DragEvent_GetVelocityY(event: *mut ArkUI_DragEvent) -> f32;
511 /// Obtains the dragging velocity along the main axis.
512 ///
513 /// # Arguments
514 ///
515 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
516 ///
517 /// # Returns
518 ///
519 /// * Returns the dragging velocity along the main axis, in px.
520 /// Returns the default value <b>0</b> if the input parameter is invalid.
521 ///
522 /// Available since API-level: 12
523 #[cfg(feature = "api-12")]
524 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
525 pub fn OH_ArkUI_DragEvent_GetVelocity(event: *mut ArkUI_DragEvent) -> f32;
526 /// Obtains the pressed status of modifier keys from a drag event.
527 ///
528 /// # Arguments
529 ///
530 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
531 ///
532 /// * `keys` - Indicates the returned combination of modifier keys that are currently pressed.
533 /// The application can determine the pressed modifier keys through bitwise operations.
534 ///
535 /// # Returns
536 ///
537 /// * Returns the result code.
538 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
539 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
540 ///
541 /// Available since API-level: 12
542 #[cfg(feature = "api-12")]
543 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
544 pub fn OH_ArkUI_DragEvent_GetModifierKeyStates(
545 event: *mut ArkUI_DragEvent,
546 keys: *mut u64,
547 ) -> i32;
548 /// Request to start the data sync process with the sync option.
549 ///
550 /// # Arguments
551 ///
552 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
553 ///
554 /// * `options` - Indicates the pointer to an <b>OH_UdmfGetDataParams</b> object.
555 ///
556 /// * `key` - Represents return value after set data to database successfully, it should be not
557 /// less than [`UDMF_KEY_BUFFER_LEN`].
558 ///
559 /// * `keyLen` - Represents the length of key string.
560 ///
561 /// # Returns
562 ///
563 /// * Returns the result code.
564 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
565 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
566 /// Returns [`ARKUI_ERROR_CODE_DRAG_DATA_SYNC_FAILED`] if the data sync is not allowed or failed.
567 ///
568 /// Available since API-level: 15
569 #[cfg(feature = "api-15")]
570 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
571 pub fn OH_ArkUI_DragEvent_StartDataLoading(
572 event: *mut ArkUI_DragEvent,
573 options: *mut OH_UdmfGetDataParams,
574 key: *mut ::core::ffi::c_char,
575 keyLen: ::core::ffi::c_uint,
576 ) -> i32;
577 /// Cancel the data sync process.
578 ///
579 /// # Arguments
580 ///
581 /// * `uiContext` - Indicates the pointer to a UI instance.
582 ///
583 /// * `key` - Represents the data key returned by [`OH_ArkUI_DragEvent_StartDataLoading`].
584 ///
585 /// # Returns
586 ///
587 /// * Returns the result code.
588 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
589 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
590 /// Returns [`ARKUI_ERROR_CODE_OPERATION_FAILED`] if no any data sync is in progress.
591 ///
592 /// Available since API-level: 15
593 #[cfg(feature = "api-15")]
594 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
595 pub fn OH_ArkUI_CancelDataLoading(
596 uiContext: ArkUI_ContextHandle,
597 key: *const ::core::ffi::c_char,
598 ) -> i32;
599 /// Sets whether to disable data prefetch process before the onDrop callback executing.
600 /// The system will retry to getting data until the max time limit (2.4s for now) reaches,
601 /// this's useful for the cross device draging operation, as the system helps to eliminate
602 /// the communication instability, but it's redundant for [`OH_ArkUI_DragEvent_StartDataLoading`]
603 /// method, as it will take care the data fetching with asynchronous mechanism, so must set this
604 /// field to true if using [`OH_ArkUI_DragEvent_StartDataLoading`] in onDrop to avoid the data is
605 /// fetched before onDrop executing unexpectedly.
606 ///
607 /// # Arguments
608 ///
609 /// * `node` - Indicates the pointer to a component node.
610 ///
611 /// * `disabled` - Indicates whether to disable the data pre-fetch process, true for disable, false for not.
612 ///
613 /// # Returns
614 ///
615 /// * Returns the result code.
616 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
617 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
618 ///
619 /// Available since API-level: 15
620 #[cfg(feature = "api-15")]
621 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
622 pub fn OH_ArkUI_DisableDropDataPrefetchOnNode(node: ArkUI_NodeHandle, disabled: bool) -> i32;
623 /// Sets whether to enable strict reporting on drag events.
624 /// This feature is disabled by default, and you are advised to enable it.
625 /// If this feature is disabled, the parent component is not notified when an item in it is dragged over its child
626 /// component. If this feature is enabled, the component is notified of the dragged item's leaving, and the chil
627 /// component to which the dragged item is dropped is notified of the item's entering. This configuration is
628 /// related to a specific UI instance. You can pass in a specific component node on the current UI instance
629 /// for association.
630 ///
631 /// # Arguments
632 ///
633 /// * `node` - Indicates the pointer to a component node.
634 ///
635 /// * `enabled` - Indicates whether to enable strict reporting on drag events.
636 ///
637 /// # Returns
638 ///
639 /// * Returns the result code.
640 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
641 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
642 ///
643 /// Available since API-level: 12
644 #[cfg(feature = "api-12")]
645 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
646 pub fn OH_ArkUI_SetDragEventStrictReportWithNode(node: ArkUI_NodeHandle, enabled: bool) -> i32;
647 /// Sets whether to enable strict reporting on drag events.
648 /// This feature is disabled by default, and you are advised to enable it.
649 /// If this feature is disabled, the parent component is not notified when an item in it is dragged over its child
650 /// component. If this feature is enabled, the component is notified of the dragged item's leaving, and the child
651 /// component to which the dragged item is dropped is notified of the item's entering. This configuration is
652 /// related to a specific UI instance. You can pass in a specific UI instance for association.
653 ///
654 /// # Arguments
655 ///
656 /// * `uiContext` - Indicates the pointer to a UI instance.
657 ///
658 /// * `enabled` - Indicates whether to enable strict reporting on drag events.
659 ///
660 /// # Returns
661 ///
662 /// * Returns the result code.
663 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
664 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
665 ///
666 /// Available since API-level: 12
667 #[cfg(feature = "api-12")]
668 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
669 pub fn OH_ArkUI_SetDragEventStrictReportWithContext(
670 uiContext: ArkUI_ContextHandle,
671 enabled: bool,
672 ) -> i32;
673 /// Sets the types of data that can be dropped to the specified component. This API resets the settings configured
674 /// through [`OH_ArkUI_DisallowNodeAnyDropDataTypes`] and [`OH_ArkUI_AllowNodeAllDropDataTypes`].
675 ///
676 /// # Arguments
677 ///
678 /// * `node` - Indicates the pointer to a component node.
679 ///
680 /// * `typesArray` - Indicates the array of types of data that can be dropped.
681 ///
682 /// * `count` - Indicates length of an array.
683 ///
684 /// # Returns
685 ///
686 /// * Returns the result code.
687 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
688 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
689 ///
690 /// Available since API-level: 12
691 #[cfg(feature = "api-12")]
692 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
693 pub fn OH_ArkUI_SetNodeAllowedDropDataTypes(
694 node: ArkUI_NodeHandle,
695 typesArray: *mut *const ::core::ffi::c_char,
696 count: i32,
697 ) -> i32;
698 /// Configures the specified component to disallow any data types. This API resets the settings configured through
699 /// [`OH_ArkUI_SetNodeAllowedDropDataTypes`].
700 ///
701 /// # Arguments
702 ///
703 /// * `node` - Indicates the pointer to a component node.
704 ///
705 /// # Returns
706 ///
707 /// * Returns the result code.
708 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
709 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
710 ///
711 /// Available since API-level: 12
712 #[cfg(feature = "api-12")]
713 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
714 pub fn OH_ArkUI_DisallowNodeAnyDropDataTypes(node: ArkUI_NodeHandle) -> i32;
715 /// Configures the specified component to allow any data types. This API resets the settings configured through
716 /// [`OH_ArkUI_SetNodeAllowedDropDataTypes`].
717 ///
718 /// # Arguments
719 ///
720 /// * `node` - Indicates the pointer to a component node.
721 ///
722 /// # Returns
723 ///
724 /// * Returns the result code.
725 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
726 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
727 ///
728 /// Available since API-level: 12
729 #[cfg(feature = "api-12")]
730 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
731 pub fn OH_ArkUI_AllowNodeAllDropDataTypes(node: ArkUI_NodeHandle) -> i32;
732 /// Sets whether the specified component is draggable.
733 ///
734 /// # Arguments
735 ///
736 /// * `node` - Indicates the pointer to a component node.
737 ///
738 /// * `bool` - Indicates whether the component is draggable.
739 ///
740 /// # Returns
741 ///
742 /// * Returns the result code.
743 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
744 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
745 ///
746 /// Available since API-level: 12
747 #[cfg(feature = "api-12")]
748 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
749 pub fn OH_ArkUI_SetNodeDraggable(node: ArkUI_NodeHandle, enabled: bool) -> i32;
750 /// Sets a custom drag preview for the specified component.
751 ///
752 /// # Arguments
753 ///
754 /// * `node` - Indicates the pointer to a component node.
755 ///
756 /// * `preview` - Indicates the custom drag preview, which is a pixel map.
757 ///
758 /// # Returns
759 ///
760 /// * Returns the result code.
761 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
762 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
763 ///
764 /// Available since API-level: 12
765 #[cfg(feature = "api-12")]
766 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
767 pub fn OH_ArkUI_SetNodeDragPreview(
768 node: ArkUI_NodeHandle,
769 preview: *mut OH_PixelmapNative,
770 ) -> i32;
771 /// Creates an <b>ArkUI_DragPreviewOption</b> object.
772 ///
773 ///
774 /// # Returns
775 ///
776 /// * Returns the created <b>ArkUI_DragPreviewOption</b> object.
777 ///
778 /// Available since API-level: 12
779 #[cfg(feature = "api-12")]
780 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
781 pub fn OH_ArkUI_CreateDragPreviewOption() -> *mut ArkUI_DragPreviewOption;
782 /// Disposes of a <b>ArkUI_DragPreviewOption</b> object.
783 ///
784 /// # Arguments
785 ///
786 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
787 ///
788 /// Available since API-level: 12
789 #[cfg(feature = "api-12")]
790 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
791 pub fn OH_ArkUI_DragPreviewOption_Dispose(option: *mut ArkUI_DragPreviewOption);
792 /// Sets the scale mode for an <b>ArkUI_DragPreviewOption</b> object.
793 ///
794 /// # Arguments
795 ///
796 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
797 ///
798 /// * `scaleMode` - Indicates the scale mode.
799 ///
800 /// # Returns
801 ///
802 /// * Returns the result code.
803 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
804 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
805 ///
806 /// Available since API-level: 12
807 #[cfg(feature = "api-12")]
808 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
809 pub fn OH_ArkUI_DragPreviewOption_SetScaleMode(
810 option: *mut ArkUI_DragPreviewOption,
811 scaleMode: ArkUI_DragPreviewScaleMode,
812 ) -> i32;
813 /// Sets whether to enable the shadow effect for an <b>ArkUI_DragPreviewOption</b> object.
814 /// The shadow effect is enabled by default.
815 ///
816 /// # Arguments
817 ///
818 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
819 ///
820 /// * `enabled` - Indicates whether to enable the shadow effect.
821 ///
822 /// # Returns
823 ///
824 /// * Returns the result code.
825 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
826 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
827 ///
828 /// Available since API-level: 12
829 #[cfg(feature = "api-12")]
830 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
831 pub fn OH_ArkUI_DragPreviewOption_SetDefaultShadowEnabled(
832 option: *mut ArkUI_DragPreviewOption,
833 enabled: bool,
834 ) -> i32;
835 /// Sets whether to enable the rounded corner effect for an <b>ArkUI_DragPreviewOption</b> object.
836 /// The rounded corner effect is enabled by default.
837 ///
838 /// # Arguments
839 ///
840 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
841 ///
842 /// * `enabled` - Indicates whether to enable the rounded corner effect.
843 ///
844 /// # Returns
845 ///
846 /// * Returns the result code.
847 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
848 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
849 ///
850 /// Available since API-level: 12
851 #[cfg(feature = "api-12")]
852 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
853 pub fn OH_ArkUI_DragPreviewOption_SetDefaultRadiusEnabled(
854 option: *mut ArkUI_DragPreviewOption,
855 enabled: bool,
856 ) -> i32;
857 /// Sets whether to enable the badge for an <b>ArkUI_DragPreviewOption</b> object.
858 /// If this feature is enabled, a badge that contains the number of dragged items is displayed.
859 ///
860 /// # Arguments
861 ///
862 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
863 ///
864 /// * `enabled` - Indicates whether to enable badge.
865 ///
866 /// # Returns
867 ///
868 /// * Returns the result code.
869 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
870 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
871 ///
872 /// Available since API-level: 12
873 #[cfg(feature = "api-12")]
874 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
875 pub fn OH_ArkUI_DragPreviewOption_SetNumberBadgeEnabled(
876 option: *mut ArkUI_DragPreviewOption,
877 enabled: bool,
878 ) -> i32;
879 /// Sets the count on the badge.
880 /// The settings will overwrite the value in the <b>SetDragPreviewNumberBadgeEnabled</b> API.
881 ///
882 /// # Arguments
883 ///
884 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
885 ///
886 /// * `forcedNumber` - Indicates the count on the badge.
887 ///
888 /// # Returns
889 ///
890 /// * Returns the result code.
891 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
892 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
893 ///
894 /// Available since API-level: 12
895 #[cfg(feature = "api-12")]
896 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
897 pub fn OH_ArkUI_DragPreviewOption_SetBadgeNumber(
898 option: *mut ArkUI_DragPreviewOption,
899 forcedNumber: u32,
900 ) -> i32;
901 /// Sets whether to enable the default animation on a click or touch, it's not used in drag action.
902 ///
903 /// # Arguments
904 ///
905 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
906 ///
907 /// * `enabled` - Indicates whether to enable the default animation on a click or touch.
908 ///
909 /// # Returns
910 ///
911 /// * Returns the result code.
912 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
913 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
914 ///
915 /// Available since API-level: 12
916 #[cfg(feature = "api-12")]
917 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
918 pub fn OH_ArkUI_DragPreviewOption_SetDefaultAnimationBeforeLiftingEnabled(
919 option: *mut ArkUI_DragPreviewOption,
920 enabled: bool,
921 ) -> i32;
922 /// Sets an <b>ArkUI_DragPreviewOption</b> object for the specified component.
923 ///
924 /// # Arguments
925 ///
926 /// * `node` - Indicates the pointer to a component node.
927 ///
928 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
929 ///
930 /// # Returns
931 ///
932 /// * Returns the result code.
933 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
934 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
935 ///
936 /// Available since API-level: 12
937 #[cfg(feature = "api-12")]
938 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
939 pub fn OH_ArkUI_SetNodeDragPreviewOption(
940 node: ArkUI_NodeHandle,
941 option: *mut ArkUI_DragPreviewOption,
942 ) -> i32;
943 /// Creates a drag action object for a UI instance based on the specified component node of the current
944 /// UI instance.
945 ///
946 /// # Arguments
947 ///
948 /// * `node` - Indicates the pointer to a component node.
949 ///
950 /// # Returns
951 ///
952 /// * Returns the pointer to the created drag action object; returns null if the operation fails.
953 ///
954 /// Available since API-level: 12
955 #[cfg(feature = "api-12")]
956 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
957 pub fn OH_ArkUI_CreateDragActionWithNode(node: ArkUI_NodeHandle) -> *mut ArkUI_DragAction;
958 /// Creates a drag action object for the specified UI instance.
959 ///
960 /// # Arguments
961 ///
962 /// * `uiContext` - Indicates the pointer to a UI instance.
963 ///
964 /// # Returns
965 ///
966 /// * Returns the pointer to the created drag action object; returns null if the operation fails.
967 ///
968 /// Available since API-level: 12
969 #[cfg(feature = "api-12")]
970 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
971 pub fn OH_ArkUI_CreateDragActionWithContext(
972 uiContext: ArkUI_ContextHandle,
973 ) -> *mut ArkUI_DragAction;
974 /// Disposes of a drag action object.
975 ///
976 /// # Arguments
977 ///
978 /// * `dragAction` - Indicates the pointer to the target drag action object.
979 ///
980 /// Available since API-level: 12
981 #[cfg(feature = "api-12")]
982 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
983 pub fn OH_ArkUI_DragAction_Dispose(dragAction: *mut ArkUI_DragAction);
984 /// Sets the pointer ID. If only one finger is operating on the screen, the pointer ID is 0.
985 /// In general cases, you can set the pointer ID to 0.
986 ///
987 /// # Arguments
988 ///
989 /// * `dragAction` - Indicates the pointer to the target drag action object.
990 ///
991 /// * `pointer` - Indicates the pointer ID. The value ranges from 0 to 9.
992 ///
993 /// # Returns
994 ///
995 /// * Returns the result code.
996 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
997 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
998 ///
999 /// Available since API-level: 12
1000 #[cfg(feature = "api-12")]
1001 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1002 pub fn OH_ArkUI_DragAction_SetPointerId(dragAction: *mut ArkUI_DragAction, pointer: i32)
1003 -> i32;
1004 /// Sets the drag previews for a drag action.
1005 ///
1006 /// # Arguments
1007 ///
1008 /// * `dragAction` - Indicates the pointer to the target drag action object.
1009 ///
1010 /// * `pixelmapArray` - Indicates the array of the drag previews to set, which must be pixel maps.
1011 ///
1012 /// * `size` - Indicates the size of the drag preview array.
1013 ///
1014 /// # Returns
1015 ///
1016 /// * Returns the result code.
1017 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1018 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1019 ///
1020 /// Available since API-level: 12
1021 #[cfg(feature = "api-12")]
1022 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1023 pub fn OH_ArkUI_DragAction_SetPixelMaps(
1024 dragAction: *mut ArkUI_DragAction,
1025 pixelmapArray: *mut *mut OH_PixelmapNative,
1026 size: i32,
1027 ) -> i32;
1028 /// Sets the touch point relative to the upper left corner of the first drag preview (pixel map).
1029 ///
1030 /// # Arguments
1031 ///
1032 /// * `dragAction` - Indicates the pointer to the target drag action object.
1033 ///
1034 /// * `x` - Indicates the X coordinate of the touch point.
1035 ///
1036 /// # Returns
1037 ///
1038 /// * Returns the result code.
1039 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1040 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1041 ///
1042 /// Available since API-level: 12
1043 #[cfg(feature = "api-12")]
1044 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1045 pub fn OH_ArkUI_DragAction_SetTouchPointX(dragAction: *mut ArkUI_DragAction, x: f32) -> i32;
1046 /// Sets the touch point relative to the upper left corner of the first drag preview (pixel map).
1047 ///
1048 /// # Arguments
1049 ///
1050 /// * `dragAction` - Indicates the pointer to the target drag action object.
1051 ///
1052 /// * `y` - Indicates the Y coordinate of the touch point.
1053 ///
1054 /// # Returns
1055 ///
1056 /// * Returns the result code.
1057 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1058 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1059 ///
1060 /// Available since API-level: 12
1061 #[cfg(feature = "api-12")]
1062 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1063 pub fn OH_ArkUI_DragAction_SetTouchPointY(dragAction: *mut ArkUI_DragAction, y: f32) -> i32;
1064 /// Sets an <b>ArkUI_DragPreviewOption</b> object for the specified drag action object.
1065 ///
1066 /// # Arguments
1067 ///
1068 /// * `dragAction` - Indicates the pointer to the target drag action object.
1069 ///
1070 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
1071 ///
1072 /// # Returns
1073 ///
1074 /// * Returns the result code.
1075 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1076 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1077 ///
1078 /// Available since API-level: 12
1079 #[cfg(feature = "api-12")]
1080 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1081 pub fn OH_ArkUI_DragAction_SetDragPreviewOption(
1082 dragAction: *mut ArkUI_DragAction,
1083 option: *mut ArkUI_DragPreviewOption,
1084 ) -> i32;
1085 /// Registers a drag status listener.
1086 /// This listener can be used to check whether the data is successfully received and processed.
1087 ///
1088 /// # Arguments
1089 ///
1090 /// * `dragAction` - Indicates the pointer to the target drag action object.
1091 ///
1092 /// * `userData` - Indicates the custom user data.
1093 ///
1094 /// * `listener` - Indicates the listener to register. When the callback is invoked, the system returns a pointer to the drag status
1095 /// object. The pointer is destroyed after the callback is complete and the application should not hold it anymore.
1096 ///
1097 /// # Returns
1098 ///
1099 /// * Returns the result code.
1100 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1101 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1102 ///
1103 /// Available since API-level: 12
1104 #[cfg(feature = "api-12")]
1105 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1106 pub fn OH_ArkUI_DragAction_RegisterStatusListener(
1107 dragAction: *mut ArkUI_DragAction,
1108 userData: *mut ::core::ffi::c_void,
1109 listener: ::core::option::Option<
1110 unsafe extern "C" fn(
1111 dragAndDropInfo: *mut ArkUI_DragAndDropInfo,
1112 userData: *mut ::core::ffi::c_void,
1113 ),
1114 >,
1115 ) -> i32;
1116 /// Unregisters a drag status listener.
1117 ///
1118 /// # Arguments
1119 ///
1120 /// * `dragAction` - Indicates the pointer to the target drag action object.
1121 ///
1122 /// Available since API-level: 12
1123 #[cfg(feature = "api-12")]
1124 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1125 pub fn OH_ArkUI_DragAction_UnregisterStatusListener(dragAction: *mut ArkUI_DragAction);
1126 /// Obtains the drag status of a drag action.
1127 ///
1128 /// # Arguments
1129 ///
1130 /// * `dragAndDropInfo` - Indicates the drag and drop information returned by the drag status listener.
1131 ///
1132 /// # Returns
1133 ///
1134 /// * Returns an <b>ArkUI_DragStatus</b> object; returns <b>ArkUI_DRAG_STATUS_UNKNOWN</b> if an error occurs.
1135 ///
1136 /// Available since API-level: 12
1137 #[cfg(feature = "api-12")]
1138 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1139 pub fn OH_ArkUI_DragAndDropInfo_GetDragStatus(
1140 dragAndDropInfo: *mut ArkUI_DragAndDropInfo,
1141 ) -> ArkUI_DragStatus;
1142 /// Obtains a drag event based on the specified drag and drop information.
1143 /// The drag event can then be used to obtain the drag result and the drag behavior, please note
1144 /// other info is not included in such a drag event.
1145 ///
1146 /// # Arguments
1147 ///
1148 /// * `dragAndDropInfo` - Indicates the drag and drop information returned by the drag status listener.
1149 ///
1150 /// # Returns
1151 ///
1152 /// * Returns an <b>ArkUI_DragEvent</b> object; returns null if an error occurs.
1153 ///
1154 /// Available since API-level: 12
1155 #[cfg(feature = "api-12")]
1156 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1157 pub fn OH_ArkUI_DragAndDropInfo_GetDragEvent(
1158 dragAndDropInfo: *mut ArkUI_DragAndDropInfo,
1159 ) -> *mut ArkUI_DragEvent;
1160 /// Initiates a drag action through the specified drag action object.
1161 ///
1162 /// # Arguments
1163 ///
1164 /// * `dragAction` - Indicates a drag action object.
1165 ///
1166 /// # Returns
1167 ///
1168 /// * Returns the result code.
1169 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1170 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1171 ///
1172 /// Available since API-level: 12
1173 #[cfg(feature = "api-12")]
1174 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1175 pub fn OH_ArkUI_StartDrag(dragAction: *mut ArkUI_DragAction) -> i32;
1176}