Albert
Loading...
Searching...
No Matches
notification.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <QObject>
6#include <albert/export.h>
7
8namespace albert
9{
10
19class ALBERT_EXPORT Notification final : public QObject
20{
21 Q_OBJECT
22
23public:
24
28 Notification(const QString &title = {},
29 const QString &text = {},
30 QObject *parent = nullptr);
31
36
40 const QString &title() const;
41
45 void setTitle(const QString &title);
46
50 const QString &text() const;
51
55 void setText(const QString &text);
56
63 void send();
64
70 void dismiss();
71
72signals:
73
77 void activated();
78
79private:
80
81 class ALBERT_NO_EXPORT Private;
82 std::unique_ptr<Private> d;
83 friend class ALBERT_NO_EXPORT QNotificationManager;
84
85};
86
87}
The notification class.
Definition notification.h:20
Notification(const QString &title={}, const QString &text={}, QObject *parent=nullptr)
Constructs a notification with the given title and text.
void send()
Send the notification to the notification server.
void activated()
Emitted when the notification is activated, i.e.
void setTitle(const QString &title)
Sets the title of the notification to title.
const QString & text() const
Returns the text of the notification.
void dismiss()
Dismiss the notification.
const QString & title() const
Returns the title of the notification.
~Notification()
Destructs the notification.
void setText(const QString &text)
Sets the text of the notification to text.
Definition app.h:56