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, PartialEq, Eq)]
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
18#[derive(Debug)]
19pub struct MessageAlert {
20    pub title: String,
21    pub text: String,
22    pub level: MessageLevel,
23    pub owner: UnsafeWindowHandle,
24}
25
26impl Dialog for MessageAlert {
27    type Output = ();
28}
29
30impl MessageAlert {
31    super::dialog_delegate!();
32}
33
34#[derive(Debug)]
35pub struct MessageConfirm {
36    pub title: String,
37    pub text: String,
38    pub level: MessageLevel,
39    pub owner: UnsafeWindowHandle,
40}
41
42impl Dialog for MessageConfirm {
43    type Output = bool;
44}
45
46impl MessageConfirm {
47    super::dialog_delegate!();
48}