Albert
Loading...
Searching...
No Matches
notification.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <QObject>
6#include <albert/export.h>
7
8namespace albert
9{
10
17class ALBERT_EXPORT Notification final : public QObject
18{
19 Q_OBJECT
20
21public:
22
23 Notification(const QString &title = {},
24 const QString &text = {},
25 QObject *parent = nullptr);
27
30 const QString &title() const;
31
34 void setTitle(const QString &title);
35
38 const QString &text() const;
39
42 void setText(const QString &text);
43
47 void send();
48
51 void dismiss();
52
53signals:
54
57 void activated();
58
59private:
60
61 class ALBERT_NO_EXPORT Private;
62 std::unique_ptr<Private> d;
63 friend class ALBERT_NO_EXPORT QNotificationManager;
64
65};
66
67}
The notification class.
Definition notification.h:18
Notification(const QString &title={}, const QString &text={}, QObject *parent=nullptr)
void send()
Send the notification to the notification server.
void activated()
Emitted when the notification is activated.
void setTitle(const QString &title)
Set the title of the notification.
const QString & text() const
The text of the notification.
void dismiss()
Dismiss the notification.
const QString & title() const
The title of the notification.
void setText(const QString &text)
Set the text of the notification.
Definition action.h:10