native_dialog/dialog/
message.rs

1use super::Dialog;
2use crate::utils::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)]
6pub enum MessageLevel {
7    Info,
8    Warning,
9    Error,
10}
11
12impl Default for MessageLevel {
13    fn default() -> Self {
14        Self::Info
15    }
16}
17
18pub struct MessageAlert {
19    pub title: String,
20    pub text: String,
21    pub level: MessageLevel,
22    pub owner: UnsafeWindowHandle,
23}
24
25impl Dialog for MessageAlert {
26    type Output = ();
27}
28
29impl MessageAlert {
30    super::dialog_delegate!();
31}
32
33pub struct MessageConfirm {
34    pub title: String,
35    pub text: String,
36    pub level: MessageLevel,
37    pub owner: UnsafeWindowHandle,
38}
39
40impl Dialog for MessageConfirm {
41    type Output = bool;
42}
43
44impl MessageConfirm {
45    super::dialog_delegate!();
46}