diff options
Diffstat (limited to 'libsowatch/notificationsmodel.h')
-rw-r--r-- | libsowatch/notificationsmodel.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libsowatch/notificationsmodel.h b/libsowatch/notificationsmodel.h index 6aabf71..d88693f 100644 --- a/libsowatch/notificationsmodel.h +++ b/libsowatch/notificationsmodel.h @@ -11,6 +11,7 @@ namespace sowatch class NotificationsModel : public QAbstractListModel { Q_OBJECT + public: explicit NotificationsModel(QObject *parent = 0); @@ -27,11 +28,18 @@ public: void remove(Notification *n); void remove(Notification::Type type, Notification *n); - int fullCount() const; - int fullCountByType(Notification::Type type) const; + Q_INVOKABLE int fullCount() const; + Q_INVOKABLE int fullCountByType(Notification::Type type) const; + Q_INVOKABLE int fullCountByType(int type) const; // See QTBUG-26415 + + Q_INVOKABLE Notification* getMostRecentByType(Notification::Type type) const; + Q_INVOKABLE Notification* getMostRecentByType(int type) const; Notification::Type getTypeOfDeletedNotification(Notification *n) const; +signals: + void modelChanged(); + private: int getOffsetForType(Notification::Type type) const; int getAppendOffsetForType(Notification::Type type) const; |