2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FCntImageContentInfo.h
18 * @brief This is the header file for the %ImageContentInfo class.
20 * This header file contains the declarations of the %ImageContentInfo class.
23 #ifndef _FCNT_IMAGE_CONTENT_INFO_H_
24 #define _FCNT_IMAGE_CONTENT_INFO_H_
26 #include <FCntContentInfo.h>
28 namespace Tizen { namespace Content
31 class _ImageContentInfoImpl;
32 class _ImageContentData;
35 * @class ImageContentInfo
36 * @brief This class provides methods to access the image content information.
40 * @final This class is not intended for extension.
42 * The %ImageContentInfo class provides methods to access the image content information that is extracted from a physical file. @n
43 * Before getting the image content information, ContentManager must be used to create the content.
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>.
47 * The following example demonstrates how to use the %ImageContentInfo class.
52 * #include <FContent.h>
53 * #include <FSystem.h>
55 * using namespace Tizen::Content;
58 * MyClass::TestImageContentInfo(void)
60 * ContentManager contentManager;
61 * result r = contentManager.Construct();
63 * ImageContentInfo imageContentInfo;
64 * r = imageContentInfo.Construct(null);
66 * Tizen::Base::String sourcePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/flower.jpg";
67 * Tizen::Base::String destPath = Tizen::System::Environment::GetMediaPath() + L"Images/flower.jpg";
69 * ContentId contentId = contentManager.CreateContent(sourcePath, destPath, false, &imageContentInfo);
70 * r = GetLastResult();
76 class _OSP_EXPORT_ ImageContentInfo
77 : public Tizen::Content::ContentInfo
81 * The object is not fully constructed after this constructor is called. @n
82 * For full construction, the Construct() method must be called right after calling this constructor.
86 ImageContentInfo(void);
89 * This destructor overrides Tizen::Base::Object::~Object().
93 virtual ~ImageContentInfo(void);
96 * Initializes this instance of %ImageContentInfo with the specified parameter.
99 * @brief <i> [Compatibility] </i>
103 * @compatibility This method has compatibility issues with OSP compatible applications. @n
104 * For more information, see @ref CompImageContentInfoConstructPage "here".
107 * @return An error code
108 * @param[in] pContentPath The content path @n
109 * The path should start with the directory path returned by
110 * either Tizen::System::Environment::GetMediaPath() or Tizen::System::Environment::GetExternalStoragePath() @n
111 * If the path is @c null,
112 * use ContentManager::CreateContent(const Tizen::Base::ByteBuffer&, const Tizen::Base::String&, const ContentInfo*) @n
113 * or ContentManager::CreateContent(const Tizen::Base::String&, const Tizen::Base::String&, bool, const ContentInfo*),
114 * instead of this method.
115 * @exception E_SUCCESS The method is successful.
116 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
117 * @exception E_INVALID_ARG The specified input parameter is invalid.
118 * @exception E_OUT_OF_MEMORY The memory is insufficient.
119 * @exception E_IO An I/O error has occurred.
120 * @exception E_SYSTEM An internal error has occurred.
121 * @remarks If the content has coordinates as metadata, they are automatically set.
123 result Construct(const Tizen::Base::String* pContentPath);
127 * @page CompImageContentInfoConstructPage Compatibility for the file path.
128 * @section CompImageContentInfoConstructPageIssueSection Issues
129 * The content path argument of this method in OSP compatible applications has the following issues: @n
130 * <UL><li> The content path should be a path that begins with an allowed path prefix.
131 * For example, L"/Media/Images/flower.jpg", L"/Storagecard/Media/Images/flower.jpg". </UL></li>
133 * @section CompImageContentInfoConstructPageSolutionSection Resolutions
134 * This issue has been resolved in Tizen. @n
135 * <UL><li> The content path can be a path without a specific allowed path prefix.
136 * Applications do not need to know the specific allowed path prefixes.
137 * To get the directory path, use the following methods: </UL></li>
138 * - For accessing the media directory, use Tizen::System::Environment::GetMediaPath().
139 * - For accessing the external storage, use Tizen::System::Environment::GetExternalStoragePath().
146 * Initializes this instance of %ImageContentInfo with the specified parameters.
148 * @brief <i> [Deprecated] </i>
149 * @deprecated This method is deprecated as there is a problem in managing the user-defined thumbnail and device coordinates. @n
150 * Instead of using this method, use Construct(const Tizen::Base::String*). @n
151 * To set the coordinates in the ContentInfo instance, use ContentInfo::SetCoordinates(const Tizen::Locations::Coordinates&).
154 * @return An error code
155 * @param[in] contentPath The content path
156 * @param[in] thumbnailPath The thumbnail path
157 * @param[in] setGps Set to @c true to save the device's last known coordinates of the ContentInfo instance, @n
159 * The coordinate information may be incorrect if it is outdated or has never been updated @n
160 * To update the coordinate information or to get the exact value,
161 * use Tizen::Locations::LocationProvider::RequestLocationUpdates() before calling this method.
162 * @exception E_SUCCESS The method is successful.
163 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
164 * @exception E_INVALID_ARG The specified input parameter is invalid.
165 * @exception E_OUT_OF_MEMORY The memory is insufficient.
166 * @exception E_IO An I/O error has occurred.
168 * - The content path must start with @c '/Media' or @c '/Storagecard/Media'.
169 * - The thumbnail path must start with @c '/Home', @c '/Media', or @c '/Storagecard/Media'. @n
170 * The permitted format for a thumbnail image is bitmap (bmp).
173 virtual result Construct(const Tizen::Base::String& contentPath, const Tizen::Base::String& thumbnailPath = L"", bool setGps = false);
176 * Gets the width of the image file.
180 * @return The width of the image file
182 int GetWidth(void) const;
185 * Gets the height of the image file.
189 * @return The height of the image file
191 int GetHeight(void) const;
194 * Gets the title of the image file.
198 * @return The title of the image file, @n
199 * else @c Unknown if the value is empty
201 Tizen::Base::String GetTitle(void) const;
204 * Gets the orientation of the image file.
208 * @return The orientation of the image file
210 ImageOrientationType GetOrientation(void) const;
215 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
217 ImageContentInfo(const ImageContentInfo& rhs);
220 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
222 ImageContentInfo& operator =(const ImageContentInfo& rhs);
226 _ImageContentData* __pImageContentData;
227 _ImageContentInfoImpl* __pImageContentInfoImpl;
228 friend class _ImageContentInfoImpl;
230 }; // ImageContentInfo
234 #endif // _FCNT_IMAGE_CONTENT_INFO_H_