use crate::{platform::NotificationApi, platform_impl::NotificationImpl, ActiveApplication};
#[derive(Debug, Default)]
pub struct NotificationBuilder {
title: Option<String>,
message: Option<String>,
action: Option<String>,
}
impl NotificationBuilder {
pub fn new() -> Self {
Self {
..Default::default()
}
}
pub fn with_title<S>(mut self, title: S) -> Self
where
S: Into<String>,
{
self.title = Some(title.into());
self
}
pub fn with_message<S>(mut self, message: S) -> Self
where
S: Into<String>,
{
self.message = Some(message.into());
self
}
pub fn with_action<S>(mut self, action: S) -> Self
where
S: Into<String>,
{
self.action = Some(action.into());
self
}
pub fn build(self, app: &ActiveApplication) {
NotificationImpl::show(app, self.title, self.message, self.action);
}
}