From a644a7cc6749f8dd5ca20589ee6e59acc2892b3e Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Tue, 27 Sep 2011 04:51:30 +0200 Subject: new qmafw watchlet --- libsowatch/watchserver.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'libsowatch/watchserver.h') diff --git a/libsowatch/watchserver.h b/libsowatch/watchserver.h index a3e0593..66c941a 100644 --- a/libsowatch/watchserver.h +++ b/libsowatch/watchserver.h @@ -2,6 +2,7 @@ #define SOWATCH_WATCHSERVER_H #include +#include #include #include @@ -31,39 +32,49 @@ public: void addProvider(NotificationProvider* provider); +public slots: + void postNotification(Notification *notification); void runWatchlet(const QString& id); void closeWatchlet(); + void nextWatchlet(); -protected: +private: Watch* _watch; + /** The watch button that causes next watchlet to be run. */ int _nextWatchletButton; + /** The amount of seconds that have to pass for a notification to be considered "outdated" and not shown. */ int _oldNotificationThreshold; + /** A list of watchlets in order, for use by nextWatchlet() */ + QStringList _watchletIds; + /** Actual Watchlet child objects by id. */ QMap _watchlets; - /** Stores current notifications, classified by type. */ + /** Stores current live notifications, classified by type. */ QList _notifications[Notification::TypeCount]; + /** A list of notifications that are yet to be shown to the user. */ QQueue _pendingNotifications; + /** Current watchlet. */ Watchlet* _currentWatchlet; - unsigned char _currentWatchletIndex; + /** The current watchlet index if any, for use by nextWatchlet() */ + int _currentWatchletIndex; void registerWatchlet(Watchlet *watchlet); void reactivateCurrentWatchlet(); - void nextWatchlet(); void nextNotification(); uint getNotificationCount(Notification::Type type); void goToIdle(); -protected slots: +private slots: void watchConnected(); void watchDisconnected(); void watchIdling(); void watchButtonPress(int button); - void notificationReceived(Notification* notification); + void notificationChanged(); void notificationCleared(); -- cgit v1.2.3