forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifications.h
55 lines (44 loc) · 1.38 KB
/
notifications.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include <string>
#include <string_view>
#include <vector>
#include <variant>
#include <optional>
namespace notifications
{
constexpr inline const wchar_t TOAST_ACTIVATED_LAUNCH_ARG[] = L"-ToastActivated";
void register_background_toast_handler();
void run_desktop_app_activator_loop();
struct snooze_duration
{
std::wstring label;
int minutes;
};
struct snooze_button
{
std::wstring snooze_title;
std::vector<snooze_duration> durations;
};
struct link_button
{
std::wstring label;
std::wstring url;
bool context_menu = false;
};
struct background_activated_button
{
std::wstring label;
bool context_menu = false;
};
struct toast_params
{
std::optional<std::wstring_view> tag;
bool resend_if_scheduled = true;
std::optional<float> progress;
std::optional<std::wstring_view> subtitle;
};
using action_t = std::variant<link_button, background_activated_button, snooze_button>;
void show_toast(std::wstring plaintext_message, toast_params params = {});
void show_toast_with_activations(std::wstring plaintext_message, std::wstring_view background_handler_id, std::vector<action_t> actions, toast_params params = {});
void update_progress_bar_toast(std::wstring plaintext_message, toast_params params);
}