ArkUI_NativeDialogAPI_3

Struct ArkUI_NativeDialogAPI_3 

Source
#[repr(C)]
pub struct ArkUI_NativeDialogAPI_3 {
Show 21 fields pub nativeDialogAPI1: ArkUI_NativeDialogAPI_1, pub nativeDialogAPI2: ArkUI_NativeDialogAPI_2, pub setLevelOrder: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, levelOrder: f64) -> i32>, pub registerOnWillAppear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>, pub registerOnDidAppear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>, pub registerOnWillDisappear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>, pub registerOnDidDisappear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>, pub setBorderWidth: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, top: f32, right: f32, bottom: f32, left: f32, unit: ArkUI_LengthMetricUnit) -> i32>, pub setBorderColor: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, top: u32, right: u32, bottom: u32, left: u32) -> i32>, pub setBorderStyle: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, top: i32, right: i32, bottom: i32, left: i32) -> i32>, pub setWidth: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, width: f32, unit: ArkUI_LengthMetricUnit) -> i32>, pub setHeight: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, height: f32, unit: ArkUI_LengthMetricUnit) -> i32>, pub setShadow: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, shadow: ArkUI_ShadowStyle) -> i32>, pub setCustomShadow: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, customShadow: *const ArkUI_AttributeItem) -> i32>, pub setBackgroundBlurStyle: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, blurStyle: ArkUI_BlurStyle) -> i32>, pub setKeyboardAvoidMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, keyboardAvoidMode: ArkUI_KeyboardAvoidMode) -> i32>, pub enableHoverMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, enableHoverMode: bool) -> i32>, pub setHoverModeArea: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, hoverModeAreaType: ArkUI_HoverModeAreaType) -> i32>, pub setFocusable: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, focusable: bool) -> i32>, pub setBackgroundBlurStyleOptions: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, backgroundBlurStyleOptions: *const ArkUI_AttributeItem) -> i32>, pub setBackgroundEffect: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, backgroundEffect: *const ArkUI_AttributeItem) -> i32>,
}
Available on crate features api-12 and api-19 only.
Expand description

Provides the custom dialog box APIs for the native side.

Version: 3

Available since API-level: 19

Fields§

§nativeDialogAPI1: ArkUI_NativeDialogAPI_1

Provides the custom dialog box APIs for the native side. The API scope is ArkUI_NativeDialogAPI_1

Available since API-level: 19

§nativeDialogAPI2: ArkUI_NativeDialogAPI_2

Provides the custom dialog box APIs for the native side. The API scope is ArkUI_NativeDialogAPI_2

Available since API-level: 19

§setLevelOrder: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, levelOrder: f64) -> i32>

Sets the display order for a custom dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • levelOrder - Indicates the display order. The valid range is [-100000.0, 100000.0].

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

§registerOnWillAppear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>

Registers a listener callback before the dialog openAnimation starts.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • userData - Indicates the pointer to the custom data.

  • callback - Indicates the callback before the dialog openAnimation starts.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

§registerOnDidAppear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>

Registers a listener callback when the dialog appears.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • userData - Indicates the pointer to the custom data.

  • callback - Indicates the callback when the dialog appears.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

§registerOnWillDisappear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>

Registers a listener callback before the dialog closeAnimation starts.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • userData - Indicates the pointer to the custom data.

  • callback - Indicates the callback before the dialog closeAnimation starts.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

§registerOnDidDisappear: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, userData: *mut c_void, callback: Option<unsafe extern "C" fn(userData: *mut c_void)>) -> i32>

Registers a listener callback when the dialog disappears.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • userData - Indicates the pointer to the custom data.

  • callback - Indicates the callback when the dialog disappears.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

§setBorderWidth: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, top: f32, right: f32, bottom: f32, left: f32, unit: ArkUI_LengthMetricUnit) -> i32>

Sets the border width of the dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • top - Width of the top border.

  • right - Width of the right border.

  • bottom - Width of the bottom border.

  • left - Width of the left border.

  • unit - Unit of the width. The default value is vp.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setBorderColor: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, top: u32, right: u32, bottom: u32, left: u32) -> i32>

Sets the border color of the dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • top - Color of the top border.

  • right - Color of the right border.

  • bottom - Color of the bottom border.

  • left - Color of the left border.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setBorderStyle: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, top: i32, right: i32, bottom: i32, left: i32) -> i32>

