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