system_extensions/notifications/
notification.rs1pub struct SimpleNotification {
10 pub(crate) title: String,
11 pub(crate) text: Vec<String>,
12 pub(crate) app_logo: String,
13 pub(crate) hero_image: String,
14 pub(crate) app_id: String,
15}
16
17impl SimpleNotification {
18 pub fn new(title: String) -> SimpleNotification {
22 SimpleNotification {
23 title,
24 text: vec![],
25 app_logo: "".to_string(),
26 hero_image: "".to_string(),
27 app_id: "".to_string()
28 }
29 }
30
31 pub fn set_title(mut self, title: String) -> Self{
35 self.title = title;
36 self
37 }
38
39 pub fn add_text(mut self, line: String) -> Self {
40 self.text.push(line);
41 self
42 }
43
44 pub fn set_text(mut self, text: Vec<String>) -> Self{
45 self.text = text;
46 self
47 }
48
49 pub fn set_app_logo(mut self, app_logo: String) -> Self {
53 self.app_logo = app_logo;
54 self
55 }
56
57 pub fn set_hero_image(mut self, hero_image: String) -> Self {
61 self.hero_image = hero_image;
62 self
63 }
64
65 pub fn set_app_id(mut self, app_id: String) -> Self {
69 self.app_id = app_id;
70 self
71 }
72
73 pub fn display(self) {
77 crate::internal::notifications::send_simple_notification(self);
78 }
79}