Fix : Remove exception handling codes at the sample code
[platform/framework/native/content.git] / inc / FCntContentInfo.h
index eef3e55..0fe1fcc 100644 (file)
 #include <FCntTypes.h>
 #include <FLocCoordinates.h>
 
-namespace Tizen { namespace Locations
-{
-class Coordinates;
-}}
-
 namespace Tizen { namespace Graphics
 {
 class Bitmap;
@@ -56,7 +51,7 @@ class _ContentInfoImpl;
  *
  * When a user creates content, its content information is created as a new pair. @n
  * When a user deletes content, its content information is deleted from the content database. @n
- * This class provides methods to get or to set the specific content information. @n
+ * This class provides methods to get or set specific content information. @n
  * The physical file is not updated even if the set methods are called.
  *
  * For more information on the different types of content information, see <a href="../org.tizen.native.appprogramming/html/guide/content/device_content_mgmt.htm">Device Content Management</a>.
@@ -64,25 +59,27 @@ class _ContentInfoImpl;
  * The following example demonstrates how to use the %ContentInfo class.
  *
  * @code
+ * #include <FApp.h>
+ * #include <FBase.h>
+ * #include <FContent.h>
+ * #include <FSystem.h>
+ *
+ * using namespace Tizen::Content;
+ *
  * result
  * MyClass::TestContentInfo(void)
  * {
- *             result r = E_SUCCESS;
- *
- *             ContentId contentId;
  *             ContentManager contentManager;
- *             r = contentManager.Construct();
- *             TryReturn(!IsFailed(r), r, "Construct failed.");
+ *             result r = contentManager.Construct();
  *
  *             ImageContentInfo imageContentInfo;
  *             r = imageContentInfo.Construct(null);
- *             TryReturn(!IsFailed(r), r, "Construct failed.");
  *
  *             Tizen::Base::String sourcePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/flower.jpg";
  *             Tizen::Base::String destPath = Tizen::System::Environment::GetMediaPath() + L"Images/flower.jpg";
  *
- *             contentId = contentManager.CreateContent(sourcePath, destPath, false, &imageContentInfo);
- *             TryReturn(Tizen::Base::UuId::GetInvalidUuId() != contentId, GetLastResult(), "CreateContent failed.");
+ *             ContentId contentId = contentManager.CreateContent(sourcePath, destPath, false, &imageContentInfo);
+ *             r = GetLastResult();
  *
  *             return r;
  * }
@@ -103,15 +100,15 @@ public:
         * @if OSPDEPREC
         * Initializes this instance of %ContentInfo with the specified parameters.
         *
-        * @brief       <i> [Deprecated] </i>
+        * @brief          <i> [Deprecated] </i>
         * @deprecated This method is deprecated as there is a problem in managing the user-defined thumbnail and device coordinates.
         * @since                       2.0
         *
-        * @return                      An error code
-        * @param[in]   contentPath           The content path
+        * @return              An error code
+        * @param[in]   contentPath         The content path
         * @param[in]   thumbnailPath       The thumbnail path
-        * @param[in]   setGps                 Set to @c true to save the device's last known coordinates in the %ContentInfo instance, @n
-        *                                                else @c false
+        * @param[in]   setGps              Set to @c true to save the device's last known coordinates of the %ContentInfo instance, @n
+        *                                  else @c false
         * @endif
         */
        virtual result Construct(const Tizen::Base::String& contentPath, const Tizen::Base::String& thumbnailPath = L"", bool setGps = false) = 0;
@@ -135,20 +132,20 @@ public:
        ContentType GetContentType(void) const;
 
        /**
-        * Gets the mime type.
+        * Gets the MIME type.
         *
         * @since               2.0
         *
-        * @return              The mime type
+        * @return              The MIME type
         */
        Tizen::Base::String GetMimeType(void) const;
 
        /**
-        * Gets the date and time of the created content.
+        * Gets the date and time of the added content.
         *
         * @since               2.0
         *
-        * @return              The content's creation time (GMT)
+        * @return              The added time to database (GMT)
         */
        Tizen::Base::DateTime GetDateTime(void) const;
 
@@ -167,6 +164,7 @@ public:
         * @since               2.0
         *
         * @return              The content name
+        * @remarks         The content name is not a file name.
         */
        Tizen::Base::String GetContentName(void) const;
 
@@ -184,7 +182,7 @@ public:
         *
         * @since               2.0
         *
-        * @return              A reference to the coordinates
+        * @return  A reference to the Tizen::Locations::Coordinates instance
         */
        const Tizen::Locations::Coordinates& GetCoordinates(void) const;
 
@@ -193,7 +191,7 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
+        * @return              An error code
         * @param[in]   coordinates                     The user-defined coordinates
         * @exception   E_SUCCESS                       The method is successful.
         */
@@ -204,11 +202,10 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
+        * @return              An error code
         * @param[in]   locationTag                     The new location tag
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 45 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetLocationTag(const Tizen::Base::String& locationTag);
 
@@ -226,11 +223,10 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
+        * @return              An error code
         * @param[in]   rating                          The new rating
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 45 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetRating(const Tizen::Base::String& rating);
 
@@ -248,11 +244,10 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
-        * @param[in]   category                                The new category
+        * @return              An error code
+        * @param[in]   category                        The new category
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 45 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetCategory(const Tizen::Base::String& category);
 
@@ -270,11 +265,10 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
-        * @param[in]   description                             The new description
+        * @return              An error code
+        * @param[in]   description                     The new description
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 140 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetDescription(const Tizen::Base::String& description);
 
@@ -296,23 +290,22 @@ public:
         * @since                       2.0
         * @if OSPCOMPAT
         * @compatibility This method has compatibility issues with OSP compatible applications. @n
-        *                                       For more information, see @ref CompContentInfoGetThumbnailNPage "here".
+        *                                For more information, see @ref CompContentInfoGetThumbnailNPage "here".
         * @endif
         *
-        * @return                      A pointer to the thumbnail image
-        * @exception   E_SUCCESS                                       The method is successful.
+        * @return              A pointer to the thumbnail image
+        * @exception   E_SUCCESS                               The method is successful.
         * @exception   E_DATA_NOT_FOUND                The thumbnail image does not exist.
-        * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
         * @remarks     The specific error code can be accessed using the GetLastResult() method.
         */
        Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
 
        /**
         * @if OSPCOMPAT
-        * @page                CompContentInfoGetThumbnailNPage Compatibility for GetThumbnailN().
+        * @page        CompContentInfoGetThumbnailNPage Compatibility for GetThumbnailN().
         * @section     CompContentInfoGetThumbnailNPageIssueSection Issue
-        *                              The thumbnail size of this method in OSP compatible applications has the following issues: @n
-        *                              <DIV> The size is changed from 80x60 pixels to the size of image which is returned from the platform since %Tizen API 2.1.</DIV>
+        *                      The thumbnail size of this method in OSP compatible applications has the following issues: @n
+        *                      <DIV> The size is changed from 80x60 pixels to the size of the image which is returned from the platform since %Tizen API 2.1.</DIV>
         *
         * @endif
         */
@@ -323,7 +316,7 @@ public:
         * @since               2.0
         *
         * @return              @c true if this content has DRM, @n
-        *                                      else @c false
+        *                              else @c false
         */
        bool IsDrmProtected(void) const;
 
@@ -341,24 +334,22 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
+        * @return              An error code
         * @param[in]   contentName                     The new content name
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 45 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetContentName(const Tizen::Base::String& contentName);
 
        /**
         * Sets the keyword.
         *
-        * @since                       2.0
+        * @since               2.0
         *
-        * @return                      An error code
-        * @param[in]   keyword                                 The new keyword
+        * @return              An error code
+        * @param[in]   keyword                         The new keyword
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 45 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetKeyword(const Tizen::Base::String& keyword);
 
@@ -367,11 +358,10 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
-        * @param[in]   author                                  The new author
+        * @return              An error code
+        * @param[in]   author                          The new author
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 45 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetAuthor(const Tizen::Base::String& author);
 
@@ -389,11 +379,10 @@ public:
         *
         * @since                       2.0
         *
-        * @return                      An error code
-        * @param[in]   provider                                        The new content provider
+        * @return              An error code
+        * @param[in]   provider                        The new content provider
         * @exception   E_SUCCESS           The method is successful.
         * @exception   E_INVALID_ARG           The length of the input data exceeds the maximum limit of 45 characters.
-        * @exception   E_OUT_OF_MEMORY                 The memory is insufficient.
         */
        result SetProvider(const Tizen::Base::String& provider);
 
@@ -416,6 +405,7 @@ public:
        Tizen::Base::String GetMediaFormat(void) const;
 
 protected:
+
        //
        // This class is for internal use only.
        // Using this class can cause behavioral, security-related, and consistency-related issues in the application.
@@ -488,6 +478,7 @@ protected:
        result SetContentData(const _ContentData* pContentData);
 
 private:
+
        /**
         * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
         */
@@ -498,23 +489,14 @@ private:
         */
        ContentInfo& operator =(const ContentInfo& rhs);
 
-       _ContentData* GetContentData(void);
-
 private:
-       _ContentData* __pContentData;
-       mutable Tizen::Locations::Coordinates coordinates;
-
-       friend class _ContentManagerImpl;
-       friend class _ContentSearchImpl;
-       friend class _ContentDirectoryImpl;
-       friend class _ContentUtility;
-       friend class _PlayListManagerImpl;
-       friend class _PlayListImpl;
+       _ContentInfoImpl* __pContentInfoImpl;
+       mutable Tizen::Locations::Coordinates __coordinates;
 
        friend class _ContentInfoImpl;
-       _ContentInfoImpl* __pImpl;
+       friend class _ContentInfoHelper;
 
-};  // class ContentInfo
+};  // ContentInfo
 
 }}  // Tizen::Content