Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
notification_manager.hpp
Go to the documentation of this file.
1/*
2Borealis, a Nintendo Switch UI Library
3Copyright (C) 2019 natinusala
4Copyright (C) 2024 xfangfang
5
6This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
23#include <aurore/core/box.hpp>
25
26// TODO: check in HOS that the animation duration + notification timeout are correct
27namespace aurore
28{
29
30class Notification : public Box
31{
32 public:
33 // `leading` (an icon, owned by the notification) before the text.
34 explicit Notification(const std::string& text, View* leading = nullptr);
35 ~Notification() override;
36
38
39 private:
40 Label* label;
41};
42
44{
45 public:
48
49 void notify(const std::string& text, View* leading = nullptr);
50};
51
52}; // namespace aurore
Definition animation.hpp:42
Generic FlexBox layout.
Definition box.hpp:74
Definition label.hpp:65
Definition notification_manager.hpp:44
void notify(const std::string &text, View *leading=nullptr)
Definition notification_manager.hpp:31
Animatable timeoutTimer
Definition notification_manager.hpp:37
Notification(const std::string &text, View *leading=nullptr)
~Notification() override
Definition view.hpp:232
Definition actions.hpp:25
Definition text.hpp:13