Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/notification_p.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2018-2019 Kai Uwe Broulik <kde@privat.broulik.de> | ||||
3 | * | ||||
4 | * This library is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU Lesser General Public | ||||
6 | * License as published by the Free Software Foundation; either | ||||
7 | * version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | * later version accepted by the membership of KDE e.V. (or its | ||||
9 | * successor approved by the membership of KDE e.V.), which shall | ||||
10 | * act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | * | ||||
12 | * This library is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | * Lesser General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU Lesser General Public | ||||
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | #pragma once | ||||
22 | | ||||
23 | #include <QDBusArgument> | ||||
24 | #include <QDateTime> | ||||
25 | #include <QScopedPointer> | ||||
26 | #include <QImage> | ||||
27 | #include <QList> | ||||
28 | #include <QString> | ||||
29 | #include <QUrl> | ||||
30 | | ||||
31 | #include "notifications.h" | ||||
32 | | ||||
33 | namespace NotificationManager | ||||
34 | { | ||||
35 | | ||||
36 | class Q_DECL_HIDDEN Notification::Private | ||||
37 | { | ||||
38 | public: | ||||
39 | Private(); | ||||
40 | ~Private(); | ||||
41 | | ||||
42 | static QString sanitize(const QString &text); | ||||
43 | static QImage decodeNotificationSpecImageHint(const QDBusArgument &arg); | ||||
44 | static void sanitizeImage(QImage &image); | ||||
45 | | ||||
46 | void loadImagePath(const QString &path); | ||||
47 | | ||||
48 | static QString defaultComponentName(); | ||||
49 | static QSize maximumImageSize(); | ||||
50 | | ||||
51 | void processHints(const QVariantMap &hints); | ||||
52 | | ||||
53 | void setUrgency(Notifications::Urgency urgency); | ||||
54 | | ||||
55 | uint id = 0; | ||||
56 | QDateTime created; | ||||
57 | QDateTime updated; | ||||
58 | | ||||
59 | QString summary; | ||||
60 | QString body; | ||||
61 | // Can be theme icon name or path | ||||
62 | QString icon; | ||||
63 | QImage image; | ||||
64 | | ||||
65 | QString applicationName; | ||||
66 | QString desktopEntry; | ||||
67 | bool configurableService = false; | ||||
68 | QString applicationIconName; | ||||
69 | | ||||
70 | QString deviceName; | ||||
71 | | ||||
72 | QStringList actionNames; | ||||
73 | QStringList actionLabels; | ||||
74 | bool hasDefaultAction = false; | ||||
75 | QString defaultActionLabel; | ||||
76 | | ||||
77 | bool hasConfigureAction = false; | ||||
78 | QString configureActionLabel; | ||||
79 | | ||||
80 | bool configurableNotifyRc = false; | ||||
81 | QString notifyRcName; | ||||
82 | QString eventId; | ||||
83 | | ||||
84 | QList<QUrl> urls; | ||||
85 | | ||||
86 | Notifications::Urgency urgency = Notifications::NormalUrgency; | ||||
87 | int timeout = -1; | ||||
88 | | ||||
89 | bool expired = false; | ||||
90 | bool dismissed = false; | ||||
91 | }; | ||||
92 | | ||||
93 | } // namespace NotificationManager |