pub struct Dialog { /* private fields */ }Expand description
High-level dialog wrapper for creating and controlling native dialogs.
Implementations§
Source§impl Dialog
impl Dialog
Sourcepub fn new() -> ArkUIResult<Self>
pub fn new() -> ArkUIResult<Self>
Create a new dialog controller.
Sourcepub fn content<T: Into<ArkUINode>>(&self, content: T) -> ArkUIResult<()>
pub fn content<T: Into<ArkUINode>>(&self, content: T) -> ArkUIResult<()>
Set dialog content node.
Sourcepub fn show(&self) -> ArkUIResult<()>
pub fn show(&self) -> ArkUIResult<()>
Show the dialog in current window.
Sourcepub fn show_with_sub_window(&self) -> ArkUIResult<()>
pub fn show_with_sub_window(&self) -> ArkUIResult<()>
Show the dialog in sub-window mode.
Sourcepub fn close(&self) -> ArkUIResult<()>
pub fn close(&self) -> ArkUIResult<()>
Close the dialog.
pub fn modal_mode(&self, modal_mode: bool) -> ArkUIResult<()>
pub fn auto_cancel(&self, auto_cancel: bool) -> ArkUIResult<()>
pub fn background_color(&self, color: u32) -> ArkUIResult<()>
Sourcepub fn content_alignment(&self, alignment: Alignment) -> ArkUIResult<()>
pub fn content_alignment(&self, alignment: Alignment) -> ArkUIResult<()>
Set content alignment, offset_x and offset_y will be set with 0.0
Sourcepub fn content_alignment_with_offset(
&self,
alignment: Alignment,
offset_x: f32,
offset_y: f32,
) -> ArkUIResult<()>
pub fn content_alignment_with_offset( &self, alignment: Alignment, offset_x: f32, offset_y: f32, ) -> ArkUIResult<()>
Set content alignment with offset_x and offset_y.
pub fn corner_radius( &self, top_left: f32, top_right: f32, bottom_left: f32, bottom_right: f32, ) -> ArkUIResult<()>
pub fn on_will_dismiss( &self, callback: fn(DialogDismissData) -> Option<bool>, ) -> ArkUIResult<()>
Sourcepub fn on_will_dismiss_with_data<T: 'static>(
&self,
data: T,
callback: fn(data: DialogDismissData) -> Option<bool>,
) -> ArkUIResult<()>
pub fn on_will_dismiss_with_data<T: 'static>( &self, data: T, callback: fn(data: DialogDismissData) -> Option<bool>, ) -> ArkUIResult<()>
For user custom data, you can use this method And you need to convert raw pointer to your data type after callback
Auto Trait Implementations§
impl !RefUnwindSafe for Dialog
impl !Send for Dialog
impl !Sync for Dialog
impl !UnwindSafe for Dialog
impl Freeze for Dialog
impl Unpin for Dialog
impl UnsafeUnpin for Dialog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more