Skip to main content

native_dialog/dialog/
message.rs

1use super::Dialog;
2use crate::ffi::UnsafeWindowHandle;
3
4/// The level of the message in the dialog, which usually affects the color or icon in the dialog.
5#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
6pub enum MessageLevel {
7    #[default]
8    Info,
9    Warning,
10    Error,
11}
12
13#[derive(Debug)]
14pub struct MessageAlert {
15    pub title: String,
16    pub text: String,
17    pub level: MessageLevel,
18    pub owner: UnsafeWindowHandle,
19}
20
21impl Dialog for MessageAlert {
22    type Output = ();
23}
24
25impl MessageAlert {
26    super::dialog_delegate!();
27}
28
29#[derive(Debug)]
30pub struct MessageConfirm {
31    pub title: String,
32    pub text: String,
33    pub level: MessageLevel,
34    pub owner: UnsafeWindowHandle,
35}
36
37impl Dialog for MessageConfirm {
38    type Output = bool;
39}
40
41impl MessageConfirm {
42    super::dialog_delegate!();
43}