From e782caba67c98143ed5f403f39dd5a1989886b66 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 13 Jan 2005 21:45:20 +0000 Subject: [PATCH] Prefixed function names with 'get' + written some doc for functions. --- ChangeLog | 5 +++ src/messaging/events.cpp | 24 ++++++------ vmime/messaging/events.hpp | 77 +++++++++++++++++++++++++++++++------- 3 files changed, 80 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cf3c669..ecf8db87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ VERSION 0.6.3cvs ================ +2005-01-13 Vincent Richard + + * messaging/events.*: prefixed function names with 'get' + written + some documentation for functions. + 2005-01-05 Vincent Richard * Started version 0.6.3. diff --git a/src/messaging/events.cpp b/src/messaging/events.cpp index 568083a6..d7e0a367 100644 --- a/src/messaging/events.cpp +++ b/src/messaging/events.cpp @@ -32,7 +32,7 @@ namespace events { // messageCountEvent::messageCountEvent - (class folder* folder, const Types type, const std::vector & nums) + (folder* folder, const Types type, const std::vector & nums) : m_folder(folder), m_type(type) { m_nums.resize(nums.size()); @@ -40,9 +40,9 @@ messageCountEvent::messageCountEvent } -const folder* messageCountEvent::folder() const { return (const_cast (m_folder)); } -const messageCountEvent::Types messageCountEvent::type() const { return (m_type); } -const std::vector & messageCountEvent::numbers() const { return (m_nums); } +const folder* messageCountEvent::getFolder() const { return (const_cast (m_folder)); } +const messageCountEvent::Types messageCountEvent::getType() const { return (m_type); } +const std::vector & messageCountEvent::getNumbers() const { return (m_nums); } void messageCountEvent::dispatch(messageCountListener* listener) const @@ -59,7 +59,7 @@ void messageCountEvent::dispatch(messageCountListener* listener) const // messageChangedEvent::messageChangedEvent - (class folder* folder, const Types type, const std::vector & nums) + (folder* folder, const Types type, const std::vector & nums) : m_folder(folder), m_type(type) { m_nums.resize(nums.size()); @@ -67,9 +67,9 @@ messageChangedEvent::messageChangedEvent } -const folder* messageChangedEvent::folder() const { return (const_cast (m_folder)); } -const messageChangedEvent::Types messageChangedEvent::type() const { return (m_type); } -const std::vector & messageChangedEvent::numbers() const { return (m_nums); } +const folder* messageChangedEvent::getFolder() const { return (const_cast (m_folder)); } +const messageChangedEvent::Types messageChangedEvent::getType() const { return (m_type); } +const std::vector & messageChangedEvent::getNumbers() const { return (m_nums); } void messageChangedEvent::dispatch(messageChangedListener* listener) const @@ -83,18 +83,18 @@ void messageChangedEvent::dispatch(messageChangedListener* listener) const // folderEvent::folderEvent - (class folder* folder, const Types type, + (folder* folder, const Types type, const utility::path& oldPath, const utility::path& newPath) : m_folder(folder), m_type(type), m_oldPath(oldPath), m_newPath(newPath) { } -const class folder* folderEvent::folder() const { return (m_folder); } -const folderEvent::Types folderEvent::type() const { return (m_type); } +const folder* folderEvent::getFolder() const { return (m_folder); } +const folderEvent::Types folderEvent::getType() const { return (m_type); } -void folderEvent::dispatch(class folderListener* listener) const +void folderEvent::dispatch(folderListener* listener) const { switch (m_type) { diff --git a/vmime/messaging/events.hpp b/vmime/messaging/events.hpp index 43ba7262..7c43dc09 100644 --- a/vmime/messaging/events.hpp +++ b/vmime/messaging/events.hpp @@ -48,17 +48,35 @@ public: }; - messageCountEvent(class folder* folder, const Types type, const std::vector & nums); + messageCountEvent(folder* folder, const Types type, const std::vector & nums); - const class folder* folder() const; - const Types type() const; - const std::vector & numbers() const; + /** Return the folder in which messages have been added/removed. + * + * @return folder in which message count changed + */ + const folder* getFolder() const; + /** Return the event type. + * + * @return event type (see messageCountEvent::Types) + */ + const Types getType() const; + + /** Return the numbers of the messages that have been added/removed. + * + * @return a list of message numbers + */ + const std::vector & getNumbers() const; + + /** Dispatch the event to the specified listener. + * + * @param listener listener to notify + */ void dispatch(class messageCountListener* listener) const; private: - class folder* m_folder; + folder* m_folder; const Types m_type; std::vector m_nums; }; @@ -93,17 +111,35 @@ public: }; - messageChangedEvent(class folder* folder, const Types type, const std::vector & nums); + messageChangedEvent(folder* folder, const Types type, const std::vector & nums); - const class folder* folder() const; - const Types type() const; - const std::vector & numbers() const; + /** Return the folder in which messages have changed. + * + * @return folder in which message count changed + */ + const folder* getFolder() const; + /** Return the event type. + * + * @return event type (see messageChangedEvent::Types) + */ + const Types getType() const; + + /** Return the numbers of the messages that have changed. + * + * @return a list of message numbers + */ + const std::vector & getNumbers() const; + + /** Dispatch the event to the specified listener. + * + * @param listener listener to notify + */ void dispatch(class messageChangedListener* listener) const; private: - class folder* m_folder; + folder* m_folder; const Types m_type; std::vector m_nums; }; @@ -139,16 +175,29 @@ public: }; - folderEvent(class folder* folder, const Types type, const utility::path& oldPath, const utility::path& newPath); + folderEvent(folder* folder, const Types type, const utility::path& oldPath, const utility::path& newPath); - const class folder* folder() const; - const Types type() const; + /** Return the folder on which the event occured. + * + * @return folder on which the event occured + */ + const folder* getFolder() const; + /** Return the event type. + * + * @return event type (see folderEvent::Types) + */ + const Types getType() const; + + /** Dispatch the event to the specified listener. + * + * @param listener listener to notify + */ void dispatch(class folderListener* listener) const; private: - class folder* m_folder; + folder* m_folder; const Types m_type; const utility::path m_oldPath; const utility::path m_newPath;