ArkUI_NativeDialogAPI_2

Struct ArkUI_NativeDialogAPI_2 

Source
#[repr(C)]
pub struct ArkUI_NativeDialogAPI_2 { pub nativeDialogAPI1: ArkUI_NativeDialogAPI_1, pub setKeyboardAvoidDistance: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, distance: f32, unit: ArkUI_LengthMetricUnit) -> i32>, pub setLevelMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, levelMode: ArkUI_LevelMode) -> i32>, pub setLevelUniqueId: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, uniqueId: i32) -> i32>, pub setImmersiveMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, immersiveMode: ArkUI_ImmersiveMode) -> i32>, }
Available on crate features api-12 and api-15 only.
Expand description

Provides the custom dialog box APIs for the native side.

Version: 2

Available since API-level: 15

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: 15

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

Defines the distance between the customDialog and system keyboard.

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

§Arguments

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

  • distance - distance, in vp.

  • unit - Indicates the unit, which is an enumerated value of ArkUI_LengthMetricUnit

§Returns

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

Available since API-level: 15

§setLevelMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, levelMode: ArkUI_LevelMode) -> i32>

Sets the level mode 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.

  • levelMode - Indicates the level mode. The parameter type is ArkUI_LevelMode.

§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: 15

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

Sets the level uniqueId for a custom dialog box.

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

§Arguments

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

  • uniqueId - Indicates the uniquedId of any nodes in router or navigation pages.

§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: 15

§setImmersiveMode: Option<unsafe extern "C" fn(handle: ArkUI_NativeDialogHandle, immersiveMode: ArkUI_ImmersiveMode) -> i32>

Sets the immersive mode 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.

  • immersiveMode - Indicates the immersive mode. The parameter type is ArkUI_ImmersiveMode.

§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: 15

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.