[content] Fix description in DownloadManager
[platform/framework/native/content.git] / inc / FCntOtherContentInfo.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file                        FCntOtherContentInfo.h
19  * @brief               This is the header file for the %OtherContentInfo class.
20  *
21  * This header file contains the declarations of the %OtherContentInfo class.
22  */
23
24 #ifndef _FCNT_OTHER_CONTENT_INFO_H_
25 #define _FCNT_OTHER_CONTENT_INFO_H_
26
27 #include <FCntContentInfo.h>
28
29 namespace Tizen { namespace Content
30 {
31
32 class _OtherContentInfoImpl;
33
34 /**
35  * @class       OtherContentInfo
36  * @brief       This class provides methods to access the other content information.
37  *
38  * @since       2.0
39  *
40  * @final       This class is not intended for extension.
41  *
42  * The %OtherContentInfo class provides methods to access the other content information. @n
43  * Before getting the other content information, the ContentManager class must be used to create the content. @n
44  * If the E_UNSUPPORTED_FORMAT exception is received from the ContentManagerUtil::CheckContentType() method, the file can only be created as %OtherContentInfo.
45  *
46  * 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>.
47  *
48  * The following example demonstrates how to use the %OtherContentInfo class.
49  *
50  * @code
51  * result
52  * MyClass::TestOtherContentInfo(void)
53  * {
54  *              result r = E_SUCCESS;
55  *
56  *              ContentId contentId;
57  *              ContentManager contentManager;
58  *              r = contentManager.Construct();
59  *              TryReturn(!IsFailed(r), r, "Construct failed.");
60  *
61  *              OtherContentInfo otherContentInfo;
62  *              r = otherContentInfo.Construct(null);
63  *              TryReturn(!IsFailed(r), r, "Construct failed.");
64  *
65  *              Tizen::Base::String sourcePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/flower.doc";
66  *              Tizen::Base::String destPath = Tizen::System::Environment::GetMediaPath() + L"Others/flower.doc";
67  *
68  *              contentId = contentManager.CreateContent(sourcePath, destPath, false, &otherContentInfo);
69  *              TryReturn(Tizen::Base::UuId::GetInvalidUuId() != contentId, GetLastResult(), "CreateContent failed.");
70  *
71  *              return r;
72  * }
73  * @endcode
74  */
75 class _OSP_EXPORT_ OtherContentInfo
76         : public Tizen::Content::ContentInfo
77 {
78 public:
79         /**
80          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
81          *
82          * @since               2.0
83          *
84          * @remarks     After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
85          */
86         OtherContentInfo(void);
87
88         /**
89          * This destructor overrides Tizen::Base::Object::~Object().
90          *
91          * @since               2.0
92          */
93         virtual ~OtherContentInfo(void);
94
95         /**
96          * Initializes this instance of %OtherContentInfo with the specified parameter.
97          *
98          * @if OSPCOMPAT
99          * @brief <i> [Compatibility] </i>
100          * @endif
101          * @since                       2.0
102          * @if OSPCOMPAT
103          * @compatibility This method has compatibility issues with OSP compatible applications. @n
104          *                       For more information, see @ref CompOtherContentInfoConstructPage "here".
105          * @endif
106          *
107          * @return                      An error code
108          * @param[in]   pContentPath                                    The content path
109          * @exception   E_SUCCESS                                       The method is successful.
110          * @exception   E_FILE_NOT_FOUND                The specified file cannot be found or accessed.
111          * @exception   E_INVALID_ARG                           The specified input parameter is invalid.
112          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
113          * @exception   E_IO                                                            An I/O error has occurred.
114          * @exception   E_SYSTEM                                                An internal error has occurred.
115          * @remarks             The @c pContentPath should start with directory path returned by either Tizen::System::Environment::GetMediaPath() or Tizen::System::Environment::GetExternalStoragePath(). @n
116          *                     If @c pContentPath is @c null, use ContentManager::CreateContent(const Tizen::Base::ByteBuffer&, const Tizen::Base::String&, const ContentInfo*)
117          *                     or ContentManager::CreateContent(const Tizen::Base::String&, const Tizen::Base::String&, bool, const ContentInfo*).
118          */
119         result Construct(const Tizen::Base::String* pContentPath);
120
121         /**
122          * @if OSPCOMPAT
123          * @page        CompOtherContentInfoConstructPage Compatibility for the file path.
124          * @section     CompOtherContentInfoConstructPageIssueSection Issues
125          *                 The content path argument of this method in OSP compatible applications has the following issues: @n
126          *                 -# The content path should be a path that begins with an allowed path prefix. @n
127          *                     For example, L"/Media/Images/flower.jpg", L"/Storagecard/Media/Images/flower.jpg".
128          *
129          * @section     CompOtherContentInfoConstructPageSolutionSection Resolutions
130          *                 This issue has been resolved in Tizen. @n
131          *                 -# The content path can be a path without a specific allowed path prefix. @n
132          *                 Application do not need to know the specific allowed path prefixes. @n
133          *                 To get the directory path, use the following methods: @n
134          *                 - For accessing the media directory, use Tizen::System::Environment::GetMediaPath().
135          *                 - For accessing the external storage, use Tizen::System::Environment::GetExternalStoragePath().
136          * @endif
137          */
138
139         /**
140          * @if OSPDEPREC
141          * Initializes this instance of %OtherContentInfo with the specified parameters.
142          *
143          * @brief       <i> [Deprecated] </i>
144          * @deprecated   This method is deprecated as there is a problem in managing the user-defined thumbnail and device coordinates. @n
145          *                       Instead of using this method, use Construct(const Tizen::Base::String*). @n
146          *                       To set the coordinates in the ContentInfo instance, use ContentInfo::SetCoordinates(const Tizen::Locations::Coordinates&).
147          * @since                       2.0
148          *
149          * @return                      An error code
150          * @param[in]           contentPath                                     The content path
151          * @param[in]           thumbnailPath                           The thumbnail path
152          * @param[in]           setGps                                                  Set to @c true to save the device's last known coordinates in the ContentInfo instance, @n
153          *                                                           else @c false @n
154          *                                                                                                                      The coordinate information may be incorrect if it is outdated or has never been updated. @n
155          *                                                           To update the coordinate information or to get the exact value,
156          *                                                           use Tizen::Locations::LocationProvider::RequestLocationUpdates() before calling this method.
157          * @exception           E_SUCCESS                                       The method is successful.
158          * @exception           E_FILE_NOT_FOUND                The specified file cannot be found or accessed.
159          * @exception           E_INVALID_ARG                           The specified input parameter is invalid.
160          * @exception           E_OUT_OF_MEMORY         The memory is insufficient.
161          * @exception           E_IO                                                            An I/O error has occurred.
162          * @remarks             The content path must start with @c '/Media' or @c '/Storagecard/Media'. @n
163          *                       The thumbnail path must start with @c '/Home', @c '/Media', or @c '/Storagecard/Media'. @n
164          *                       The permitted format for a thumbnail image is bitmap (bmp).
165          * @endif
166          */
167         virtual result Construct(const Tizen::Base::String& contentPath, const Tizen::Base::String& thumbnailPath = L"", bool setGps = false);
168
169 private:
170         /**
171          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
172          */
173         OtherContentInfo(const OtherContentInfo& rhs);
174
175         /**
176          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
177          */
178         OtherContentInfo& operator =(const OtherContentInfo& rhs);
179
180 private:
181         bool __isCreated;
182
183         friend class _OtherContentInfoImpl;
184         _OtherContentInfoImpl* __pImpl;
185
186 };  // class OtherContentInfo
187
188 }}  // Tizen::Content
189
190 #endif  // _FCNT_OTHER_CONTENT_INFO_H_