TizenRefApp-9676 [Gallery] Add doxygen documentation to Model public classes 75/157675/5
authorAlexander\ Kovalenko <al.kovalenko@samsung.com>
Wed, 25 Oct 2017 15:05:50 +0000 (18:05 +0300)
committerAlexander\ Kovalenko <al.kovalenko@samsung.com>
Tue, 7 Nov 2017 08:03:55 +0000 (10:03 +0200)
Change-Id: If78d316799343d555d88e85dcb0116f8b80b5cfc

gallery/model/CustomMediaAlbum.h
gallery/model/Gallery.h
gallery/model/IJob.h
gallery/model/IMediaAlbum.h
gallery/model/MediaItem.h
gallery/model/SoundManager.h
gallery/model/helpers.h
gallery/model/types.h

index 08ff4b3f85cdc5e6a79888ef5d75b48c38823f41..50c175e64b4a1e2690b57c16dfedb81886c534e1 100644 (file)
@@ -23,24 +23,66 @@ namespace gallery {
 
        UCL_DECLARE_REF_ALIASES(CustomMediaAlbum);
 
+       /**
+        * @brief Implements IMediaAlbum
+        */
        class CustomMediaAlbum final : public IMediaAlbum {
        public:
+
+               /**
+                * @brief Contsructor
+                */
                CustomMediaAlbum();
+
+               /**
+                * @brief Desructor
+                */
                virtual ~CustomMediaAlbum();
 
+               /**
+                * @brief Adds media item to album
+                * @param[in] item Shared reference to MediaItem object
+                */
                void addItem(MediaItemSRef item);
 
+               /**
+                * @brief Gets album contents
+                * @return Vector of media items
+                */
                const MediaItems &getItems() const;
 
                // IMediaAlbum //
 
+               /**
+                * @brief Adds change handler
+                * @param[in] handler Change handler
+                */
                virtual void addChangeHandler(NotiHandler handler) final override;
+
+               /**
+                * @brief Deletes change handler
+                * @param[in] handler Change handler
+                */
                virtual void delChangeHandler(
                                NotiHandler::CDRef handler) final override;
 
+               /**
+                * @brief Calls a provided callback function once for each MediaAlbum entry
+                * @param[in] cb Callback function
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                virtual ucl::Result forEachMedia(EachCb cb) const final override;
+
+               /**
+                * @brief Gets number of items in album
+                * @param[out] count Media count
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                virtual ucl::Result getMediaCount(int &count) const final override;
 
+               /**
+                * @brief Defragments media album contents
+                */
                virtual void defragment() final override;
 
        private:
index e17b1f5798d76477a946133217ee28b285c1a360..a82bff66186297a91337fd4366f27d54b5e0b172 100644 (file)
@@ -23,11 +23,27 @@ namespace gallery {
 
        UCL_DECLARE_REF_ALIASES(Gallery);
 
+       /**
+        * @brief Represents application main model class
+        */
        class Gallery final : public ucl::NonCopyable {
        public:
+
+               /**
+                * @brief Creates new instance of Gallery
+                * @return Shared reference to Gallery object
+                */
                static GallerySRef newInstance();
+
+               /**
+                * @brief Destructor
+                */
                ~Gallery();
 
+               /**
+                * @brief Gets media album
+                * @return Shared reference to media album object
+                */
                IMediaAlbumSRef getAlbum();
 
        private:
index 2894d52f0790322114a3b593ad5504eccc59f4f6..58f9c59503d7ac60d36aff5eb6a46b64949f6855 100644 (file)
@@ -23,10 +23,28 @@ namespace gallery {
 
        UCL_DECLARE_REF_ALIASES(IJob);
 
+       /**
+        * @brief Represents abstract job
+        */
        class IJob : protected ucl::NonCopyable {
        public:
+
+               /**
+                * @brief Gets result
+                * @return Result. @see ucl::Result
+                */
                virtual ucl::Result getResult() const = 0;
+
+               /**
+                * @brief Check if job can be canceled
+                * @return true if cancelable, false if not cancelable
+                */
                virtual bool isCancelable() const = 0;
+
+               /**
+                * @brief Cancels job
+                * @return RES_OK on success, otherwise an error code
+                */
                virtual ucl::Result cancel() = 0;
        };
 }
index a0b2c4c78daf779d600a667b06c239ffbc2849a5..a8b6ee30c1fc7c9c444c5a5eb71bd06ae065a2ee 100644 (file)
@@ -23,22 +23,56 @@ namespace gallery {
 
        UCL_DECLARE_REF_ALIASES(IMediaAlbum);
 
+       /**
+        * @brief Represents media album interface
+        */
        class IMediaAlbum : protected ucl::NonCopyable {
        public:
+               /**
+                * @brief Callback for each item in album type
+                */
                using EachCb = ucl::Delegate<bool(MediaItemSRef media)>;
 
        public:
+
+               /**
+                * @brief Adds change handler
+                * @param[in] handler Change handler
+                */
                virtual void addChangeHandler(NotiHandler handler) = 0;
+
+               /**
+                * @brief Removes change handler
+                * @param[in] handler Change handler
+                */
                virtual void delChangeHandler(NotiHandler::CDRef handler) = 0;
 
+               /**
+                * @brief Calls a provided callback function once for each MediaAlbum entry
+                * @param[in] cb Callback function
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                virtual ucl::Result forEachMedia(EachCb cb) const = 0;
+
+               /**
+                * @brief Gets number of items in album
+                * @param[out] count Media count
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                virtual ucl::Result getMediaCount(int &count) const = 0;
 
+               /**
+                * @brief Defragments media album contents
+                */
                virtual void defragment() = 0;
        };
 
        // Non-member functions //
 
+       /**
+        * @brief Checks if album is empty
+        * @return true if album is empty, false if album is filled
+        */
        bool isEmpty(const IMediaAlbum &album);
 }
 
index 25cf4a86c4e1295eb1dd374b5c097c8c09e469a9..a0e5cb8ea84a6d64fda514d5c99a159d366e6f98 100644 (file)
@@ -32,68 +32,203 @@ namespace gallery {
 
        using MediaItems = std::vector<MediaItemSRef>;
 
+       /**
+        * @brief Represents media item
+        */
        class MediaItem : protected ucl::NonCopyable {
        public:
+               /**
+                * @brief Callback for thumbnail creation type
+                */
                using ThumbnailPathGetCb =
                                ucl::WeakDelegate<void(ucl::Result, const std::string &path)>;
 
+               /**
+                * @brief Provides removal option
+                */
                class Remover;
+
+               /**
+                * @brief Builder for the job that removes file
+                */
                class RemoverBuilder final {
                public:
+                       /**
+                        * @brief Stages items for delition
+                        * @param[in] items Vector of items
+                        * @return RemoverBuilder object
+                        */
                        RemoverBuilder &setItems(MediaItems items);
+
+                       /**
+                        * @brief Creates job
+                        * @param[in] onComplete Completion handler
+                        * @return Shared reference to IJob
+                        */
                        IJobSRef build(const NotiHandler &onComplete) const;
                private:
                        ucl::SharedRef<MediaItems> m_items;
                };
 
+               /**
+                * @brief Provides saving option
+                */
                class Saver;
+
+               /**
+                * @brief Builder for the job that saves file on the device
+                */
                class SaverBuilder final {
                public:
+                       /**
+                        * @brief Sets item to save
+                        * @param[in] item Shared reference to MediaItem
+                        * @return SaverBuilder object
+                        */
                        SaverBuilder &setItem(const MediaItemSRef &item);
+
+                       /**
+                        * @brief Creates job
+                        * @param[in] onComplete Completion handler
+                        * @return Shared reference to IJob
+                        */
                        IJobSRef build(const NotiHandler &onComplete) const;
                private:
                        MediaItemSRef m_item;
                };
 
+               /**
+                * @brief Enumeration of possible flags
+                */
                enum {
-                       FLAG_THUMBNAIL = 1,
-                       FLAG_REMOVE = 2,
-                       FLAG_SAVE = 4,
-                       FLAG_RESOLUTION = 8,
+                       FLAG_THUMBNAIL = 1,    /**< Thumbnail*/
+                       FLAG_REMOVE = 2,       /**< Staged for deletion*/
+                       FLAG_SAVE = 4,         /**< Save*/
+                       FLAG_RESOLUTION = 8,   /**< Resolution*/
 
                        FLAGS_FROM_MEDIA_DB = (FLAG_THUMBNAIL | FLAG_REMOVE |
-                                       FLAG_RESOLUTION),
-                       FLAGS_SIMPLE_FILE = (FLAG_SAVE)
+                                       FLAG_RESOLUTION),       /**< File from media DB*/
+                       FLAGS_SIMPLE_FILE = (FLAG_SAVE) /**< Simple file*/
                };
 
        public:
+
+               /**
+                * @brief Creates new instance of MediaItem
+                * @param[in] media Media info
+                * @return Shared reference to MediaItem object
+                */
                static MediaItemSRef newInstance(media_info_h media);
+
+               /**
+                * @brief Creates new instance of MediaItem
+                * @param[in] filePath Path to file
+                * @return Shared reference to MediaItem object
+                */
                static MediaItemSRef newInstance(std::string filePath);
 
        public:
+               /**
+                * @brief Checks if MediaItem is valid
+                * @return true if valid, false if invalid
+                */
                bool isValid() const;
+
+               /**
+                * @brief Gets MediaItem flags
+                * @return Flags
+                */
                int getFlags() const;
+
+               /**
+                * @brief Gets type
+                * @return Media item type
+                */
                MediaType getType() const;
 
+               /**
+                * @brief Gets ID
+                * @return Media item ID
+                */
                const std::string &getId() const;
 
+               /**
+                * @brief Gets resolution
+                * @param[out] x X axis size
+                * @param[out] y Y axis size
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                ucl::Result getResolution(int &x, int &y) const;
 
+               /**
+                * @brief Gets file path
+                * @return File path
+                */
                const std::string &getFilePath() const;
 
+               /**
+                * @brief Gets path to thumbnail
+                * @param[in] cb Thumbnail creation callback
+                * @return RES_OK on synchronous callback, RES_FALSE on asynchronous,
+                * otherwise an error code on failure
+                */
                ucl::Result getThumbnailPath(const ThumbnailPathGetCb &cb) const;
+
+               /**
+                * @brief Cancels getting path to thumbnail
+                * @details Cancels callback and thumbnail generation
+                * @param[in] cb Callback
+                * @return RES_OK on synchronous callback, RES_FALSE on asynchronous,
+                * otherwise an error code on failure
+                */
                void cancelThumbnailPathGet(const ThumbnailPathGetCb &cb) const;
 
+               /**
+                * @brief Removes media items file
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                ucl::Result removeFile();
+
+               /**
+                * @brief Saves media items file locally
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                ucl::Result saveToDevice();
 
        protected:
                friend class ucl::ReffedObj<MediaItem>;
+
+               /**
+                * @brief Constructor
+                * @param[in] flags Flags
+                * @param[in] type Media type
+                */
                MediaItem(int flags, MediaType type);
+
+               /**
+                * @brief Destructor
+                */
                virtual ~MediaItem();
 
+               /**
+                * @brief Prepares media image data
+                * @param[in] media Media info
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                ucl::Result prepare(media_info_h media);
+
+               /**
+                * @brief Prepares media image data
+                * @param[in] media Media info
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                ucl::Result prepareImage(media_info_h media);
+
+               /**
+                * @brief Prepares media image data
+                * @param[in] filePath Path to media file
+                * @return RES_OK on success, otherwise an error code on failure
+                */
                ucl::Result prepare(std::string filePath);
 
        private:
index 9e7814a92902bd2660037c931c4f4daf0d5151e8..45a5dfb915d818de05ec36fdc21ab96818345490 100644 (file)
@@ -27,20 +27,60 @@ namespace gallery {
 
        UCL_DECLARE_REF_ALIASES(SoundManager);
 
+       /**
+        * @brief Provides set of instruments to operate with sound parameters
+        */
        class SoundManager final : public ucl::NonCopyable {
        public:
+
+               /**
+                * @brief Creates new instance of SoundManager
+                * @return Shared reference to SoundManager object
+                */
                static SoundManagerSRef newInstance();
 
        public:
+
+               /**
+                * @brief Checks if media device is ready
+                * @return true if ready, false if not ready
+                */
                bool isMediaDeviceReady() const;
 
+               /**
+                * @brief Gets current volume level
+                * @return Current volume level
+                */
                int getCurrentMediaVolume() const;
+
+               /**
+                * @brief Gets max volume level
+                * @return Max volume level
+                */
                int getMaxMediaVolume() const;
 
+               /**
+                * @brief Adds media device state change handler
+                * @param[in] handler Handler
+                */
                void addMediaDeviceStateChangeHandler(NotiHandler handler);
+
+               /**
+                * @brief Removes media device state change handler
+                * @param[in] handler Handler
+                */
                void delMediaDeviceStateChangeHandler(NotiHandler::CDRef handler);
 
+               /**
+                * @brief Adds media volume state change handler
+                * @param[in] handler Handler
+                */
                void addMediaVolumeChangeHandler(NotiHandler handler);
+
+               /**
+                * @brief Adds media volume change handler
+                * @param[in] handler Handler
+                */
                void delMediaVolumeChangeHandler(NotiHandler::CDRef handler);
 
        private:
index 9ad2e4a475937dbacb01ba9511449b246c6432c5..f6998d3da7aec63259f9f7672215b36204a43642 100644 (file)
 
 namespace gallery { namespace util {
 
+       /**
+        * @brief Creates CustomMediaAlbum
+        * @param[in] filePathArray Vector of file paths
+        * @return Shared reference to CustomMediaAlbum
+        */
        CustomMediaAlbumSRef makeMediaAlbum(
                        const std::vector<std::string> &filePathArray);
 }}
index 38feee589b3ce2db0f8a746a2d50565a92bdc226..a6f7d5e972ac22acce912d96cbe7f1da79e59473 100644 (file)
 
 namespace gallery {
 
+       /**
+        * @brief Enumeration of media types
+        */
        enum class MediaType {
-               IMAGE,
-               VIDEO,
-               SOUND,
-               MUSIC,
-               OTHERS
+               IMAGE,   /**< Image*/
+               VIDEO,   /**< Video*/
+               SOUND,   /**< Sound*/
+               MUSIC,   /**< Music*/
+               OTHERS   /**< Others*/
        };
 }