-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathNotificationServer.hxx
61 lines (43 loc) · 1.35 KB
/
NotificationServer.hxx
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
56
57
58
59
60
61
/*
This file is part of liquidshell.
SPDX-FileCopyrightText: 2017 - 2024 Martin Koller <kollix@aon.at>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef _NotificationServer_H_
#define _NotificationServer_H_
// https://developer.gnome.org/notification-spec/
// https://specifications.freedesktop.org/notification-spec
#include <SysTrayItem.hxx>
class NotificationList;
class NotificationServer : public SysTrayItem
{
Q_OBJECT
public:
NotificationServer(QWidget *parent);
void CloseNotification(uint id);
QStringList GetCapabilities();
QString GetServerInformation(QString &vendor, QString &version, QString &spec_version);
uint Notify(const QString &app_name, uint replaces_id, const QString &app_icon,
const QString &summary, const QString &body, const QStringList &actions,
const QVariantMap &hints, int timeout);
enum CloseReason
{
Expired = 1,
Dismissed = 2,
Closed = 3,
Undefined = 4
};
void setAvoidPopup(bool avoid);
bool getAvoidPopup() const;
protected:
QWidget *getDetailsList() override;
Q_SIGNALS:
void ActionInvoked(uint id, const QString &action_key);
void NotificationClosed(uint id, uint reason);
private:
QString makeToolTip() const;
private:
uint notifyId = 1;
NotificationList *notificationList;
};
#endif