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