[content] Fix description in DownloadManager
[platform/framework/native/content.git] / inc / FCntImageMetadata.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                        FCntImageMetadata.h
19  * @brief               This is the header file for the %ImageMetadata class.
20  *
21  * This header file contains the declarations of the %ImageMetadata class.
22  */
23
24 #ifndef _FCNT_IMAGE_METADATA_H_
25 #define _FCNT_IMAGE_METADATA_H_
26
27 #include <FBaseObject.h>
28 #include <FCntTypes.h>
29
30 namespace Tizen { namespace Graphics
31 {
32 class Bitmap;
33 }}
34
35 namespace Tizen { namespace Content
36 {
37
38 class _ImageMetadataImpl;
39
40 /**
41  * @class       ImageMetadata
42  * @brief       This class provides methods to access the image metadata.
43  *
44  * @since       2.0
45  *
46  * The %ImageMetadata class provides methods to access the image metadata that contains the image content-specific attributes.
47  *
48  * The following example demonstrates how to use the %ImageMetadata class.
49  *
50  * @code
51  * result
52  * MyClass::TestImageMetadata(void)
53  * {
54  *              result r = E_SUCCESS;
55  *
56  *              Tizen::Base::String contentPath = Tizen::System::Environment::GetMediaPath() + L"Images/full_meta.jpg";
57  *              ImageMetadata* pImgMeta = ContentManagerUtil::GetImageMetaN(contentPath);
58  *              TryReturn(pImgMeta != null, GetLastResult(), "ContentManagerUtil::GetImageMetaN failed.");
59  *
60  *              // Width
61  *              pImgMeta->GetWidth();
62  *
63  *              // Height
64  *              pImgMeta->GetHeight();
65  *
66  *              // Camera
67  *              pImgMeta->GetCameraManufacturer();
68  *
69  *              // Model
70  *              pImgMeta->GetCameraModel();
71  *
72  *              // Software
73  *              pImgMeta->GetSoftware();
74  *
75  *              // Date time
76  *              pImgMeta->GetDateTime();
77  *
78  *              // Thumbnail
79  *              Tizen::Media::Image image;
80  *              r = image.Construct();
81  *              if (IsFailed(r))
82  *              {
83  *                      delete pImgMeta;
84  *                      return r;
85  *              }
86  *
87  *              Tizen::Graphics::Bitmap* pBitmap = pImgMeta->GetThumbnailN();
88  *              if (pBitmap == null)
89  *              {
90  *                      delete pImgMeta;
91  *                      return GetLastResult();
92  *              }
93  *
94  *              Tizen::Base::String thumbnailPath = Tizen::System::Environment::GetMediaPath() + L"Images/image.bmp";
95  *              r = image.EncodeToFile(*pBitmap, Tizen::Media::IMG_FORMAT_BMP, thumbnailPath, false);
96  *              if (IsFailed(r))
97  *              {
98  *                      delete pImgMeta;
99  *                      delete pBitmap;
100  *                      return r;
101  *              }
102  *
103  *              delete pImgMeta;
104  *              delete pBitmap;
105  *
106  *              return r;
107  * }
108  * @endcode
109  */
110 class _OSP_EXPORT_ ImageMetadata
111         : virtual public Tizen::Base::Object
112 {
113 public:
114         /**
115          * This is the default constructor for this class.
116          *
117          * @since               2.0
118          */
119         ImageMetadata(void);
120
121         /**
122          * Copying of objects using this copy constructor is allowed.
123          *
124          * @since               2.0
125          *
126          * @param[in]   rhs     An instance of %ImageMetadata
127          */
128         ImageMetadata(const ImageMetadata& rhs);
129
130         /**
131          * This destructor overrides Tizen::Base::Object::~Object().
132          *
133          * @since               2.0
134          */
135         virtual ~ImageMetadata(void);
136
137         /**
138          * Gets the width of the image.
139          *
140          * @since               2.0
141          *
142          * @return              The width of the image
143          */
144         int GetWidth(void) const;
145
146         /**
147          * Gets the height of the image.
148          *
149          * @since               2.0
150          *
151          * @return              The height of the image
152          */
153         int GetHeight(void) const;
154
155         /**
156          * Gets the name of the camera's manufacturer.
157          *
158          * @since               2.0
159          *
160          * @return              The name of the camera's manufacturer
161          */
162         Tizen::Base::String GetCameraManufacturer(void) const;
163
164         /**
165          * Gets the model of the camera.
166          *
167          * @since               2.0
168          *
169          * @return              The model of the camera
170          */
171         Tizen::Base::String GetCameraModel(void) const;
172
173         /**
174          * Gets the version of either the software or the firmware of the camera or the image input device
175          * used to generate the image.
176          *
177          * @since               2.0
178          *
179          * @return              The version of either the software or the firmware of the camera or the image input device
180          *                                      used to generate the image
181          */
182         Tizen::Base::String GetSoftware(void) const;
183
184         /**
185          * Gets the date and time of the created content.
186          *
187          * @since               2.0
188          *
189          * @return              The date and time of the created content
190          */
191         Tizen::Base::String GetDateTime(void) const;
192
193         /**
194          * Gets the latitude of the image.
195          *
196          * @since               2.0
197          *
198          * @return              The latitude of the image
199          * @remarks     If there is no latitude in the image, @c -200.0 is returned.
200          */
201         double GetLatitude(void) const;
202
203         /**
204          * Gets the longitude of the image.
205          *
206          * @since               2.0
207          *
208          * @return              The longitude of the image
209          * @remarks     If there is no longitude in the image, @c -200.0 is returned.
210          */
211         double GetLongitude(void) const;
212
213         /**
214          * Gets the orientation of the image.
215          *
216          * @since               2.0
217          *
218          * @return              The orientation of the image
219          */
220         ImageOrientationType GetOrientation(void) const;
221
222         /**
223          * Gets the white balance of the image.
224          *
225          * @since               2.0
226          *
227          * @return              The white balance of the image
228          */
229         Tizen::Base::String GetWhiteBalance(void) const;
230
231         /**
232          * Gets the thumbnail image.
233          *
234          * @since                       2.0
235          *
236          * @return                      A pointer to the thumbnail image
237          * @exception   E_SUCCESS                       The method is successful.
238          * @exception   E_DATA_NOT_FOUND        The thumbnail image does not exist.
239          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
240          * @remarks     The specific error code can be accessed using the GetLastResult() method.
241          */
242         Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
243
244         /**
245          * Compares the equality of values between two %ImageMetadata objects by overriding the Tizen::Base::Object::Equals() method.
246          *
247          * @since          2.0
248          *
249          * @return         @c true if all the fields in the objects are equal, @n
250          *                     else @c false
251          * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
252          * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
253          */
254         virtual bool Equals(const Tizen::Base::Object& rhs) const;
255
256         /**
257          * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
258          *
259          * @since         2.0
260          *
261          * @return        The hash value of the current instance
262          */
263         virtual int GetHashCode(void) const;
264
265         /**
266          * Copying of objects using this copy assignment operator is allowed.
267          *
268          * @since          2.0
269          *
270          * @return         A reference to this instance
271          * @param[in]    rhs An instance of %ImageMetadata
272          */
273         ImageMetadata& operator =(const ImageMetadata& rhs);
274
275 private:
276         friend class _ImageMetadataImpl;
277         _ImageMetadataImpl* __pImpl;
278
279 };  // class ImageMetadata
280
281 }}  // Tizen::Content
282
283 #endif  // _FCNT_IMAGE_METADATA_H_