arkui_sys/native_dialog/native_dialog_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
8#[cfg(feature = "api-12")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
10impl ArkUI_DismissReason {
11 /// Touching the system-defined Back button or pressing the Esc key.
12 pub const DIALOG_DISMISS_BACK_PRESS: ArkUI_DismissReason = ArkUI_DismissReason(0);
13 /// Touching the mask.
14 pub const DIALOG_DISMISS_TOUCH_OUTSIDE: ArkUI_DismissReason = ArkUI_DismissReason(1);
15 /// Touching the Close button.
16 pub const DIALOG_DISMISS_CLOSE_BUTTON: ArkUI_DismissReason = ArkUI_DismissReason(2);
17 /// Sliding down.
18 pub const DIALOG_DISMISS_SLIDE_DOWN: ArkUI_DismissReason = ArkUI_DismissReason(3);
19}
20#[repr(transparent)]
21/// Enumerates the actions for triggering closure of the dialog box.
22///
23///
24/// Available since API-level: 12
25#[cfg(feature = "api-12")]
26#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
27#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
28pub struct ArkUI_DismissReason(pub ::core::ffi::c_uint);
29#[cfg(feature = "api-15")]
30#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
31impl ArkUI_LevelMode {
32 /// overlay mode.
33 pub const ARKUI_LEVEL_MODE_OVERLAY: ArkUI_LevelMode = ArkUI_LevelMode(0);
34 /// embedded mode.
35 pub const ARKUI_LEVEL_MODE_EMBEDDED: ArkUI_LevelMode = ArkUI_LevelMode(1);
36}
37#[repr(transparent)]
38/// Enumerates the level mode.
39///
40///
41/// Available since API-level: 15
42#[cfg(feature = "api-15")]
43#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
44#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
45pub struct ArkUI_LevelMode(pub ::core::ffi::c_uint);
46#[cfg(feature = "api-15")]
47#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
48impl ArkUI_ImmersiveMode {
49 /// Mask covering the parent node area.
50 pub const ARKUI_IMMERSIVE_MODE_DEFAULT: ArkUI_ImmersiveMode = ArkUI_ImmersiveMode(0);
51 /// Mask extend safe area includes status bar and navigation bar.
52 pub const ARKUI_IMMERSIVE_MODE_EXTEND: ArkUI_ImmersiveMode = ArkUI_ImmersiveMode(1);
53}
54#[repr(transparent)]
55/// Enumerates the immersive mode.
56///
57///
58/// Available since API-level: 15
59#[cfg(feature = "api-15")]
60#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
61#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
62pub struct ArkUI_ImmersiveMode(pub ::core::ffi::c_uint);
63/// Invoked when the dialog box is closed.
64///
65///
66/// Available since API-level: 12
67#[cfg(feature = "api-12")]
68#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
69pub type ArkUI_OnWillDismissEvent =
70 ::core::option::Option<unsafe extern "C" fn(reason: i32) -> bool>;
71/// Defines a struct for a dialog box dismiss event.
72///
73///
74/// Available since API-level: 12
75#[cfg(feature = "api-12")]
76#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
77#[repr(C)]
78pub struct ArkUI_DialogDismissEvent {
79 _unused: [u8; 0],
80}
81/// Provides the custom dialog box APIs for the native side.
82///
83///
84/// Version: 1
85///
86/// Available since API-level: 12
87#[cfg(feature = "api-12")]
88#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
89#[repr(C)]
90pub struct ArkUI_NativeDialogAPI_1 {
91 /// Creates a custom dialog box and returns the pointer to the created dialog box.
92 ///
93 ///
94 /// **Note:** This method must be called before the <b>show</b> method.
95 ///
96 /// # Returns
97 ///
98 /// * Returns the pointer to the created custom dialog box; returns a null pointer if the creation fails.
99 pub create: ::core::option::Option<unsafe extern "C" fn() -> ArkUI_NativeDialogHandle>,
100 /// Destroys a custom dialog box.
101 ///
102 /// # Arguments
103 ///
104 /// * `handle` - Indicates the pointer to the custom dialog box controller.
105 pub dispose: ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle)>,
106 /// Attaches the content of a custom dialog box.
107 ///
108 ///
109 /// **Note:** This method must be called before the <b>show</b> method.
110 /// # Arguments
111 ///
112 /// * `handle` - Indicates the pointer to the custom dialog box controller.
113 ///
114 /// * `content` - Indicates the pointer to the root node of the custom dialog box content.
115 ///
116 /// # Returns
117 ///
118 /// * Returns the error code.
119 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
120 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
121 pub setContent: ::core::option::Option<
122 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, content: ArkUI_NodeHandle) -> i32,
123 >,
124 /// Detaches the content of a custom dialog box.
125 ///
126 ///
127 /// **Note:** This method must be called before the <b>show</b> method.
128 /// # Arguments
129 ///
130 /// * `handle` - Indicates the pointer to the custom dialog box controller.
131 ///
132 /// # Returns
133 ///
134 /// * Returns the error code.
135 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
136 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
137 pub removeContent:
138 ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle) -> i32>,
139 /// Sets the alignment mode for a custom dialog box.
140 ///
141 ///
142 /// **Note:** This method must be called before the <b>show</b> method.
143 /// # Arguments
144 ///
145 /// * `handle` - Indicates the pointer to the custom dialog box controller.
146 ///
147 /// * `alignment` - Indicates the alignment mode. The parameter type is [`ArkUI_Alignment`].
148 ///
149 /// * `offsetX` - Indicates the horizontal offset of the custom dialog box. The value is a floating point number.
150 ///
151 /// * `offsetY` - Indicates the vertical offset of the custom dialog box. The value is a floating point number.
152 ///
153 /// # Returns
154 ///
155 /// * Returns the error code.
156 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
157 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
158 pub setContentAlignment: ::core::option::Option<
159 unsafe extern "C" fn(
160 handle: ArkUI_NativeDialogHandle,
161 alignment: i32,
162 offsetX: f32,
163 offsetY: f32,
164 ) -> i32,
165 >,
166 /// Resets the alignment mode of a custom dialog box to its default settings.
167 ///
168 ///
169 /// **Note:** This method must be called before the <b>show</b> method.
170 /// # Arguments
171 ///
172 /// * `handle` - Indicates the pointer to the custom dialog box controller.
173 ///
174 /// # Returns
175 ///
176 /// * Returns the error code.
177 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
178 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
179 pub resetContentAlignment:
180 ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle) -> i32>,
181 /// Sets the modal mode for a custom dialog box.
182 ///
183 ///
184 /// **Note:** This method must be called before the <b>show</b> method.
185 /// # Arguments
186 ///
187 /// * `handle` - Indicates the pointer to the custom dialog box controller.
188 ///
189 /// * `isModal` - Specifies whether the custom dialog box is a modal, which has a mask applied. The value
190 /// <b>true</b> means that the custom dialog box is a modal, and <b>false</b> means the opposite.
191 ///
192 /// # Returns
193 ///
194 /// * Returns the error code.
195 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
196 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
197 pub setModalMode: ::core::option::Option<
198 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, isModal: bool) -> i32,
199 >,
200 /// Specifies whether to allow users to touch the mask to dismiss the custom dialog box.
201 ///
202 ///
203 /// **Note:** This method must be called before the <b>show</b> method.
204 /// # Arguments
205 ///
206 /// * `handle` - Indicates the pointer to the custom dialog box controller.
207 ///
208 /// * `autoCancel` - Specifies whether to allow users to touch the mask to dismiss the dialog box.
209 /// The value <b>true</b> means to allow users to do so, and <b>false</b> means the opposite.
210 ///
211 /// # Returns
212 ///
213 /// * Returns the error code.
214 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
215 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
216 pub setAutoCancel: ::core::option::Option<
217 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, autoCancel: bool) -> i32,
218 >,
219 /// Sets the mask for a custom dialog box.
220 ///
221 ///
222 /// **Note:** This method must be called before the <b>show</b> method.
223 /// # Arguments
224 ///
225 /// * `handle` - Indicates the pointer to the custom dialog box controller.
226 ///
227 /// * `maskColor` - Indicates the mask color, in 0xARGB format.
228 ///
229 /// * `maskRect` - Indicates the pointer to the mask area. Events outside the mask area are transparently
230 /// transmitted, and events within the mask area are not. The parameter type is [`ArkUI_Rect`].
231 ///
232 /// # Returns
233 ///
234 /// * Returns the error code.
235 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
236 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
237 pub setMask: ::core::option::Option<
238 unsafe extern "C" fn(
239 handle: ArkUI_NativeDialogHandle,
240 maskColor: u32,
241 maskRect: *const ArkUI_Rect,
242 ) -> i32,
243 >,
244 /// Sets the background color for a custom dialog box.
245 ///
246 ///
247 /// **Note:** This method must be called before the <b>show</b> method.
248 /// # Arguments
249 ///
250 /// * `handle` - Indicates the pointer to the custom dialog box controller.
251 ///
252 /// * `backgroundColor` - Indicates the background color of the custom dialog box, in 0xARGB format.
253 ///
254 /// # Returns
255 ///
256 /// * Returns the error code.
257 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
258 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
259 pub setBackgroundColor: ::core::option::Option<
260 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, backgroundColor: u32) -> i32,
261 >,
262 /// Sets the background corner radius for a custom dialog box.
263 ///
264 ///
265 /// **Note:** This method must be called before the <b>show</b> method.
266 /// # Arguments
267 ///
268 /// * `handle` - Indicates the pointer to the custom dialog box controller.
269 ///
270 /// * `topLeft` - Indicates the radius of the upper left corner of the custom dialog box background.
271 ///
272 /// * `topRight` - Indicates the radius of the upper right corner of the custom dialog box background.
273 ///
274 /// * `bottomLeft` - Indicates the radius of the lower left corner of the custom dialog box background.
275 ///
276 /// * `bottomRight` - Indicates the radius of the lower right corner of the custom dialog box background.
277 ///
278 /// # Returns
279 ///
280 /// * Returns the error code.
281 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
282 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
283 pub setCornerRadius: ::core::option::Option<
284 unsafe extern "C" fn(
285 handle: ArkUI_NativeDialogHandle,
286 topLeft: f32,
287 topRight: f32,
288 bottomLeft: f32,
289 bottomRight: f32,
290 ) -> i32,
291 >,
292 /// Sets the number of grid columns occupied by a custom dialog box.
293 ///
294 ///
295 /// **Note:** This method must be called before the <b>show</b> method.
296 /// # Arguments
297 ///
298 /// * `handle` - Indicates the pointer to the custom dialog box controller.
299 ///
300 /// * `gridCount` - Indicates the number of grid columns occupied by the dialog box. The default value is subject to
301 /// the window size, and the maximum value is the maximum number of columns supported by the system.
302 ///
303 /// # Returns
304 ///
305 /// * Returns the error code.
306 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
307 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
308 pub setGridColumnCount: ::core::option::Option<
309 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, gridCount: i32) -> i32,
310 >,
311 /// Specifies whether to use a custom style for the custom dialog box.
312 ///
313 ///
314 /// **Note:** This method must be called before the <b>show</b> method.
315 /// # Arguments
316 ///
317 /// * `handle` - Indicates the pointer to the custom dialog box controller.
318 ///
319 /// * `enableCustomStyle` - Specifies whether to use a custom style for the dialog box.
320 /// <b>true</b>: The dialog box automatically adapts its width to the child components; the rounded corner is 0;
321 /// the background color is transparent.
322 /// <b>false</b>: The dialog box automatically adapts its width to the grid system and its height to the child
323 /// components; the rounded corner is 24 vp.
324 ///
325 /// # Returns
326 ///
327 /// * Returns the error code.
328 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
329 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
330 pub enableCustomStyle: ::core::option::Option<
331 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, enableCustomStyle: bool) -> i32,
332 >,
333 /// Specifies whether to use a custom animation for a custom dialog box.
334 ///
335 ///
336 /// **Note:** This method must be called before the <b>show</b> method.
337 /// # Arguments
338 ///
339 /// * `handle` - Indicates the pointer to the custom dialog box controller.
340 ///
341 /// * `enableCustomAnimation` - Specifies whether to use a custom animation. The value <b>true</b> means to use a
342 /// custom animation, and <b>false</b> means to use the default animation.
343 ///
344 /// # Returns
345 ///
346 /// * Returns the error code.
347 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
348 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
349 pub enableCustomAnimation: ::core::option::Option<
350 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, enableCustomAnimation: bool) -> i32,
351 >,
352 /// Registers a callback for a custom dialog box so that the user can decide whether to close the dialog box
353 /// after they touch the Back button or press the Esc key.
354 ///
355 ///
356 /// **Note:** This method must be called before the <b>show</b> method.
357 /// # Arguments
358 ///
359 /// * `handle` - Indicates the pointer to the custom dialog box controller.
360 ///
361 /// * `eventHandler` - Indicates the callback to register. The parameter type is [`ArkUI_OnWillDismissEvent`].
362 ///
363 /// # Returns
364 ///
365 /// * Returns the error code.
366 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
367 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
368 pub registerOnWillDismiss: ::core::option::Option<
369 unsafe extern "C" fn(
370 handle: ArkUI_NativeDialogHandle,
371 eventHandler: ArkUI_OnWillDismissEvent,
372 ) -> i32,
373 >,
374 /// Shows a custom dialog box.
375 ///
376 /// # Arguments
377 ///
378 /// * `handle` - Indicates the pointer to the custom dialog box controller.
379 ///
380 /// * `showInSubWindow` - Specifies whether to show the dialog box in a sub-window.
381 ///
382 /// # Returns
383 ///
384 /// * Returns the error code.
385 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
386 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
387 pub show: ::core::option::Option<
388 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, showInSubWindow: bool) -> i32,
389 >,
390 /// Closes a custom dialog box. If the dialog box has been closed, this API does not take effect.
391 ///
392 /// # Arguments
393 ///
394 /// * `handle` - Indicates the pointer to the custom dialog box controller.
395 ///
396 /// # Returns
397 ///
398 /// * Returns the error code.
399 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
400 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
401 pub close:
402 ::core::option::Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle) -> i32>,
403 /// Registers a listener for the dismiss event of the custom dialog box.
404 ///
405 /// # Arguments
406 ///
407 /// * `handle` - Indicates the pointer to the custom dialog box controller.
408 ///
409 /// * `userData` - Indicates the pointer to the custom data.
410 ///
411 /// * `callback` - Indicates the callback for the dismiss event of the custom dialog box.
412 ///
413 /// # Returns
414 ///
415 /// * Returns the result code.
416 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
417 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
418 pub registerOnWillDismissWithUserData: ::core::option::Option<
419 unsafe extern "C" fn(
420 handle: ArkUI_NativeDialogHandle,
421 userData: *mut ::core::ffi::c_void,
422 callback: ::core::option::Option<
423 unsafe extern "C" fn(event: *mut ArkUI_DialogDismissEvent),
424 >,
425 ) -> i32,
426 >,
427}
428/// Provides the custom dialog box APIs for the native side.
429///
430///
431/// Version: 2
432///
433/// Available since API-level: 15
434#[cfg(feature = "api-15")]
435#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
436#[repr(C)]
437pub struct ArkUI_NativeDialogAPI_2 {
438 /// Provides the custom dialog box APIs for the native side. The API scope is [`ArkUI_NativeDialogAPI_1`]
439 ///
440 ///
441 /// Available since API-level: 15
442 pub nativeDialogAPI1: ArkUI_NativeDialogAPI_1,
443 /// Defines the distance between the customDialog and system keyboard.
444 ///
445 ///
446 /// **Note:** This method must be called before the <b>show</b> method.
447 /// # Arguments
448 ///
449 /// * `handle` - Indicates the pointer to the custom dialog box controller.
450 ///
451 /// * `distance` - distance, in vp.
452 ///
453 /// * `unit` - Indicates the unit, which is an enumerated value of [`ArkUI_LengthMetricUnit`]
454 ///
455 /// # Returns
456 ///
457 /// * Returns the result code.
458 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
459 /// Returns [`ARKUI_ERROR_CODE_CAPI_INIT_ERROR`] if the CAPI init error.
460 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
461 ///
462 /// Available since API-level: 15
463 pub setKeyboardAvoidDistance: ::core::option::Option<
464 unsafe extern "C" fn(
465 handle: ArkUI_NativeDialogHandle,
466 distance: f32,
467 unit: ArkUI_LengthMetricUnit,
468 ) -> i32,
469 >,
470 /// Sets the level mode for a custom dialog box.
471 ///
472 ///
473 /// **Note:** This method must be called before the <b>show</b> method.
474 /// # Arguments
475 ///
476 /// * `handle` - Indicates the pointer to the custom dialog box controller.
477 ///
478 /// * `levelMode` - Indicates the level mode. The parameter type is [`ArkUI_LevelMode`].
479 ///
480 /// # Returns
481 ///
482 /// * Returns the error code.
483 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
484 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
485 ///
486 /// Available since API-level: 15
487 pub setLevelMode: ::core::option::Option<
488 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, levelMode: ArkUI_LevelMode) -> i32,
489 >,
490 /// Sets the level uniqueId for a custom dialog box.
491 ///
492 ///
493 /// **Note:** This method must be called before the <b>setLevelMode</b> method.
494 /// # Arguments
495 ///
496 /// * `handle` - Indicates the pointer to the custom dialog box controller.
497 ///
498 /// * `uniqueId` - Indicates the uniquedId of any nodes in router or navigation pages.
499 ///
500 /// # Returns
501 ///
502 /// * Returns the error code.
503 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
504 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
505 ///
506 /// Available since API-level: 15
507 pub setLevelUniqueId: ::core::option::Option<
508 unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, uniqueId: i32) -> i32,
509 >,
510 /// Sets the immersive mode for a custom dialog box.
511 ///
512 ///
513 /// **Note:** This method must be called before the <b>show</b> method.
514 /// # Arguments
515 ///
516 /// * `handle` - Indicates the pointer to the custom dialog box controller.
517 ///
518 /// * `immersiveMode` - Indicates the immersive mode. The parameter type is [`ArkUI_ImmersiveMode`].
519 ///
520 /// # Returns
521 ///
522 /// * Returns the error code.
523 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
524 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
525 ///
526 /// Available since API-level: 15
527 pub setImmersiveMode: ::core::option::Option<
528 unsafe extern "C" fn(
529 handle: ArkUI_NativeDialogHandle,
530 immersiveMode: ArkUI_ImmersiveMode,
531 ) -> i32,
532 >,
533}
534extern "C" {
535 /// Sets whether to block the system behavior of dismissing a dialog box.
536 ///
537 /// # Arguments
538 ///
539 /// * `event` - Indicates the pointer to a dialog box dismiss event object.
540 ///
541 /// * `shouldBlockDismiss` - Indicates whether to block the system behavior of dismissing the dialog box. The value
542 /// <b>true</b> means to block the system behavior, and <b>false</b> means the opposite.
543 ///
544 /// Available since API-level: 12
545 #[cfg(feature = "api-12")]
546 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
547 pub fn OH_ArkUI_DialogDismissEvent_SetShouldBlockDismiss(
548 event: *mut ArkUI_DialogDismissEvent,
549 shouldBlockDismiss: bool,
550 );
551 /// Obtains the pointer to user data in a dialog box dismiss event object.
552 ///
553 /// # Arguments
554 ///
555 /// * `event` - Indicates the pointer to a dialog box dismiss event object.
556 ///
557 ///
558 /// # Returns
559 ///
560 /// * Returns the pointer to user data.
561 ///
562 /// Available since API-level: 12
563 #[cfg(feature = "api-12")]
564 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
565 pub fn OH_ArkUI_DialogDismissEvent_GetUserData(
566 event: *mut ArkUI_DialogDismissEvent,
567 ) -> *mut ::core::ffi::c_void;
568 /// Obtains the c from a dialog box dismiss event object.
569 ///
570 /// # Arguments
571 ///
572 /// * `event` - Indicates the pointer to a dialog box dismiss event object.
573 ///
574 ///
575 /// # Returns
576 ///
577 /// * Returns the dismissal reason. Returns <b>-1</b> if an exception occurs.
578 /// [`DIALOG_DISMISS_BACK_PRESS`]: touching the Back button, swiping left or right on the screen, or
579 /// pressing the Esc key.
580 /// [`DIALOG_DISMISS_TOUCH_OUTSIDE`]: touching the mask.
581 /// [`DIALOG_DISMISS_CLOSE_BUTTON`]: touching the Close button.
582 /// [`DIALOG_DISMISS_SLIDE_DOWN`]: sliding down.
583 ///
584 /// Available since API-level: 12
585 #[cfg(feature = "api-12")]
586 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
587 pub fn OH_ArkUI_DialogDismissEvent_GetDismissReason(
588 event: *mut ArkUI_DialogDismissEvent,
589 ) -> i32;
590}