#[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>,
}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_1Provides 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 ofArkUI_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 isArkUI_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 isArkUI_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