Sets the border style of the dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • top - Style of the top border.

  • right - Style of the right border.

  • bottom - Style of the bottom border.

  • left - Style of the left border.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setWidth: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, width: f32, unit: ArkUI_LengthMetricUnit) -> i32>

Sets the width of the dialog box background.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • width - Width of the background.

  • unit - Unit of the width. The default value is vp.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setHeight: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, height: f32, unit: ArkUI_LengthMetricUnit) -> i32>

Sets the height of the dialog box background.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • height - Height of the background.

  • unit - Unit of the height. The default value is vp.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setShadow: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, shadow: ArkUI_ShadowStyle) -> i32>

Sets the shadow of the dialog box background.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • shadow - Shadow style of the background, specified by an enumerated value.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setCustomShadow: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, customShadow: *const ArkUI_AttributeItem) -> i32>

Sets the custom shadow of the dialog box background.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • customShadow - Custom shadow parameter. The format is the same as that of the NODE_SHADOW property.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setBackgroundBlurStyle: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, blurStyle: ArkUI_BlurStyle) -> i32>

Sets the background blur style of the dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • blurStyle - Background blur style, specified by an enumerated value.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setKeyboardAvoidMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, keyboardAvoidMode: ArkUI_KeyboardAvoidMode) -> i32>

Sets the keyboard avoidance mode of the dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • keyboardAvoidMode - Keyboard avoidance mode, specified by an enumerated value.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§enableHoverMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, enableHoverMode: bool) -> i32>

Sets whether to enable the hover mode for the dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • enableHoverMode - Whether to enable the hover mode. The default value is false.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur..

Available since API-level: 19

§setHoverModeArea: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, hoverModeAreaType: ArkUI_HoverModeAreaType) -> i32>

Set the default display area of the dialog box in hover mode.

Note: This method must be called before the show method.

§Arguments

  • handle - Pointer to the dialog box controller.

  • hoverModeAreaType - Display area in hover mode, specified by an enumerated value.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occur.

Available since API-level: 19

§setFocusable: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, focusable: bool) -> i32>

Sets whether to get focus when the custom dialog is displayed.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • focusable - Specifies whether to get focus when the custom dialog is displayed. The default value is true.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

§setBackgroundBlurStyleOptions: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, backgroundBlurStyleOptions: *const ArkUI_AttributeItem) -> i32>

Sets the background blur effect for a custom dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • backgroundBlurStyleOptions - Background blur effect options. Format of the ArkUI_AttributeItem parameter:

.value[0].i32: color mode. The value is an enum of ArkUI_ColorMode.

.value[1]?.i32: adaptive color mode. The value is an enum of ArkUI_AdaptiveColor.

.value[2]?.f32: blur degree. The value range is [0.0, 1.0].

.value[3]?.u32: brightness of black in the grayscale blur. The value range is [0, 127].

.value[4]?.u32: degree of darkening the white color in the grayscale blur. The value range is [0, 127].

.value[5]?.i32: blur activation policy. The value is an enum of ArkUI_BlurStyleActivePolicy.

.value[6]?.u32: background color, in 0xARGB format, of the components within the window after the window loses focus (in which case, the blur effect on the components within the window is removed).

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

§setBackgroundEffect: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, backgroundEffect: *const ArkUI_AttributeItem) -> i32>

Sets the background effect parameters for a custom dialog box.

Note: This method must be called before the show method.

§Arguments

  • handle - Indicates the pointer to the custom dialog box controller.

  • backgroundEffect - Background effect. Format of the ArkUI_AttributeItem parameter:

.value[0].f32: blur radius, in vp.

.value[1]?.f32: saturation.

.value[2]?.f32: brightness.

.value[3]?.u32: color, in 0xARGB format.

.value[4]?.i32: adaptive color mode. The value is an enum of ArkUI_AdaptiveColor.

.value[5]?.u32: brightness of black in the grayscale blur. The value range is [0, 127].

.value[6]?.u32: degree of darkening the white color in the grayscale blur. The value range is [0, 127].

.value[7]?.i32: blur activation policy. The value is an enum of ArkUI_BlurStyleActivePolicy.

.value[8]?.u32: background color, in 0xARGB format, of the components within the window after the window loses focus (in which case, the blur effect on the components within the window is removed).

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 19

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.