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