From 6e4f0b36599b9f245b3297881a6f4118f588214a Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Tue, 21 Jan 2014 19:10:28 +0100 Subject: [PATCH] added some more doc --- src/core/notification/notification.h | 38 ++++++++++++++++++- src/core/notification/notificationaction.h | 28 ++++++++++++++ src/core/snore.cpp | 1 + src/core/snore.h | 5 ++- src/core/version.h | 43 ++++++++++++++++++---- src/snorenotify.cpp | 1 + 6 files changed, 107 insertions(+), 9 deletions(-) diff --git a/src/core/notification/notification.h b/src/core/notification/notification.h index ac0df4d..6d864be 100644 --- a/src/core/notification/notification.h +++ b/src/core/notification/notification.h @@ -45,18 +45,54 @@ class SNORE_EXPORT Notification { friend class NotificationData; public: + + /** + * The reason why the Notification was closed. + */ enum CloseReason { + /** + * The default value, the notification was not closed. + */ NONE = 0x0, + + /** + * The Notification was closed becaouse it timed out. + */ TIMED_OUT = 0x1, + + /** + * The Notification was dismissed by the user, close button. + */ DISMISSED = 0x2, + + /** + * The Notification was closed after an action was invoked. + * @see actionInvoked() + */ CLOSED = 0x4 }; Q_DECLARE_FLAGS(CloseReasons, CloseReason) - enum Priority{ + /** + * The Priority for the Notification. + * Some notification systems support this flag to filter notifications or indicate different prioritys by color. + */ + enum Priority + { + /** + * Indicates a low priority. + */ LOW = -1, + + /** + * The default priority. + */ NORMAL = 0, + + /** + * Indicates a priority above the normal level. + */ HIGH = +1 }; Q_DECLARE_FLAGS(Prioritys, Priority) diff --git a/src/core/notification/notificationaction.h b/src/core/notification/notificationaction.h index eacf34f..52aa616 100644 --- a/src/core/notification/notificationaction.h +++ b/src/core/notification/notificationaction.h @@ -28,14 +28,42 @@ namespace Snore { +/** + * Action contains informations about possible interactions with the notification system. + * Some notification systems don't support actions but will report one if the notification was clicked, + * in this case an invalid Action will be emitted. + * @see isValid + * @author Patrick von Reth \ + */ + class SNORE_EXPORT Action { public: Action(); + + /** + * Creates an Action + * @param id can be used to identify the action + * @param name will be displayed in the notification system. + */ Action(int id,QString name); + /** + * + * @return the id + */ int id() const; + + /** + * + * @return the name + */ QString name() const; + + /** + * + * @return whether this is a valid Action + */ bool isValid() const; private: diff --git a/src/core/snore.cpp b/src/core/snore.cpp index 3ec4f66..f20272d 100644 --- a/src/core/snore.cpp +++ b/src/core/snore.cpp @@ -106,6 +106,7 @@ void SnoreCore::loadPlugins( SnorePlugin::PluginTypes types ) snoreDebug( SNORE_DEBUG )<<"dont load "<file()<type(); } } + snoreDebug( SNORE_INFO ) << "Loaded Plugins:" << d->m_notificationBackends << d->m_Frontends << d->m_secondaryNotificationBackends << d->m_plugins; } void SnoreCore::broadcastNotification ( Notification notification ) diff --git a/src/core/snore.h b/src/core/snore.h index c2e6c22..62d27be 100644 --- a/src/core/snore.h +++ b/src/core/snore.h @@ -176,13 +176,16 @@ public: signals: /** * This signal is emitted when an action on the Notification was performed. + * Some notification systems don't support actions but will report one if the notification was clicked, + * in this case the Action will be invalid. + * @todo maybe introduce a pecial action state for this case * @see Action */ void actionInvoked( Snore::Notification ); /** * This signal is emitted when a Notification is closed. - * @see NotificationEnums::CloseReasons + * @see Notification::CloseReasons */ void notificationClosed(Snore::Notification ); diff --git a/src/core/version.h b/src/core/version.h index 6b54415..42cd4ac 100644 --- a/src/core/version.h +++ b/src/core/version.h @@ -9,19 +9,48 @@ namespace Snore{ -class SNORE_EXPORT Version{ +/** + * Version contains relevant version informations. + * @author Patrick von Reth \ + */ +class SNORE_EXPORT Version +{ public: -static const QString version(); + /** + * + * @return the version "major().minor().suffix()" + */ + static const QString version(); -static const QString major(); + /** + * + * @return the major version + */ + static const QString major(); -static const QString minor(); + /** + * + * @return the minor version + */ + static const QString minor(); -static const QString suffix(); + /** + * + * @return the suffix ("pre", "alpha", "beta", "") + */ + static const QString suffix(); -static const QString revision(); + /** + * + * @return the git revision, can be empty in a release + */ + static const QString revision(); -static const QString buildTime(); + /** + * + * @return the build time + */ + static const QString buildTime(); }; diff --git a/src/snorenotify.cpp b/src/snorenotify.cpp index 51c03e2..462a1c3 100644 --- a/src/snorenotify.cpp +++ b/src/snorenotify.cpp @@ -29,6 +29,7 @@ #include #include + #include #include