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::*;
7#[cfg(feature = "api-12")]
8use ohos_sys_opaque_types::ArkUI_ContextHandle;
9pub use ohos_sys_opaque_types::OH_PixelmapNative;
10use ohos_sys_opaque_types::OH_UdmfData;
11#[cfg(feature = "api-20")]
12use ohos_sys_opaque_types::OH_UdmfDataLoadParams;
13#[cfg(feature = "api-15")]
14use ohos_sys_opaque_types::OH_UdmfGetDataParams;
15
16#[cfg(feature = "api-12")]
17#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
18impl ArkUI_DragResult {
19 /// The drag and drop operation succeeded.
20 pub const SUCCESSFUL: ArkUI_DragResult = ArkUI_DragResult(0);
21 /// The drag and drop operation failed.
22 pub const FAILED: ArkUI_DragResult = ArkUI_DragResult(1);
23 /// The drag and drop operation was canceled.
24 pub const CANCELED: ArkUI_DragResult = ArkUI_DragResult(2);
25}
26#[repr(transparent)]
27/// Defines an enum for drag results, which are set by the data receiver and transferred by the system to the
28/// drag source so that the drag source is aware of the data processing result of the receiver.
29///
30///
31/// Available since API-level: 12
32#[cfg(feature = "api-12")]
33#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
34#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
35pub struct ArkUI_DragResult(pub ::core::ffi::c_uint);
36#[cfg(feature = "api-12")]
37#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
38impl ArkUI_DropOperation {
39 /// Copy.
40 pub const ARKUI_DROP_OPERATION_COPY: ArkUI_DropOperation = ArkUI_DropOperation(0);
41 /// Cut.
42 pub const ARKUI_DROP_OPERATION_MOVE: ArkUI_DropOperation = ArkUI_DropOperation(1);
43}
44#[repr(transparent)]
45/// Defines an enum for data processing modes used when data is dropped, which affects the display of the badge.
46///
47///
48/// Available since API-level: 12
49#[cfg(feature = "api-12")]
50#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
51#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
52pub struct ArkUI_DropOperation(pub ::core::ffi::c_uint);
53#[cfg(feature = "api-12")]
54#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
55impl ArkUI_PreDragStatus {
56 /// Unknown.
57 pub const ARKUI_PRE_DRAG_STATUS_UNKNOWN: ArkUI_PreDragStatus = ArkUI_PreDragStatus(-1);
58 /// A drag gesture is being detected.
59 pub const ARKUI_PRE_DRAG_STATUS_ACTION_DETECTING: ArkUI_PreDragStatus = ArkUI_PreDragStatus(0);
60 /// The component is ready to be dragged.
61 pub const ARKUI_PRE_DRAG_STATUS_READY_TO_TRIGGER_DRAG: ArkUI_PreDragStatus =
62 ArkUI_PreDragStatus(1);
63 /// A lift animation is started.
64 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_STARTED: ArkUI_PreDragStatus =
65 ArkUI_PreDragStatus(2);
66 /// A lift animation is finished.
67 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LIFT_FINISHED: ArkUI_PreDragStatus =
68 ArkUI_PreDragStatus(3);
69 /// A drop animation is started.
70 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_STARTED: ArkUI_PreDragStatus =
71 ArkUI_PreDragStatus(4);
72 /// A drop animation is finished.
73 pub const ARKUI_PRE_DRAG_STATUS_PREVIEW_LANDING_FINISHED: ArkUI_PreDragStatus =
74 ArkUI_PreDragStatus(5);
75 /// A drop animation is terminated.
76 pub const ARKUI_PRE_DRAG_STATUS_CANCELED_BEFORE_DRAG: ArkUI_PreDragStatus =
77 ArkUI_PreDragStatus(6);
78}
79#[repr(transparent)]
80/// Defines an enum for interaction states prior to a drop and drop operation.
81///
82///
83/// Available since API-level: 12
84#[cfg(feature = "api-12")]
85#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
86#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
87pub struct ArkUI_PreDragStatus(pub ::core::ffi::c_int);
88#[cfg(feature = "api-12")]
89#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
90impl ArkUI_DragPreviewScaleMode {
91 /// The system automatically changes the position of the dragged point based on the scenario and
92 /// scales the drag preview based on set rules.
93 pub const ARKUI_DRAG_PREVIEW_SCALE_AUTO: ArkUI_DragPreviewScaleMode =
94 ArkUI_DragPreviewScaleMode(0);
95 /// The system does not scale the drag preview.
96 pub const ARKUI_DRAG_PREVIEW_SCALE_DISABLED: ArkUI_DragPreviewScaleMode =
97 ArkUI_DragPreviewScaleMode(1);
98}
99#[repr(transparent)]
100/// Defines an enum for drag preview scale modes.
101///
102///
103/// Available since API-level: 12
104#[cfg(feature = "api-12")]
105#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
106#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
107pub struct ArkUI_DragPreviewScaleMode(pub ::core::ffi::c_uint);
108#[cfg(feature = "api-12")]
109#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
110impl ArkUI_DragStatus {
111 /// Unknown.
112 pub const ARKUI_DRAG_STATUS_UNKNOWN: ArkUI_DragStatus = ArkUI_DragStatus(-1);
113 /// Started.
114 pub const ARKUI_DRAG_STATUS_STARTED: ArkUI_DragStatus = ArkUI_DragStatus(0);
115 /// Ended.
116 pub const ARKUI_DRAG_STATUS_ENDED: ArkUI_DragStatus = ArkUI_DragStatus(1);
117}
118#[repr(transparent)]
119/// Defines an enum for drag states.
120///
121///
122/// Available since API-level: 12
123#[cfg(feature = "api-12")]
124#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
125#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
126pub struct ArkUI_DragStatus(pub ::core::ffi::c_int);
127/// Defines a struct for a component event.
128///
129///
130/// Available since API-level: 12
131#[cfg(feature = "api-12")]
132#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
133#[repr(C)]
134pub struct ArkUI_NodeEvent {
135 _unused: [u8; 0],
136}
137/// Defines a struct for a drag event.
138///
139///
140/// Available since API-level: 12
141#[cfg(feature = "api-12")]
142#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
143#[repr(C)]
144pub struct ArkUI_DragEvent {
145 _unused: [u8; 0],
146}
147/// Defines a struct for custom drag preview options.
148///
149///
150/// Available since API-level: 12
151#[cfg(feature = "api-12")]
152#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
153#[repr(C)]
154pub struct ArkUI_DragPreviewOption {
155 _unused: [u8; 0],
156}
157/// Defines a struct for a drag action.
158///
159///
160/// Available since API-level: 12
161#[cfg(feature = "api-12")]
162#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
163#[repr(C)]
164pub struct ArkUI_DragAction {
165 _unused: [u8; 0],
166}
167/// Defines a struct for drag and drop information returned through a drag status listener.
168///
169///
170/// Available since API-level: 12
171#[cfg(feature = "api-12")]
172#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
173#[repr(C)]
174pub struct ArkUI_DragAndDropInfo {
175 _unused: [u8; 0],
176}
177extern "C" {
178 /// Obtains a <b>ArkUI_DragEvent</b> object from the specified <b>ArkUI_NodeEvent</b> object.
179 ///
180 /// # Arguments
181 ///
182 /// * `nodeEvent` - Indicates the pointer to an <b>ArkUI_NodeEvent</b> object.
183 ///
184 /// # Returns
185 ///
186 /// * Returns the pointer to an <b>ArkUI_DragEvent</b> object.
187 /// Returns <b>null</b> if the parameter passed in is invalid or is not a drag-related event.
188 ///
189 /// Available since API-level: 12
190 #[cfg(feature = "api-12")]
191 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
192 pub fn OH_ArkUI_NodeEvent_GetDragEvent(nodeEvent: *mut ArkUI_NodeEvent)
193 -> *mut ArkUI_DragEvent;
194 /// Obtains the interaction state prior to a drop and drop operation.
195 ///
196 /// # Arguments
197 ///
198 /// * `nodeEvent` - Indicates the pointer to an <b>ArkUI_NodeEvent</b> object.
199 ///
200 /// # Returns
201 ///
202 /// * Returns the interaction state prior to the drop and drop operation.
203 ///
204 /// Available since API-level: 12
205 #[cfg(feature = "api-12")]
206 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
207 pub fn OH_ArkUI_NodeEvent_GetPreDragStatus(
208 nodeEvent: *mut ArkUI_NodeEvent,
209 ) -> ArkUI_PreDragStatus;
210 /// Sets whether to disable the default drop animation.
211 /// The default drop animation is enabled by default and can be disabled to apply a custom drop animation.
212 ///
213 /// # Arguments
214 ///
215 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
216 ///
217 /// * `disable` - Indicates whether to disable the default drop animation.
218 /// The value <b>true</b> means to disable the default drop animation, and <b>false</b> means the opposite.
219 ///
220 /// # Returns
221 ///
222 /// * Returns the result code.
223 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
224 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
225 ///
226 /// Available since API-level: 12
227 #[cfg(feature = "api-12")]
228 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
229 pub fn OH_ArkUI_DragEvent_DisableDefaultDropAnimation(
230 event: *mut ArkUI_DragEvent,
231 disable: bool,
232 ) -> i32;
233 /// Sets the data processing mode.
234 ///
235 /// # Arguments
236 ///
237 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
238 ///
239 /// * `dropOperation` - Indicates the data processing mode.
240 ///
241 /// # Returns
242 ///
243 /// * Returns the result code.
244 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
245 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
246 ///
247 /// Available since API-level: 12
248 #[cfg(feature = "api-12")]
249 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
250 pub fn OH_ArkUI_DragEvent_SetSuggestedDropOperation(
251 event: *mut ArkUI_DragEvent,
252 dropOperation: ArkUI_DropOperation,
253 ) -> i32;
254 /// Sets the result for a drag event.
255 ///
256 /// # Arguments
257 ///
258 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
259 ///
260 /// * `result` - Indicates the drag result.
261 ///
262 /// # Returns
263 ///
264 /// * Returns the result code.
265 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
266 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
267 ///
268 /// Available since API-level: 12
269 #[cfg(feature = "api-12")]
270 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
271 pub fn OH_ArkUI_DragEvent_SetDragResult(
272 event: *mut ArkUI_DragEvent,
273 result: ArkUI_DragResult,
274 ) -> i32;
275 /// Set drag data for a drag event.
276 ///
277 /// # Arguments
278 ///
279 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
280 ///
281 /// * `data` - Indicates the drag data.
282 ///
283 /// # Returns
284 ///
285 /// * Returns the result code.
286 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
287 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
288 ///
289 /// Available since API-level: 12
290 #[cfg(feature = "api-12")]
291 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
292 pub fn OH_ArkUI_DragEvent_SetData(event: *mut ArkUI_DragEvent, data: *mut OH_UdmfData) -> i32;
293 /// Use this method to provide a data loading parameter to the system instead of providing
294 /// a complete data object directly. When the user drags and drops to the target application,
295 /// the system will use this parameter to request data from you. This can greatly improve the efficiency
296 /// of the dragging operation for large amounts of data and the effectiveness of the drop data handling
297 /// in the target application.
298 ///
299 /// This method should be always prioritized over using [`OH_ArkUI_DragEvent_SetData`].
300 /// See [`OH_UdmfDataLoadParams_Create`] in <b>udmf.h</b> for how to create and prepare the data loading parameter.
301 ///
302 /// [Note]: Please be awared this method is conflict with [`OH_ArkUI_DragEvent_SetData`], and the system always use
303 /// the last called method as the final result.
304 ///
305 /// # Arguments
306 ///
307 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
308 ///
309 /// * `dataLoadParams` - Indicates the data loading parameters which will be used when dropping.
310 ///
311 /// # Returns
312 ///
313 /// * Returns the result code.
314 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
315 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
316 ///
317 /// Available since API-level: 20
318 #[cfg(feature = "api-20")]
319 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
320 pub fn OH_ArkUI_DragEvent_SetDataLoadParams(
321 event: *mut ArkUI_DragEvent,
322 dataLoadParams: *mut OH_UdmfDataLoadParams,
323 ) -> ArkUiResult;
324 /// Obtains the default drag data from a drag event.
325 ///
326 /// # Arguments
327 ///
328 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
329 ///
330 /// * `data` - Indicates the pointer to an <b>OH_UdmfData</b> object. The application needs to create a pointer
331 /// for receiving data by using the [`OH_UdmfData_Create`] method.
332 ///
333 /// # Returns
334 ///
335 /// * Returns the result code.
336 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
337 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
338 ///
339 /// Available since API-level: 12
340 #[cfg(feature = "api-12")]
341 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
342 pub fn OH_ArkUI_DragEvent_GetUdmfData(
343 event: *mut ArkUI_DragEvent,
344 data: *mut OH_UdmfData,
345 ) -> i32;
346 /// Obtains the number of drag data types from a drag event.
347 ///
348 /// # Arguments
349 ///
350 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
351 ///
352 /// * `count` - Indicates the number of drag data types returned.
353 ///
354 /// # Returns
355 ///
356 /// * Returns the result code.
357 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
358 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
359 ///
360 /// Available since API-level: 12
361 #[cfg(feature = "api-12")]
362 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
363 pub fn OH_ArkUI_DragEvent_GetDataTypeCount(event: *mut ArkUI_DragEvent, count: *mut i32)
364 -> i32;
365 /// Obtains the list of drag data types from a drag event.
366 ///
367 /// # Arguments
368 ///
369 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
370 ///
371 /// * `eventTypeArray` - Indicates the list of the drag data types. You need to create a string array first.
372 ///
373 /// * `length` - Indicates the total length of the list array. It must be greater than or equal to the number obtained
374 /// by using [`OH_ArkUI_DragEvent_GetDataTypeCount`].
375 ///
376 /// * `maxStrLen` - Indicates the max string length of drag data types.
377 ///
378 /// # Returns
379 ///
380 /// * Returns the result code.
381 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
382 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
383 /// Returns [`ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR`] if the giving buffer is not enough for string copy.
384 ///
385 /// Available since API-level: 12
386 #[cfg(feature = "api-12")]
387 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
388 pub fn OH_ArkUI_DragEvent_GetDataTypes(
389 event: *mut ArkUI_DragEvent,
390 eventTypeArray: *mut *mut ::core::ffi::c_char,
391 length: i32,
392 maxStrLen: i32,
393 ) -> i32;
394 /// Obtains the drag result from a drag event.
395 ///
396 /// # Arguments
397 ///
398 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
399 ///
400 /// * `result` - Indicates the drag result returned.
401 ///
402 /// # Returns
403 ///
404 /// * Returns the result code.
405 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
406 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
407 ///
408 /// Available since API-level: 12
409 #[cfg(feature = "api-12")]
410 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
411 pub fn OH_ArkUI_DragEvent_GetDragResult(
412 event: *mut ArkUI_DragEvent,
413 result: *mut ArkUI_DragResult,
414 ) -> i32;
415 /// Obtains the drop operation from a drag event.
416 ///
417 /// # Arguments
418 ///
419 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
420 ///
421 /// * `operation` - Indicates the drop operation which the data receiver set.
422 ///
423 /// # Returns
424 ///
425 /// * Returns the result code.
426 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
427 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
428 /// Possible causes: 1. The given parameters are null or the given event is not a valid DragEvent.
429 ///
430 /// Available since API-level: 12
431 #[cfg(feature = "api-12")]
432 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
433 pub fn OH_ArkUI_DragEvent_GetDropOperation(
434 event: *mut ArkUI_DragEvent,
435 operation: *mut ArkUI_DropOperation,
436 ) -> i32;
437 /// Obtains the X coordinate of the touch point for a drag preview from a drag event.
438 ///
439 /// # Arguments
440 ///
441 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
442 ///
443 /// # Returns
444 ///
445 /// * Returns the X coordinate of the touch point, in px.
446 /// Returns the default value <b>0</b> if the input parameter is invalid.
447 ///
448 /// Available since API-level: 12
449 #[cfg(feature = "api-12")]
450 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
451 pub fn OH_ArkUI_DragEvent_GetPreviewTouchPointX(event: *mut ArkUI_DragEvent) -> f32;
452 /// Obtains the Y coordinate of the touch point for a drag preview from a drag event.
453 ///
454 /// # Arguments
455 ///
456 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
457 ///
458 /// # Returns
459 ///
460 /// * Returns the Y coordinate of the touch point, in px.
461 /// Returns the default value <b>0</b> if the input parameter is invalid.
462 ///
463 /// Available since API-level: 12
464 #[cfg(feature = "api-12")]
465 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
466 pub fn OH_ArkUI_DragEvent_GetPreviewTouchPointY(event: *mut ArkUI_DragEvent) -> f32;
467 /// Obtains the width of a drag preview from a drag event.
468 ///
469 /// # Arguments
470 ///
471 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
472 ///
473 /// # Returns
474 ///
475 /// * Returns the width of the drag preview, in px.
476 /// Returns the default value <b>0</b> if the input parameter is invalid.
477 ///
478 /// Available since API-level: 12
479 #[cfg(feature = "api-12")]
480 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
481 pub fn OH_ArkUI_DragEvent_GetPreviewRectWidth(event: *mut ArkUI_DragEvent) -> f32;
482 /// Obtains the height of a drag preview from a drag event.
483 ///
484 /// # Arguments
485 ///
486 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
487 ///
488 /// # Returns
489 ///
490 /// * Returns the height of the drag preview, in px.
491 /// Returns the default value <b>0</b> if the input parameter is invalid.
492 ///
493 /// Available since API-level: 12
494 #[cfg(feature = "api-12")]
495 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
496 pub fn OH_ArkUI_DragEvent_GetPreviewRectHeight(event: *mut ArkUI_DragEvent) -> f32;
497 /// Obtains the X coordinate of the touch point relative to the window from a drag event.
498 ///
499 /// # Arguments
500 ///
501 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
502 ///
503 /// # Returns
504 ///
505 /// * Returns the X coordinate of the touch point relative to the window, in px.
506 /// Returns the default value <b>0</b> if the input parameter is invalid.
507 ///
508 /// Available since API-level: 12
509 #[cfg(feature = "api-12")]
510 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
511 pub fn OH_ArkUI_DragEvent_GetTouchPointXToWindow(event: *mut ArkUI_DragEvent) -> f32;
512 /// Obtains the Y coordinate of the touch point relative to the window from a drag event.
513 ///
514 /// # Arguments
515 ///
516 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
517 ///
518 /// # Returns
519 ///
520 /// * Returns the Y coordinate of the touch point relative to the window, in px.
521 /// Returns the default value <b>0</b> if the input parameter is invalid.
522 ///
523 /// Available since API-level: 12
524 #[cfg(feature = "api-12")]
525 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
526 pub fn OH_ArkUI_DragEvent_GetTouchPointYToWindow(event: *mut ArkUI_DragEvent) -> f32;
527 /// Obtains the X coordinate of the touch point relative to the current display from a drag event.
528 ///
529 /// # Arguments
530 ///
531 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
532 ///
533 /// # Returns
534 ///
535 /// * Returns the X coordinate of the touch point relative to the current display, in px.
536 /// Returns the default value <b>0</b> if the input parameter is invalid.
537 ///
538 /// Available since API-level: 12
539 #[cfg(feature = "api-12")]
540 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
541 pub fn OH_ArkUI_DragEvent_GetTouchPointXToDisplay(event: *mut ArkUI_DragEvent) -> f32;
542 /// Obtains the Y coordinate of the touch point relative to the current display from a drag event.
543 ///
544 /// # Arguments
545 ///
546 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
547 ///
548 /// # Returns
549 ///
550 /// * Returns the Y coordinate of the touch point relative to the current display, in px.
551 /// Returns the default value <b>0</b> if the input parameter is invalid.
552 ///
553 /// Available since API-level: 12
554 #[cfg(feature = "api-12")]
555 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
556 pub fn OH_ArkUI_DragEvent_GetTouchPointYToDisplay(event: *mut ArkUI_DragEvent) -> f32;
557 /// Obtains the global display X coordinate of the touch point from an <b>ArkUI_DragEvent</b> object.
558 ///
559 /// # Arguments
560 ///
561 /// * `event` - Pointer to an <b>ArkUI_DragEvent</b> object.
562 ///
563 /// # Returns
564 ///
565 /// * float Global display X coordinate of the touch point, in px.
566 /// If the input parameter is invalid, the default value <b>0</b> is returned.
567 ///
568 /// Available since API-level: 20
569 #[cfg(feature = "api-20")]
570 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
571 pub fn OH_ArkUI_DragEvent_GetTouchPointXToGlobalDisplay(event: *mut ArkUI_DragEvent) -> f32;
572 /// Obtains the global display Y coordinate of the touch point from an <b>ArkUI_DragEvent</b> object.
573 ///
574 /// # Arguments
575 ///
576 /// * `event` - Pointer to an <b>ArkUI_DragEvent</b> object.
577 ///
578 /// # Returns
579 ///
580 /// * float Global display Y coordinate of the touch point, in px.
581 /// If the input parameter is invalid, the default value <b>0</b> is returned.
582 ///
583 /// Available since API-level: 20
584 #[cfg(feature = "api-20")]
585 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
586 pub fn OH_ArkUI_DragEvent_GetTouchPointYToGlobalDisplay(event: *mut ArkUI_DragEvent) -> f32;
587 /// Obtains the dragging velocity along the x-axis.
588 ///
589 /// # Arguments
590 ///
591 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
592 ///
593 /// # Returns
594 ///
595 /// * Returns the dragging velocity along the x-axis, in px.
596 /// Returns the default value <b>0</b> if the input parameter is invalid.
597 ///
598 /// Available since API-level: 12
599 #[cfg(feature = "api-12")]
600 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
601 pub fn OH_ArkUI_DragEvent_GetVelocityX(event: *mut ArkUI_DragEvent) -> f32;
602 /// Obtains the dragging velocity along the y-axis.
603 ///
604 /// # Arguments
605 ///
606 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
607 ///
608 /// # Returns
609 ///
610 /// * Returns the dragging velocity along the y-axis, in px.
611 /// Returns the default value <b>0</b> if the input parameter is invalid.
612 ///
613 /// Available since API-level: 12
614 #[cfg(feature = "api-12")]
615 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
616 pub fn OH_ArkUI_DragEvent_GetVelocityY(event: *mut ArkUI_DragEvent) -> f32;
617 /// Obtains the dragging velocity along the main axis.
618 ///
619 /// # Arguments
620 ///
621 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
622 ///
623 /// # Returns
624 ///
625 /// * Returns the dragging velocity along the main axis, in px.
626 /// Returns the default value <b>0</b> if the input parameter is invalid.
627 ///
628 /// Available since API-level: 12
629 #[cfg(feature = "api-12")]
630 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
631 pub fn OH_ArkUI_DragEvent_GetVelocity(event: *mut ArkUI_DragEvent) -> f32;
632 /// Obtains the pressed status of modifier keys from a drag event.
633 ///
634 /// # Arguments
635 ///
636 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
637 ///
638 /// * `keys` - [`ArkUI_ModifierKeyName`] Indicates the returned combination of modifier keys that are
639 /// currently pressed. The application can determine the pressed modifier keys through bitwise operations.
640 ///
641 /// # Returns
642 ///
643 /// * Returns the result code.
644 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
645 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
646 ///
647 /// Available since API-level: 12
648 #[cfg(feature = "api-12")]
649 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
650 pub fn OH_ArkUI_DragEvent_GetModifierKeyStates(
651 event: *mut ArkUI_DragEvent,
652 keys: *mut u64,
653 ) -> i32;
654 /// Obtains the display ID of the screen for the specified drag event.
655 ///
656 /// # Arguments
657 ///
658 /// * `event` - Pointer to an <b>ArkUI_DragEvent</b> object.
659 ///
660 /// * `displayId` - Display ID of the event occurs in.
661 ///
662 /// # Returns
663 ///
664 /// * Returns the result code.
665 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
666 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
667 ///
668 /// Available since API-level: 20
669 #[cfg(feature = "api-20")]
670 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
671 pub fn OH_ArkUI_DragEvent_GetDisplayId(
672 event: *mut ArkUI_DragEvent,
673 displayId: *mut i32,
674 ) -> ArkUiResult;
675 /// Request to start the data sync process with the sync option.
676 ///
677 /// # Arguments
678 ///
679 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
680 ///
681 /// * `options` - Indicates the pointer to an <b>OH_UdmfGetDataParams</b> object.
682 ///
683 /// * `key` - Represents return value after set data to database successfully, it should be not
684 /// less than [`UDMF_KEY_BUFFER_LEN`].
685 ///
686 /// * `keyLen` - Represents the length of key string.
687 ///
688 /// # Returns
689 ///
690 /// * Returns the result code.
691 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
692 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
693 ///
694 /// Available since API-level: 15
695 #[cfg(feature = "api-15")]
696 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
697 pub fn OH_ArkUI_DragEvent_StartDataLoading(
698 event: *mut ArkUI_DragEvent,
699 options: *mut OH_UdmfGetDataParams,
700 key: *mut ::core::ffi::c_char,
701 keyLen: ::core::ffi::c_uint,
702 ) -> i32;
703 /// Cancel the data sync process.
704 ///
705 /// # Arguments
706 ///
707 /// * `uiContext` - Indicates the pointer to a UI instance.
708 ///
709 /// * `key` - Represents the data key returned by [`OH_ArkUI_DragEvent_StartDataLoading`].
710 ///
711 /// # Returns
712 ///
713 /// * Returns the result code.
714 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
715 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
716 ///
717 /// Available since API-level: 15
718 #[cfg(feature = "api-15")]
719 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
720 pub fn OH_ArkUI_CancelDataLoading(
721 uiContext: ArkUI_ContextHandle,
722 key: *const ::core::ffi::c_char,
723 ) -> i32;
724 /// Sets whether to disable data prefetch process before the onDrop callback executing.
725 /// The system will retry to getting data until the max time limit (2.4s for now) reaches,
726 /// this's useful for the cross device draging operation, as the system helps to eliminate
727 /// the communication instability, but it's redundant for [`OH_ArkUI_DragEvent_StartDataLoading`]
728 /// method, as it will take care the data fetching with asynchronous mechanism, so must set this
729 /// field to true if using [`OH_ArkUI_DragEvent_StartDataLoading`] in onDrop to avoid the data is
730 /// fetched before onDrop executing unexpectedly.
731 ///
732 /// # Arguments
733 ///
734 /// * `node` - Indicates the pointer to a component node.
735 ///
736 /// * `disabled` - Indicates whether to disable the data pre-fetch process, true for disable, false for not.
737 ///
738 /// # Returns
739 ///
740 /// * Returns the result code.
741 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
742 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
743 ///
744 /// Available since API-level: 15
745 #[cfg(feature = "api-15")]
746 #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
747 pub fn OH_ArkUI_DisableDropDataPrefetchOnNode(node: ArkUI_NodeHandle, disabled: bool) -> i32;
748 /// Sets whether to enable strict reporting on drag events.
749 /// This feature is disabled by default, and you are advised to enable it.
750 /// If this feature is disabled, the parent component is not notified when an item in it is dragged over its child
751 /// component. If this feature is enabled, the component is notified of the dragged item's leaving, and the chil
752 /// component to which the dragged item is dropped is notified of the item's entering. This configuration is
753 /// related to a specific UI instance. You can pass in a specific component node on the current UI instance
754 /// for association.
755 ///
756 /// # Arguments
757 ///
758 /// * `node` - Indicates the pointer to a component node.
759 ///
760 /// * `enabled` - Indicates whether to enable strict reporting on drag events.
761 ///
762 /// # Returns
763 ///
764 /// * Returns the result code.
765 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
766 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
767 ///
768 /// Available since API-level: 12
769 #[cfg(feature = "api-12")]
770 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
771 pub fn OH_ArkUI_SetDragEventStrictReportWithNode(node: ArkUI_NodeHandle, enabled: bool) -> i32;
772 /// Sets whether to enable strict reporting on drag events.
773 /// This feature is disabled by default, and you are advised to enable it.
774 /// If this feature is disabled, the parent component is not notified when an item in it is dragged over its child
775 /// component. If this feature is enabled, the component is notified of the dragged item's leaving, and the child
776 /// component to which the dragged item is dropped is notified of the item's entering. This configuration is
777 /// related to a specific UI instance. You can pass in a specific UI instance for association.
778 ///
779 /// # Arguments
780 ///
781 /// * `uiContext` - Indicates the pointer to a UI instance.
782 ///
783 /// * `enabled` - Indicates whether to enable strict reporting on drag events.
784 ///
785 /// # Returns
786 ///
787 /// * Returns the result code.
788 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
789 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
790 ///
791 /// Available since API-level: 12
792 #[cfg(feature = "api-12")]
793 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
794 pub fn OH_ArkUI_SetDragEventStrictReportWithContext(
795 uiContext: ArkUI_ContextHandle,
796 enabled: bool,
797 ) -> i32;
798 /// Sets the types of data that can be dropped to the specified component. This API resets the settings configured
799 /// through [`OH_ArkUI_DisallowNodeAnyDropDataTypes`] and [`OH_ArkUI_AllowNodeAllDropDataTypes`].
800 ///
801 /// # Arguments
802 ///
803 /// * `node` - Indicates the pointer to a component node.
804 ///
805 /// * `typesArray` - Indicates the array of types of data that can be dropped.
806 ///
807 /// * `count` - Indicates length of an array.
808 ///
809 /// # Returns
810 ///
811 /// * Returns the result code.
812 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
813 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
814 ///
815 /// Available since API-level: 12
816 #[cfg(feature = "api-12")]
817 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
818 pub fn OH_ArkUI_SetNodeAllowedDropDataTypes(
819 node: ArkUI_NodeHandle,
820 typesArray: *mut *const ::core::ffi::c_char,
821 count: i32,
822 ) -> i32;
823 /// Configures the specified component to disallow any data types. This API resets the settings configured through
824 /// [`OH_ArkUI_SetNodeAllowedDropDataTypes`].
825 ///
826 /// # Arguments
827 ///
828 /// * `node` - Indicates the pointer to a component node.
829 ///
830 /// # Returns
831 ///
832 /// * Returns the result code.
833 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
834 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
835 ///
836 /// Available since API-level: 12
837 #[cfg(feature = "api-12")]
838 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
839 pub fn OH_ArkUI_DisallowNodeAnyDropDataTypes(node: ArkUI_NodeHandle) -> i32;
840 /// Configures the specified component to allow any data types. This API resets the settings configured through
841 /// [`OH_ArkUI_SetNodeAllowedDropDataTypes`].
842 ///
843 /// # Arguments
844 ///
845 /// * `node` - Indicates the pointer to a component node.
846 ///
847 /// # Returns
848 ///
849 /// * Returns the result code.
850 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
851 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
852 ///
853 /// Available since API-level: 12
854 #[cfg(feature = "api-12")]
855 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
856 pub fn OH_ArkUI_AllowNodeAllDropDataTypes(node: ArkUI_NodeHandle) -> i32;
857 /// Sets whether the specified component is draggable.
858 ///
859 /// # Arguments
860 ///
861 /// * `node` - Indicates the pointer to a component node.
862 ///
863 /// * `enabled` - Indicates whether the component is draggable.
864 ///
865 /// # Returns
866 ///
867 /// * Returns the result code.
868 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
869 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
870 ///
871 /// Available since API-level: 12
872 #[cfg(feature = "api-12")]
873 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
874 pub fn OH_ArkUI_SetNodeDraggable(node: ArkUI_NodeHandle, enabled: bool) -> i32;
875 /// Sets a custom drag preview for the specified component.
876 ///
877 /// # Arguments
878 ///
879 /// * `node` - Indicates the pointer to a component node.
880 ///
881 /// * `preview` - Indicates the custom drag preview, which is a pixel map.
882 ///
883 /// # Returns
884 ///
885 /// * Returns the result code.
886 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
887 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
888 ///
889 /// Available since API-level: 12
890 #[cfg(feature = "api-12")]
891 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
892 pub fn OH_ArkUI_SetNodeDragPreview(
893 node: ArkUI_NodeHandle,
894 preview: *mut OH_PixelmapNative,
895 ) -> i32;
896 /// Creates an <b>ArkUI_DragPreviewOption</b> object.
897 ///
898 ///
899 /// # Returns
900 ///
901 /// * Returns the created <b>ArkUI_DragPreviewOption</b> object.
902 ///
903 /// Available since API-level: 12
904 #[cfg(feature = "api-12")]
905 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
906 pub fn OH_ArkUI_CreateDragPreviewOption() -> *mut ArkUI_DragPreviewOption;
907 /// Disposes of a <b>ArkUI_DragPreviewOption</b> object.
908 ///
909 /// # Arguments
910 ///
911 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
912 ///
913 /// Available since API-level: 12
914 #[cfg(feature = "api-12")]
915 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
916 pub fn OH_ArkUI_DragPreviewOption_Dispose(option: *mut ArkUI_DragPreviewOption);
917 /// Sets the scale mode for an <b>ArkUI_DragPreviewOption</b> object.
918 ///
919 /// # Arguments
920 ///
921 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
922 ///
923 /// * `scaleMode` - Indicates the scale mode.
924 ///
925 /// # Returns
926 ///
927 /// * Returns the result code.
928 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
929 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
930 ///
931 /// Available since API-level: 12
932 #[cfg(feature = "api-12")]
933 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
934 pub fn OH_ArkUI_DragPreviewOption_SetScaleMode(
935 option: *mut ArkUI_DragPreviewOption,
936 scaleMode: ArkUI_DragPreviewScaleMode,
937 ) -> i32;
938 /// Sets whether to enable the shadow effect for an <b>ArkUI_DragPreviewOption</b> object.
939 /// The shadow effect is enabled by default.
940 ///
941 /// # Arguments
942 ///
943 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
944 ///
945 /// * `enabled` - Indicates whether to enable the shadow effect.
946 ///
947 /// # Returns
948 ///
949 /// * Returns the result code.
950 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
951 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
952 ///
953 /// Available since API-level: 12
954 #[cfg(feature = "api-12")]
955 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
956 pub fn OH_ArkUI_DragPreviewOption_SetDefaultShadowEnabled(
957 option: *mut ArkUI_DragPreviewOption,
958 enabled: bool,
959 ) -> i32;
960 /// Sets whether to enable the rounded corner effect for an <b>ArkUI_DragPreviewOption</b> object.
961 /// The rounded corner effect is enabled by default.
962 ///
963 /// # Arguments
964 ///
965 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
966 ///
967 /// * `enabled` - Indicates whether to enable the rounded corner effect.
968 ///
969 /// # Returns
970 ///
971 /// * Returns the result code.
972 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
973 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
974 ///
975 /// Available since API-level: 12
976 #[cfg(feature = "api-12")]
977 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
978 pub fn OH_ArkUI_DragPreviewOption_SetDefaultRadiusEnabled(
979 option: *mut ArkUI_DragPreviewOption,
980 enabled: bool,
981 ) -> i32;
982 /// Sets whether to enable the badge for an <b>ArkUI_DragPreviewOption</b> object.
983 /// If this feature is enabled, a badge that contains the number of dragged items is displayed.
984 ///
985 /// # Arguments
986 ///
987 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
988 ///
989 /// * `enabled` - Indicates whether to enable badge.
990 ///
991 /// # Returns
992 ///
993 /// * Returns the result code.
994 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
995 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
996 ///
997 /// Available since API-level: 12
998 #[cfg(feature = "api-12")]
999 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1000 pub fn OH_ArkUI_DragPreviewOption_SetNumberBadgeEnabled(
1001 option: *mut ArkUI_DragPreviewOption,
1002 enabled: bool,
1003 ) -> i32;
1004 /// Sets the count on the badge.
1005 /// The settings will overwrite the value in the <b>SetDragPreviewNumberBadgeEnabled</b> API.
1006 ///
1007 /// # Arguments
1008 ///
1009 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
1010 ///
1011 /// * `forcedNumber` - Indicates the count on the badge.
1012 ///
1013 /// # Returns
1014 ///
1015 /// * Returns the result code.
1016 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1017 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1018 ///
1019 /// Available since API-level: 12
1020 #[cfg(feature = "api-12")]
1021 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1022 pub fn OH_ArkUI_DragPreviewOption_SetBadgeNumber(
1023 option: *mut ArkUI_DragPreviewOption,
1024 forcedNumber: u32,
1025 ) -> i32;
1026 /// Sets whether to enable the default animation on a click or touch, it's not used in drag action.
1027 ///
1028 /// # Arguments
1029 ///
1030 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
1031 ///
1032 /// * `enabled` - Indicates whether to enable the default animation on a click or touch.
1033 ///
1034 /// # Returns
1035 ///
1036 /// * Returns the result code.
1037 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1038 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1039 ///
1040 /// Available since API-level: 12
1041 #[cfg(feature = "api-12")]
1042 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1043 pub fn OH_ArkUI_DragPreviewOption_SetDefaultAnimationBeforeLiftingEnabled(
1044 option: *mut ArkUI_DragPreviewOption,
1045 enabled: bool,
1046 ) -> i32;
1047 /// Sets an <b>ArkUI_DragPreviewOption</b> object for the specified component.
1048 ///
1049 /// # Arguments
1050 ///
1051 /// * `node` - Indicates the pointer to a component node.
1052 ///
1053 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
1054 ///
1055 /// # Returns
1056 ///
1057 /// * Returns the result code.
1058 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1059 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1060 ///
1061 /// Available since API-level: 12
1062 #[cfg(feature = "api-12")]
1063 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1064 pub fn OH_ArkUI_SetNodeDragPreviewOption(
1065 node: ArkUI_NodeHandle,
1066 option: *mut ArkUI_DragPreviewOption,
1067 ) -> i32;
1068 /// Creates a drag action object for a UI instance based on the specified component node of the current
1069 /// UI instance.
1070 ///
1071 /// # Arguments
1072 ///
1073 /// * `node` - Indicates the pointer to a component node.
1074 ///
1075 /// # Returns
1076 ///
1077 /// * Returns the pointer to the created drag action object; returns null if the operation fails.
1078 ///
1079 /// Available since API-level: 12
1080 #[cfg(feature = "api-12")]
1081 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1082 pub fn OH_ArkUI_CreateDragActionWithNode(node: ArkUI_NodeHandle) -> *mut ArkUI_DragAction;
1083 /// Creates a drag action object for the specified UI instance.
1084 ///
1085 /// # Arguments
1086 ///
1087 /// * `uiContext` - Indicates the pointer to a UI instance.
1088 ///
1089 /// # Returns
1090 ///
1091 /// * Returns the pointer to the created drag action object; returns null if the operation fails.
1092 ///
1093 /// Available since API-level: 12
1094 #[cfg(feature = "api-12")]
1095 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1096 pub fn OH_ArkUI_CreateDragActionWithContext(
1097 uiContext: ArkUI_ContextHandle,
1098 ) -> *mut ArkUI_DragAction;
1099 /// Disposes of a drag action object.
1100 ///
1101 /// # Arguments
1102 ///
1103 /// * `dragAction` - Indicates the pointer to the target drag action object.
1104 ///
1105 /// Available since API-level: 12
1106 #[cfg(feature = "api-12")]
1107 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1108 pub fn OH_ArkUI_DragAction_Dispose(dragAction: *mut ArkUI_DragAction);
1109 /// Sets the pointer ID. If only one finger is operating on the screen, the pointer ID is 0.
1110 /// In general cases, you can set the pointer ID to 0.
1111 ///
1112 /// # Arguments
1113 ///
1114 /// * `dragAction` - Indicates the pointer to the target drag action object.
1115 ///
1116 /// * `pointer` - Indicates the pointer ID. The value ranges from 0 to 9.
1117 ///
1118 /// # Returns
1119 ///
1120 /// * Returns the result code.
1121 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1122 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1123 ///
1124 /// Available since API-level: 12
1125 #[cfg(feature = "api-12")]
1126 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1127 pub fn OH_ArkUI_DragAction_SetPointerId(dragAction: *mut ArkUI_DragAction, pointer: i32)
1128 -> i32;
1129 /// Sets the drag previews for a drag action.
1130 ///
1131 /// # Arguments
1132 ///
1133 /// * `dragAction` - Indicates the pointer to the target drag action object.
1134 ///
1135 /// * `pixelmapArray` - Indicates the array of the drag previews to set, which must be pixel maps.
1136 ///
1137 /// * `size` - Indicates the size of the drag preview array.
1138 ///
1139 /// # Returns
1140 ///
1141 /// * Returns the result code.
1142 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1143 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1144 ///
1145 /// Available since API-level: 12
1146 #[cfg(feature = "api-12")]
1147 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1148 pub fn OH_ArkUI_DragAction_SetPixelMaps(
1149 dragAction: *mut ArkUI_DragAction,
1150 pixelmapArray: *mut *mut OH_PixelmapNative,
1151 size: i32,
1152 ) -> i32;
1153 /// Sets the touch point relative to the upper left corner of the first drag preview (pixel map).
1154 ///
1155 /// # Arguments
1156 ///
1157 /// * `dragAction` - Indicates the pointer to the target drag action object.
1158 ///
1159 /// * `x` - Indicates the X coordinate of the touch point.
1160 ///
1161 /// # Returns
1162 ///
1163 /// * Returns the result code.
1164 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1165 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1166 ///
1167 /// Available since API-level: 12
1168 #[cfg(feature = "api-12")]
1169 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1170 pub fn OH_ArkUI_DragAction_SetTouchPointX(dragAction: *mut ArkUI_DragAction, x: f32) -> i32;
1171 /// Sets the touch point relative to the upper left corner of the first drag preview (pixel map).
1172 ///
1173 /// # Arguments
1174 ///
1175 /// * `dragAction` - Indicates the pointer to the target drag action object.
1176 ///
1177 /// * `y` - Indicates the Y coordinate of the touch point.
1178 ///
1179 /// # Returns
1180 ///
1181 /// * Returns the result code.
1182 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1183 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1184 ///
1185 /// Available since API-level: 12
1186 #[cfg(feature = "api-12")]
1187 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1188 pub fn OH_ArkUI_DragAction_SetTouchPointY(dragAction: *mut ArkUI_DragAction, y: f32) -> i32;
1189 /// Sets the drag data.
1190 ///
1191 /// # Arguments
1192 ///
1193 /// * `dragAction` - Indicates the pointer to the target drag action object.
1194 ///
1195 /// * `data` - Indicates the drag data.
1196 ///
1197 /// # Returns
1198 ///
1199 /// * Returns the result code.
1200 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1201 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1202 ///
1203 /// Available since API-level: 12
1204 #[cfg(feature = "api-12")]
1205 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1206 pub fn OH_ArkUI_DragAction_SetData(
1207 dragAction: *mut ArkUI_DragAction,
1208 data: *mut OH_UdmfData,
1209 ) -> i32;
1210 /// Use this method to provide a data loading parameter to the system instead of providing
1211 /// a complete data object directly. When the user drags and drops to the target application,
1212 /// the system will use this parameter to request data from you. This can greatly improve the efficiency
1213 /// of the dragging operation for large amounts of data and the effectiveness of the drop data handling
1214 /// in the target application.
1215 ///
1216 /// It's recommanded to use this method instead of using [`OH_ArkUI_DragAction_SetData`].
1217 /// See [`OH_UdmfDataLoadParams_Create`] in <b>udmf.h</b> for how to create and prepare the data loading parameter.
1218 ///
1219 /// [Note]: Please be awared this method is conflict with [`OH_ArkUI_DragAction_SetData`], and the system always use
1220 /// the last called method as the final result.
1221 ///
1222 /// # Arguments
1223 ///
1224 /// * `dragAction` - Indicates the pointer to the target drag action object.
1225 ///
1226 /// * `dataLoadParams` - Indicates the data loading parameters which will be used when dropping.
1227 ///
1228 /// # Returns
1229 ///
1230 /// * Returns the result code.
1231 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1232 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1233 ///
1234 /// Available since API-level: 20
1235 #[cfg(feature = "api-20")]
1236 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1237 pub fn OH_ArkUI_DragAction_SetDataLoadParams(
1238 dragAction: *mut ArkUI_DragAction,
1239 dataLoadParams: *mut OH_UdmfDataLoadParams,
1240 ) -> ArkUiResult;
1241 /// Sets an <b>ArkUI_DragPreviewOption</b> object for the specified drag action object.
1242 ///
1243 /// # Arguments
1244 ///
1245 /// * `dragAction` - Indicates the pointer to the target drag action object.
1246 ///
1247 /// * `option` - Indicates the pointer to an <b>ArkUI_DragPreviewOption</b> object.
1248 ///
1249 /// # Returns
1250 ///
1251 /// * Returns the result code.
1252 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1253 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1254 ///
1255 /// Available since API-level: 12
1256 #[cfg(feature = "api-12")]
1257 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1258 pub fn OH_ArkUI_DragAction_SetDragPreviewOption(
1259 dragAction: *mut ArkUI_DragAction,
1260 option: *mut ArkUI_DragPreviewOption,
1261 ) -> i32;
1262 /// Registers a drag status listener.
1263 /// This listener can be used to check whether the data is successfully received and processed.
1264 ///
1265 /// # Arguments
1266 ///
1267 /// * `dragAction` - Indicates the pointer to the target drag action object.
1268 ///
1269 /// * `userData` - Indicates the custom user data.
1270 ///
1271 /// * `listener` - Indicates the listener to register. When the callback is invoked, the system returns a pointer to the drag status
1272 /// object. The pointer is destroyed after the callback is complete and the application should not hold it anymore.
1273 ///
1274 /// # Returns
1275 ///
1276 /// * Returns the result code.
1277 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1278 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1279 ///
1280 /// Available since API-level: 12
1281 #[cfg(feature = "api-12")]
1282 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1283 pub fn OH_ArkUI_DragAction_RegisterStatusListener(
1284 dragAction: *mut ArkUI_DragAction,
1285 userData: *mut ::core::ffi::c_void,
1286 listener: ::core::option::Option<
1287 unsafe extern "C" fn(
1288 dragAndDropInfo: *mut ArkUI_DragAndDropInfo,
1289 userData: *mut ::core::ffi::c_void,
1290 ),
1291 >,
1292 ) -> i32;
1293 /// Unregisters a drag status listener.
1294 ///
1295 /// # Arguments
1296 ///
1297 /// * `dragAction` - Indicates the pointer to the target drag action object.
1298 ///
1299 /// Available since API-level: 12
1300 #[cfg(feature = "api-12")]
1301 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1302 pub fn OH_ArkUI_DragAction_UnregisterStatusListener(dragAction: *mut ArkUI_DragAction);
1303 /// Obtains the drag status of a drag action.
1304 ///
1305 /// # Arguments
1306 ///
1307 /// * `dragAndDropInfo` - Indicates the drag and drop information returned by the drag status listener.
1308 ///
1309 /// # Returns
1310 ///
1311 /// * Returns an <b>ArkUI_DragStatus</b> object; returns <b>ArkUI_DRAG_STATUS_UNKNOWN</b> if an error occurs.
1312 ///
1313 /// Available since API-level: 12
1314 #[cfg(feature = "api-12")]
1315 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1316 pub fn OH_ArkUI_DragAndDropInfo_GetDragStatus(
1317 dragAndDropInfo: *mut ArkUI_DragAndDropInfo,
1318 ) -> ArkUI_DragStatus;
1319 /// Obtains a drag event based on the specified drag and drop information.
1320 /// The drag event can then be used to obtain the drag result and the drag behavior, please note
1321 /// other info is not included in such a drag event.
1322 ///
1323 /// # Arguments
1324 ///
1325 /// * `dragAndDropInfo` - Indicates the drag and drop information returned by the drag status listener.
1326 ///
1327 /// # Returns
1328 ///
1329 /// * Returns an <b>ArkUI_DragEvent</b> object; returns null if an error occurs.
1330 ///
1331 /// Available since API-level: 12
1332 #[cfg(feature = "api-12")]
1333 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1334 pub fn OH_ArkUI_DragAndDropInfo_GetDragEvent(
1335 dragAndDropInfo: *mut ArkUI_DragAndDropInfo,
1336 ) -> *mut ArkUI_DragEvent;
1337 /// Initiates a drag action through the specified drag action object.
1338 ///
1339 /// # Arguments
1340 ///
1341 /// * `dragAction` - Indicates a drag action object.
1342 ///
1343 /// # Returns
1344 ///
1345 /// * Returns the result code.
1346 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1347 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1348 ///
1349 /// Available since API-level: 12
1350 #[cfg(feature = "api-12")]
1351 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1352 pub fn OH_ArkUI_StartDrag(dragAction: *mut ArkUI_DragAction) -> i32;
1353 /// Request to delay the drop end handling for a while to wait until the process result
1354 /// is really conformed by application, the result need to be notified back to system through
1355 /// [`OH_ArkUI_NotifyDragResult`] interface. And when all the handling done, the
1356 /// [`OH_ArkUI_NotifyDragEndPendingDone`] should be called.
1357 /// Please be aware, the maximum pending time is 2 seconds;
1358 ///
1359 /// # Arguments
1360 ///
1361 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
1362 ///
1363 /// * `requestIdentify` - Indicates the Identify for the request initiated by this method, it's a number generated
1364 /// by system automatically, and it's an out parameter too, so one valid address needed.
1365 ///
1366 /// # Returns
1367 ///
1368 /// * Returns the result code.
1369 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1370 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1371 /// Returns [`ARKUI_ERROR_CODE_DRAG_DROP_OPERATION_NOT_ALLOWED`] if current is not during the drop handing.
1372 ///
1373 /// Available since API-level: 19
1374 #[cfg(feature = "api-19")]
1375 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1376 pub fn OH_ArkUI_DragEvent_RequestDragEndPending(
1377 event: *mut ArkUI_DragEvent,
1378 requestIdentify: *mut i32,
1379 ) -> i32;
1380 /// Notify the system final drag result, the request identify will be checked, it should be the same
1381 /// as the one returned by [`OH_ArkUI_DragEvent_RequestDragEndPending`] interface, if it's not,
1382 /// the calling will be ignored.
1383 ///
1384 /// # Arguments
1385 ///
1386 /// * `requestIdentify` - The identify returned by [`OH_ArkUI_DragEvent_RequestDragEndPending`] interface.
1387 ///
1388 /// * `result` - Indicates the drag result.
1389 ///
1390 /// # Returns
1391 ///
1392 /// * Returns the result code.
1393 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1394 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1395 /// Returns [`ARKUI_ERROR_CODE_DRAG_DROP_OPERATION_NOT_ALLOWED`] if current is not during the drop handing.
1396 ///
1397 /// Available since API-level: 19
1398 #[cfg(feature = "api-19")]
1399 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1400 pub fn OH_ArkUI_NotifyDragResult(requestIdentify: i32, result: ArkUI_DragResult) -> i32;
1401 /// Notify the system all handling done, the drag end pending can be finished.
1402 ///
1403 /// # Arguments
1404 ///
1405 /// * `requestIdentify` - The identify returned by [`OH_ArkUI_DragEvent_RequestDragEndPending`] interface.
1406 ///
1407 /// # Returns
1408 ///
1409 /// * Returns the result code.
1410 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1411 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1412 /// Returns [`ARKUI_ERROR_CODE_DRAG_DROP_OPERATION_NOT_ALLOWED`] if current is not during the drop handing.
1413 ///
1414 /// Available since API-level: 19
1415 #[cfg(feature = "api-19")]
1416 #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1417 pub fn OH_ArkUI_NotifyDragEndPendingDone(requestIdentify: i32) -> i32;
1418 /// Use this method to obtain the application bundle name of the drag-and-drop initiator, you need
1419 /// to pass a character array for receiving the string and explicitly specify the array length. It is
1420 /// recommended that the array length be no less than 128 characters. If the length cannot accommodate
1421 /// the actual bundle name length, the ERROR result will be returned.
1422 /// # Arguments
1423 ///
1424 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
1425 ///
1426 /// * `bundleName` - A string array used to receive the source application's bundle name.
1427 ///
1428 /// * `length` - Use this to explicitly specify the length of the incoming string array.
1429 /// It is recommended to be bigger than 128.
1430 ///
1431 /// # Returns
1432 ///
1433 /// * Returns the result code.
1434 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1435 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1436 ///
1437 /// Available since API-level: 20
1438 #[cfg(feature = "api-20")]
1439 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1440 pub fn OH_ArkUI_DragEvent_GetDragSource(
1441 event: *mut ArkUI_DragEvent,
1442 bundleName: *mut ::core::ffi::c_char,
1443 length: i32,
1444 ) -> ArkUiResult;
1445 /// Call this method to determine whether the current drag and drop operation is cross-device.
1446 ///
1447 /// # Arguments
1448 ///
1449 /// * `event` - Indicates the pointer to an <b>ArkUI_DragEvent</b> object.
1450 ///
1451 /// * `isRemote` - Boolean pointer to receive the result.
1452 ///
1453 /// # Returns
1454 ///
1455 /// * Returns the result code.
1456 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1457 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1458 ///
1459 /// Available since API-level: 20
1460 #[cfg(feature = "api-20")]
1461 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1462 pub fn OH_ArkUI_DragEvent_IsRemote(
1463 event: *mut ArkUI_DragEvent,
1464 isRemote: *mut bool,
1465 ) -> ArkUiResult;
1466 /// Sets whether to enable the display of a disallow status icon.
1467 ///
1468 /// Typically, when a component can receive or process data dragged by the user, or when it declares to the
1469 /// system that data should be processed in COPY way by setting ARKUI_DROP_OPERATION_COPY through
1470 /// [`OH_ArkUI_DragEvent_SetSuggestedDropOperation`], the system will display
1471 /// a plus sign together with the data number on the upper-left corner of the dragged object; if setting
1472 /// ARKUI_DROP_OPERATION_MOVE to the system to declare that data should be processed in CUT way, the system will only
1473 /// display the data number on the upper-left corner of the dragged object.
1474 ///
1475 /// In some cases, when the system determines or the component explicitly declares that it cannot handle the
1476 /// data that the user is dragging, the system displays a badge icon in the same way as it does for DragBehavior.MOVE.
1477 /// So if you want to show the more clearly status, you can call this method on the UI instance in advance to force
1478 /// the system to display a clear prohibition icon on the upper left corner in such cases, and the user can clearly
1479 /// know that data cannot be dropped here.
1480 ///
1481 /// # Arguments
1482 ///
1483 /// * `uiContext` - Pointer to a UI instance.
1484 ///
1485 /// * `enabled` - Whether to enable the display of the disallow badge icon.
1486 ///
1487 /// # Returns
1488 ///
1489 /// * Returns the result code.
1490 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
1491 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
1492 ///
1493 /// Available since API-level: 20
1494 #[cfg(feature = "api-20")]
1495 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
1496 pub fn OH_ArkUI_EnableDropDisallowedBadge(
1497 uiContext: ArkUI_ContextHandle,
1498 enabled: bool,
1499 ) -> ArkUiResult;
1500}