Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/server_p.h
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 50 | public: | |||
---|---|---|---|---|---|
67 | bool inhibited() const; // property getter | 67 | bool inhibited() const; // property getter | ||
68 | 68 | | |||
69 | Q_SIGNALS: | 69 | Q_SIGNALS: | ||
70 | // DBus | 70 | // DBus | ||
71 | void NotificationClosed(uint id, uint reason); | 71 | void NotificationClosed(uint id, uint reason); | ||
72 | void ActionInvoked(uint id, const QString &actionKey); | 72 | void ActionInvoked(uint id, const QString &actionKey); | ||
73 | 73 | | |||
74 | void inhibitedChanged(); | 74 | void inhibitedChanged(); | ||
75 | void inhibitionAdded(); | 75 | | ||
76 | void inhibitionRemoved(); | 76 | void externalInhibitedChanged(); | ||
77 | void externalInhibitionsChanged(); | ||||
78 | | ||||
77 | void serviceOwnershipLost(); | 79 | void serviceOwnershipLost(); | ||
78 | 80 | | |||
79 | public: // stuff used by public class | 81 | public: // stuff used by public class | ||
80 | bool init(); | 82 | bool init(); | ||
81 | uint add(const Notification ¬ification); | 83 | uint add(const Notification ¬ification); | ||
82 | 84 | | |||
83 | QList<Inhibition> inhibitions() const; | 85 | // Server only handles external application inhibitions but we still want the Inhibited property | ||
84 | void clearInhibitions(); | 86 | // expose the actual inhibition state for applications to check. | ||
87 | void setInhibited(bool inhibited); | ||||
88 | | ||||
89 | bool externalInhibited() const; | ||||
90 | QList<Inhibition> externalInhibitions() const; | ||||
91 | void clearExternalInhibitions(); | ||||
85 | 92 | | |||
86 | bool m_valid = false; | 93 | bool m_valid = false; | ||
87 | uint m_highestNotificationId = 1; | 94 | uint m_highestNotificationId = 1; | ||
88 | 95 | | |||
89 | private slots: | 96 | private slots: | ||
90 | void onBroadcastNotification(const QMap<QString, QVariant> &properties); | 97 | void onBroadcastNotification(const QMap<QString, QVariant> &properties); | ||
91 | 98 | | |||
92 | private: | 99 | private: | ||
93 | void onServiceUnregistered(const QString &serviceName); | 100 | void onServiceUnregistered(const QString &serviceName); | ||
94 | 101 | | |||
95 | QDBusServiceWatcher *m_inhibitionWatcher = nullptr; | 102 | QDBusServiceWatcher *m_inhibitionWatcher = nullptr; | ||
96 | uint m_highestInhibitionCookie = 0; | 103 | uint m_highestInhibitionCookie = 0; | ||
97 | QHash<uint /*cookie*/, Inhibition> m_inhibitions; | 104 | QHash<uint /*cookie*/, Inhibition> m_externalInhibitions; | ||
98 | QHash<uint /*cookie*/, QString> m_inhibitionServices; | 105 | QHash<uint /*cookie*/, QString> m_inhibitionServices; | ||
99 | 106 | | |||
107 | bool m_inhibited = false; | ||||
108 | | ||||
100 | Notification m_lastNotification; | 109 | Notification m_lastNotification; | ||
101 | 110 | | |||
102 | }; | 111 | }; | ||
103 | 112 | | |||
104 | } // namespace NotificationManager | 113 | } // namespace NotificationManager |