Some API dox fixes for libmapi++.
authorBrad Hards <bradh@openchange.org>
Tue, 4 Nov 2008 06:40:34 +0000 (06:40 +0000)
committerBrad Hards <bradh@openchange.org>
Tue, 4 Nov 2008 06:40:34 +0000 (06:40 +0000)
libmapi++/impl/session.ipp
libmapi++/object.h
libmapi++/profile.h
libmapi++/property_container.h
libmapi++/session.h

index e1608162adb9f147ce815994d838e02f9f505681..4cfbff7d62f9b19485c27864fac8fdfeddcb87ce 100644 (file)
@@ -35,7 +35,7 @@ inline std::string session::get_default_profile_path()
        return retval;
 }
 
-session::session(const std::string& profiledb, bool debug)throw(std::runtime_error, mapi_exception) 
+session::session(const std::string& profiledb, bool debug) throw(std::runtime_error, mapi_exception) 
 : m_session(NULL), m_memory_ctx(talloc_init("libmapi++")), m_message_store(new message_store(*this))
 {
        mapi_exception::fill_status_map();
@@ -43,7 +43,7 @@ session::session(const std::string& profiledb, bool debug)throw(std::runtime_err
        std::string profile_path;
 
        // If profile is not provided, attempt to get it from default location
-       // ~/.openchange/profiles.ldb
+       // (~/.openchange/profiles.ldb)
        if (profiledb == "") {
                profile_path = get_default_profile_path();
                if (profile_path == "") {
index f8bf9b225968e189b83815c9e4eb8b484d59ea93..262a8c006fbecb89fac28deb13fe13952ff4adca 100644 (file)
@@ -37,38 +37,52 @@ namespace libmapipp
 // #define INVALID_HANDLE_VALUE 0xffffffff
 class property_container;
 
-/** \brief Base Object class. \n
- *  Most classes such as folder, message and message_store derive from this class.
- *  It is important that objects be passed around as references and that no unnecessary 
- *  copies are made as this will call the class destructor which will call mapi_object_release()
- *  and release the handle associated with this object.
+/**
+ * Base Object class
+ *
+ * Most classes such as folder, message and message_store derive from this class.
+ * It is important that objects be passed around as references and that no unnecessary
+ * copies are made as this will call the class destructor which will call
+ * mapi_object_release() and release the handle associated with this object.
  */
 class object {
        public:
-               /** \brief Object Constructor
-                *  \param mapi_session Session this object is to be associated with.
-                *  \param object_type The name of the type of object (to be set in a subclass)
+               /**
+                * \brief Object Constructor
+                *
+                * \param mapi_session Session this object is to be associated with.
+                * \param object_type The name of the type of object (to be set in a subclass)
                 */
                object(session& mapi_session, const std::string& object_type = "") throw() : m_session(mapi_session), m_object_type(object_type)
                {
                        mapi_object_init(&m_object);
                }
 
-               /** \brief Returns a reference to the mapi_object_t associated with this object
-                *  \return A reference to the C struct mapi_object_t associated with this object
+               /**
+                * \brief Obtain a reference to the mapi_object_t associated with this object
+                * 
+                * \return A reference to the C struct mapi_object_t associated with this object
                 */
                virtual mapi_object_t& data() throw() { return m_object; }
 
-               /** \brief Returns a property_container to be used with this object.
-                *  \return A property_container to be used with this object.
+               /**
+                * \brief Obtain a property_container to be used with this object.
+                *
+                * \return A property_container to be used with this object.
                 */
                virtual property_container get_property_container();
 
-               /// \brief Returns session associated with this object.
+               /**
+                * \brief Obtain the session associated with this object.
+                *
+                * \return The session associated with this object
+                */
                virtual session& get_session() { return m_session; }
 
-               /** \brief Destructor\n
-                *  calls mapi_object_release() which releases the handle associated with this object.
+               /**
+                * \brief Destructor
+                *
+                * Calls mapi_object_release() which releases the handle associated with this object.
                 */ 
                virtual ~object() throw()
                {
index 4b2917caf40bf27a3314e2a9819bf3601044b86f..7be6dc3c2c240c1886b5d269331a1f2e6cd7221e 100644 (file)
 
 namespace libmapipp {
 
+/**
+ * This class represents a user %profile database
+ *
+ * \todo possibly rename profile class to profile_database?
+ * \todo we should be able to create a profile using libmapi++ classes
+ * \todo we should be able to delete a profile using libmapi++ classes
+ * \todo maybe move some of the session.h documentation on profiles to profile.h?
+ */
 class profile 
 {
        public:
 
+               /**
+                * Make the specified profile the default profile
+                *
+                * \param profname the name of the profile to make default
+                */
                bool static set_default(const char* profname)
                {
                        return (SetDefaultProfile(profname) == MAPI_E_SUCCESS);
                }
 
+               /**
+                * Make the specified profile the default profile
+                *
+                * \param profname the name of the profile to make default
+                */
                bool static set_default(const std::string& profname)
                {
                        return set_default(profname.c_str());
                }
 
+               /**
+                * Get the default profile name
+                *
+                * \return the name of the default profile
+                */
                std::string static get_default_profile() throw (mapi_exception)
                {
                        const char* profname = NULL;
index a6de0843961e97977697d6bf58372a4894dafeed..3052f0323de6563aa549b24eadb6c9d10d85004e 100644 (file)
@@ -85,8 +85,10 @@ class property_container_iterator {
                        }
                }
 
-               /** \brief Get Property Tag of the Property Value this operator points to.
-                *  \return Property Tag of Property this iterator points to or MAPI_PROP_RESERVED if this is an invalid iterator.
+               /**
+                * \brief Get Property Tag of the Property Value this operator points to.
+                *
+                * \return Property Tag of Property this iterator points to or MAPI_PROP_RESERVED if this is an invalid iterator.
                 */
                int get_tag()
                {
@@ -134,8 +136,10 @@ class property_container_iterator {
                        return !(*this == rhs);
                }
 
-               /** \brief operator*
-                *  \return The property value as a void pointer.\n
+               /**
+                * \brief operator*
+                *
+                * \return The property value as a void pointer.
                 */
                const void* operator*()
                {
@@ -164,8 +168,10 @@ class property_container {
                {
                }
 
-               /** \brief Fetches properties with the tags supplied using operator<<
-                *  \return The number of objects that were fetched.
+               /**
+                * \brief Fetches properties with the tags supplied using operator<<
+                *
+                * \return The number of objects that were fetched.
                 */
                uint32_t fetch()
                {
@@ -207,9 +213,12 @@ class property_container {
                        return *this;
                }
 
-               /** \brief Finds the property value associated with a property tag
-                *  \param property_tag The Property Tag to be searched for
-                *  \return Property Value as a const void pointer
+               /**
+                * \brief Finds the property value associated with a property tag
+                *
+                * \param property_tag The Property Tag to be searched for
+                *
+                * \return Property Value as a const void pointer
                 */
                const void* operator[](uint32_t property_tag)
                {
index 3b440ae775ef79a7cd9a4e1c4e3a0300d33a461e..9268739f5f588735f372f038aefd7321bfb42c32 100644 (file)
@@ -37,13 +37,36 @@ using std::endl;
 namespace libmapipp
 {
 class message_store;
-/// This class represents a MAPI session with the Exchange Server
+/**
+ * This class represents a MAPI %session with the Exchange Server
+ *
+ * The %session is best thought of as the connection by a single user to a
+ * single server. It is possible to have multiple sessions open at the same
+ * time.
+ *
+ * A key concept in the %session is that of a \em profile, and the %profile
+ * database. The %profile is a pre-established data set that specifies the
+ * server information (e.g. server name / IP address, and Exchange domain)
+ * and client information (e.g. the user name, preferred language, and
+ * optionally the users password). The profiles are stored in a local store
+ * (Samba LDB database) known as the %profile store or %profile database. One
+ * of the profiles in the %profile database can be designated as the default
+ * %profile (which is particularly useful given that most users may only have
+ * one). See the profile class documentation for more information.
+ *
+ * The general concept is that you create a %session %object, log in to the
+ * %session using a selected %profile name, and then work with the message_store
+ * associated with that %session. The message_store is only valid so long
+ * as the session is valid.
+ */
 class session {
        public:
                /**
                 * \brief Constructor
-                * \param profiledb An absolute path specifying where the profile database is.\n
-                *        If none or ""  is specified the default location will be used (~/.openchange.profiles.ldb).
+                *
+                * \param profiledb An absolute path specifying the location of the
+                * %profile database. If not specified (or ""  is specified) the default
+                * location will be used (~/.openchange.profiles.ldb).
                 *
                 * \param debug Whether to output debug information to stdout
                 */
@@ -51,25 +74,50 @@ class session {
 
                /**
                 * \brief Log-in to the Exchange Server
-                * \param profile_name The name of the profile, if left blank the default profile will be used.
-                * \param password The password to use to login with.\n
-                *        It is possible to omit this if the password is stored in the profile database.
+                *
+                * \param profile_name The name of the profile to use to login with.
+                * If not specified (or "" is specified), then the default %profile will
+                * be used.
+                *
+                * \param password The password to use to login with. It is possible to
+                * omit this if the password is stored in the %profile database.
                 */
                void login(const std::string& profile_name = "", const std::string& password = "") throw(mapi_exception); 
 
+               /**
+                * \brief The path to the default %profile database
+                *
+                * This method is not normally required to be called by user applications
+                * but might be useful under some circumstances.
+                */
                static std::string get_default_profile_path();
 
+               /**
+                * \brief The name of the profile that is in use
+                *
+                * Calling this method only makes sense if login() has been called with
+                * this %session object.
+               */
                std::string get_profile_name() const { return m_profile_name; }
 
-               /** \brief Returns a reference to the message_store associated with this session
-                *  \return The message_store associated with this session.
+               /**
+                * \brief Obtain a reference to the message_store associated with this %session
+                *
+                * \return The message_store associated with this %session.
                 */
                message_store& get_message_store() throw() { return *m_message_store; }
 
-               /// \brief Get Session TALLOC Memory Context pointer.
+               /**
+                * \brief Obtain a talloc memory context for this %session
+                *
+                * This pointer can be used for subsequent memory allocations, and
+                * these will be cleaned up when the %session is terminated.
+                */
                TALLOC_CTX* get_memory_ctx() throw() { return m_memory_ctx; }
 
-               /// Uninitializes the MAPI session.
+               /**
+                * \brief Uninitialize and clean up the MAPI %session.
+                */
                ~session()
                {
                        uninitialize();