summaryrefslogtreecommitdiff
path: root/libsowatch/notificationsmodel.h
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-06 01:11:40 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-06 01:11:40 +0200
commitd83093df7602aa2896de71292b47948540c22a44 (patch)
tree5f0b2c86f8a75124aaa4ae03547ec8b9f4bc4376 /libsowatch/notificationsmodel.h
parent12cf6df3f1c90c6ccbab398f0ae03c946e4af638 (diff)
downloadsowatch-d83093df7602aa2896de71292b47948540c22a44.tar.gz
sowatch-d83093df7602aa2896de71292b47948540c22a44.zip
metawatch watchface in QML still a work in progress
Diffstat (limited to 'libsowatch/notificationsmodel.h')
-rw-r--r--libsowatch/notificationsmodel.h12
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;