From 3921933f72d7aa8dcff751a60ba1981490efcb10 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Mon, 20 Jan 2014 14:32:42 +0100 Subject: [PATCH] doc --- src/core/application.h | 56 +++++++++++++++++++++++++++- src/core/hint.h | 39 ++++++++++++++++++- src/core/notification/notification.h | 1 - 3 files changed, 92 insertions(+), 4 deletions(-) diff --git a/src/core/application.h b/src/core/application.h index 2b6cb6a..768eea7 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -29,30 +29,82 @@ namespace Snore{ class ApplicationData; +/** + * Application contains all relevant data to manage applications with the notification backend. + * Application uses a shared datamodel, its content is never copied and automatically released. + * + * @author Patrick von Reth \ + */ + class SNORE_EXPORT Application { public: Application(); + + /** + * Creates a new Application object + * @param name + * @param icon + * @see SnoreCore::registerApplication + */ explicit Application ( const QString &name, const Icon &icon); + + /** + * The copy constructor + * @param other + */ Application(const Application &other); + + /** + * The copy operator + * @param other + */ Application &operator=(const Application &other); + ~Application(); + /** + * Add an alert to the Application + * @param alert the Alert + */ void addAlert(const Alert &alert); + + /** + * + * @return the name of the Application + */ QString name() const; + + /** + * + * @return the default icon for Notifications ans Alerts of this Application. + */ const Icon &icon() const; + + /** + * Returns a QHash with the Alers registered with this Application + */ const QHash &alerts() const; + + /** + * + * @return whether the Application is valid + */ bool isValid() const; /** - * Application specific hints: + * Returns application specific hints: * * * *
desktop-entryThe name of the desktop enty associated with the applicationUsed for The freedesktop backend
windows-app-idThe app id associated with the applicationNeeded for the Windows 8 backend See MSDN
- * @return the hints */ Hint &hints(); + + /** + * Same as hints + * @see hints + */ const Hint &constHints() const; private: QExplicitlySharedDataPointer d; diff --git a/src/core/hint.h b/src/core/hint.h index 4347b39..00ee3fd 100644 --- a/src/core/hint.h +++ b/src/core/hint.h @@ -35,7 +35,7 @@ SNORE_EXPORT QDebug operator<< ( QDebug, const Snore::Hint &); namespace Snore { /** - * Hint contains extra information for Notifications and Applications + * Hint contains extra information accesible by key */ class SNORE_EXPORT Hint @@ -43,12 +43,49 @@ class SNORE_EXPORT Hint public: Hint(); + /** + * Sets the value for the key + * @param key the key + * @param value the value + */ void setValue(const QString &key, const QVariant &value); + + /** + * The associated value of the key if present, returns the default value otherwise. + * @param key the key + * @param defaultValue the fallback value + */ QVariant value(const QString & key, const QVariant & defaultValue = QVariant() ) const; + + /** + * + * @param key the key + * @return whether the key is set + */ bool contains ( const QString & key ) const; + /** + * Sets the value for the key depending on the owner + * @param owner the owner + * @param key the key + * @param value the value + */ void setPrivateValue(const void *owner, const QString &key, const QVariant &value); + + /** + * The associated value of the key if present, returns the default value otherwise. + * @param owner the owner + * @param key the key + * @param defaultValue the fallback value + */ QVariant privateValue(const void *owner, const QString & key, const QVariant & defaultValue = QVariant() ) const; + + /** + * + * @param owner the owner + * @param key the key + * @return whether the key is set + */ bool containsPrivateValue(const void *owner, const QString & key ) const; private: diff --git a/src/core/notification/notification.h b/src/core/notification/notification.h index 1481e8b..1b03a10 100644 --- a/src/core/notification/notification.h +++ b/src/core/notification/notification.h @@ -79,7 +79,6 @@ public: /** * The copy operator * @param other - * @return */ Notification &operator=(const Notification &other); ~Notification();