Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/server_p.h
Show All 16 Lines | |||||
17 | * You should have received a copy of the GNU Lesser General Public | 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/>. | 18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #pragma once | 21 | #pragma once | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QDBusContext> | 24 | #include <QDBusContext> | ||
25 | #include <QStringList> | ||||
broulik: Include `QStringList` | |||||
25 | 26 | | |||
26 | #include "notification.h" | 27 | #include "notification.h" | ||
27 | 28 | | |||
28 | class QDBusServiceWatcher; | 29 | class QDBusServiceWatcher; | ||
29 | 30 | | |||
30 | struct Inhibition | 31 | struct Inhibition | ||
31 | { | 32 | { | ||
32 | QString desktopEntry; | 33 | QString desktopEntry; | ||
Show All 30 Lines | 53 | public: | |||
63 | 64 | | |||
64 | // Inhibitions | 65 | // Inhibitions | ||
65 | uint Inhibit(const QString &desktop_entry, | 66 | uint Inhibit(const QString &desktop_entry, | ||
66 | const QString &reason, | 67 | const QString &reason, | ||
67 | const QVariantMap &hints); | 68 | const QVariantMap &hints); | ||
68 | void UnInhibit(uint cookie); | 69 | void UnInhibit(uint cookie); | ||
69 | bool inhibited() const; // property getter | 70 | bool inhibited() const; // property getter | ||
70 | 71 | | |||
72 | // Notifition watcher | ||||
73 | void RegisterWatcher(); | ||||
74 | void UnRegisterWatcher(); | ||||
75 | | ||||
76 | void InvokeAction(uint id, const QString &actionKey); | ||||
77 | | ||||
71 | Q_SIGNALS: | 78 | Q_SIGNALS: | ||
72 | // DBus | 79 | // DBus | ||
73 | void NotificationClosed(uint id, uint reason); | 80 | void NotificationClosed(uint id, uint reason); | ||
74 | void ActionInvoked(uint id, const QString &actionKey); | 81 | void ActionInvoked(uint id, const QString &actionKey); | ||
75 | // non-standard | 82 | // non-standard | ||
76 | // This is manually emitted as targeted signal in sendReplyText() | 83 | // This is manually emitted as targeted signal in sendReplyText() | ||
77 | void NotificationReplied(uint id, const QString &text); | 84 | void NotificationReplied(uint id, const QString &text); | ||
78 | 85 | | |||
Show All 37 Lines | 121 | private: | |||
116 | void onInhibitionServiceUnregistered(const QString &serviceName); | 123 | void onInhibitionServiceUnregistered(const QString &serviceName); | ||
117 | void onInhibitedChanged(); // emit DBus change signal | 124 | void onInhibitedChanged(); // emit DBus change signal | ||
118 | 125 | | |||
119 | bool m_dbusObjectValid = false; | 126 | bool m_dbusObjectValid = false; | ||
120 | 127 | | |||
121 | mutable QScopedPointer<ServerInfo> m_currentOwner; | 128 | mutable QScopedPointer<ServerInfo> m_currentOwner; | ||
122 | 129 | | |||
123 | QDBusServiceWatcher *m_inhibitionWatcher = nullptr; | 130 | QDBusServiceWatcher *m_inhibitionWatcher = nullptr; | ||
131 | QDBusServiceWatcher *m_notificationWatchers = nullptr; | ||||
124 | uint m_highestInhibitionCookie = 0; | 132 | uint m_highestInhibitionCookie = 0; | ||
125 | QHash<uint /*cookie*/, Inhibition> m_externalInhibitions; | 133 | QHash<uint /*cookie*/, Inhibition> m_externalInhibitions; | ||
126 | QHash<uint /*cookie*/, QString> m_inhibitionServices; | 134 | QHash<uint /*cookie*/, QString> m_inhibitionServices; | ||
127 | 135 | | |||
128 | bool m_inhibited = false; | 136 | bool m_inhibited = false; | ||
129 | 137 | | |||
130 | Notification m_lastNotification; | 138 | Notification m_lastNotification; | ||
131 | 139 | | |||
132 | }; | 140 | }; | ||
133 | 141 | | |||
134 | } // namespace NotificationManager | 142 | } // namespace NotificationManager |
Include QStringList