merge checked header file
[platform/framework/native/media.git] / inc / FMediaCamera.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 /**
19  * @file                        FMediaCamera.h
20  * @brief                       This is the header file for the %Camera class.
21  *
22  * This header file contains the declarations of the %Camera class.
23  */
24
25 #ifndef _FMEDIA_CAMERA_H_
26 #define _FMEDIA_CAMERA_H_
27
28 #include <FBase.h>
29 #include <FGraphics.h>
30 #include <FMediaCameraTypes.h>
31 #include <FMediaICameraEventListener.h>
32
33 namespace Tizen { namespace Media
34 {
35
36 class IVideoStreamFilter;
37 class _CameraImpl;
38
39 /**
40  * @class       Camera
41  * @brief       This class controls the camera device.
42  *
43  * @since               2.0
44  *
45  *
46  * The %Camera class controls the camera device.
47  * The supported properties are device-dependent. The list of the properties available can be retrieved using the methods of %Camera and MediaCapability classes.
48  * All the other methods, except SetAutoFocus(), StartPreview(), and Capture() work synchronously.
49  * The previewed or captured data are passed through ICameraEventListener. @n
50  *
51  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/capturing_still_images.htm">Capturing Still Images</a>.
52  *
53  * The following example demonstrates how to use the %Camera class.
54  *
55  * @code
56  * #include <FBase.h>
57  * #include <FGraphics.h>
58  * #include <FUi.h>
59  * #include <FMedia.h>
60  *
61  * using namespace Tizen::Graphics;
62  * using namespace Tizen::Ui;
63  * using namespace Tizen::Ui::Controls;
64  * using namespace Tizen::Media;
65  *
66  * class CameraSample
67  *     : public Tizen::Ui::Controls::Form
68  *     , public Tizen::Media::ICameraEventListener
69  * {
70  * public:
71  *     CameraSample(void);
72  *     result Start(void);
73  *     void Stop(void);
74  *
75  * protected:
76  *     virtual void OnCameraAutoFocused(bool completeCondition) {}
77  *     virtual void OnCameraPreviewed( Tizen::Base::ByteBuffer& previewedData, result r) {}
78  *     virtual void OnCameraCaptured( Tizen::Base::ByteBuffer& capturedData, result r) {}
79  *     virtual void OnCameraErrorOccurred(CameraErrorReason r ) {}
80  *
81  * private:
82  *     Camera __camera;
83  *     OverlayRegion * __pOverlay;
84  * };
85  *
86  * CameraSample::CameraSample(void)
87  * {
88  *     __pOverlay = null;
89  * }
90  *
91  * result
92  * CameraSample::Start(void)
93  * {
94  *     result r = E_SUCCESS;
95  *     Rectangle rect(0, 0, 320, 240);
96  *     bool modified = false;
97  *     bool isValid = false;
98  *     BufferInfo bufferInfo;
99  *
100  *     r = __camera.Construct(*this, CAMERA_PRIMARY);
101  *     if (IsFailed(r))
102  *     {
103  *         return r;
104  *     }
105  *
106  *     r = __camera.PowerOn();
107  *     if (IsFailed(r))
108  *     {
109  *         return r;
110  *     }
111  *
112  *     isValid = OverlayRegion::EvaluateBounds(OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN, rect, modified);
113  *     if (isValid != true)
114  *     {
115  *         return GetLastResult();
116  *     }
117  *
118  *     // Gets OverlayRegion from this Form
119  *     __pOverlay = GetOverlayRegionN(rect, OVERLAY_REGION_TYPE_PRIMARY_CAMERA);
120  *     if (__pOverlay == null)
121  *     {
122  *         return GetLastResult();
123  *     }
124  *
125  *     __pOverlay->GetBackgroundBufferInfo(bufferInfo);
126  *
127  *     r = __camera.StartPreview(&bufferInfo, true);
128  *     if (IsFailed(r))
129  *     {
130  *         goto CATCH;
131  *     }
132  *
133  *     return E_SUCCESS;
134  * CATCH:
135  *     if (__pOverlay)
136  *     {
137  *         delete __pOverlay;
138  *         __pOverlay = null;
139  *     }
140  *     return r;
141  *  }
142  *
143  * void
144  * CameraSample::Stop(void)
145  * {
146  *     __camera.StopPreview();
147  *     __camera.PowerOff();
148  *     if (__pOverlay)
149  *     {
150  *         delete __pOverlay;
151  *         __pOverlay = null;
152  *     }
153  * }
154  *
155  * @endcode
156  *
157  *
158  */
159 class _OSP_EXPORT_ Camera
160         : public Tizen::Base::Object
161 {
162 public:
163         /**
164          * This is the default constructor for this class.
165          *
166          * @since               2.0
167          *
168          * @remarks         The object is not fully constructed after this constructor is called. For full construction,
169          * the Construct() method must be called right after calling this constructor.
170          */
171         Camera(void);
172
173         /**
174          * This is the destructor for this class. @n
175          * All allocated resources are deallocated by this method. This method must be called in the same thread
176          * where the Construct() method is called.This polymorphic destructor should be overridden if required.
177          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
178          *
179          * @since               2.0
180          *
181          */
182         virtual ~Camera(void);
183
184         /**
185         * Initializes this instance of %Camera with the specified parameters. @n
186         * The %Construct() method creates an instance of %Camera in the subsystem. Only one instance is created at a given time.
187         *
188         * @since                2.0
189         *
190         * @return               An error code
191         * @param[in]    listener                                An instance of ICameraEventListener
192         * @param[in]    camSel                                  The %Camera to power on
193         * @exception    E_SUCCESS                               The method is successful.
194         * @exception    E_SYSTEM                                A system error has occurred.
195         * @exception    E_DEVICE_BUSY                   The camera is under use by other application or already used in this application.
196         * @exception    E_DEVICE_UNAVAILABLE    The camera is unavailable.
197         * @exception    E_UNSUPPORTED_OPERATION The camera usage is not supported.
198         * @exception    E_OUT_OF_MEMORY The memory is insufficient.
199         */
200         result Construct(ICameraEventListener& listener, CameraSelection camSel = CAMERA_PRIMARY);
201
202         /**
203         * Powers the camera on.
204         *
205         * @since                2.0
206         * @privlevel        public
207         * @privilege    %http://tizen.org/privilege/camera
208         *
209         * @return               An error code
210         * @exception    E_SUCCESS                               The method is successful.
211         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
212         * @exception    E_DEVICE_BUSY                   The camera is under use by other application.
213         * @exception    E_DEVICE_UNAVAILABLE    The camera becomes unavailable.
214         * @exception    E_DEVICE_FAILED                 The device operation has failed.
215         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
216         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
217         * @remarks              The reserved configurations are set in this method.
218         * @see                  PowerOff()
219         */
220         result PowerOn(void);
221
222         /**
223         * Powers the camera off.
224         *
225         * @since                2.0
226         * @privlevel        public
227         * @privilege    %http://tizen.org/privilege/camera
228         *
229         * @return               An error code
230         * @exception    E_SUCCESS                               The method is successful.
231         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
232         * @exception    E_DEVICE_BUSY                   The camera is under use by other application.
233         * @exception    E_DEVICE_UNAVAILABLE    The camera becomes unavailable.
234         * @exception    E_DEVICE_FAILED                 The device operation has failed.
235         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
236         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
237         * @see                  PowerOn()
238         */
239         result PowerOff(void);
240
241         /**
242         * Checks whether the camera is powered on.
243         *
244         * @since                2.0
245         *
246         * @return               @c true if the camera is powered on, @n
247         *                               else @c false
248         * @see                  PowerOn()
249         * @see                  PowerOff()
250         */
251         bool IsPoweredOn(void) const;
252
253         /**
254         * Starts displaying the preview image on the camera device. @n
255         * If the value of @c pBufferInfo is @c null, no preview image is displayed. In this case, the application can
256         * draw the preview image with the data passed on by the ICameraEventListener::OnCameraPreviewed() method.
257         *
258         * If the value of @c previewedData is @c true, the previewed image data is passed to the
259         * ICameraEventListener::OnCameraPreviewed() method periodically based on the frame-rate, otherwise the
260         * callback is not invoked. The default value of @c previewedData is @c false.
261         *
262         * @since                2.0
263         * @privlevel        public
264         * @privilege    %http://tizen.org/privilege/camera
265         *
266         * @return               An error code
267         * @param[in]    pBufferInfo                             The buffer information for the camera preview display
268         * @param[in]    previewedData                   Set to @c true if the previewed data is delivered to the callback method, @n
269         *                                                                               else @c false
270         * @exception    E_SUCCESS                               The method is successful.
271         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
272         * @exception    E_UNSUPPORTED_FORMAT    The specified format is not supported.
273         * @exception    E_DEVICE_BUSY                   The camera is under use by other application.
274         * @exception    E_DEVICE_UNAVAILABLE    The camera becomes unavailable.
275         * @exception    E_DEVICE_FAILED                 The device operation has failed.
276         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
277         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
278         * @remarks              The overlay region retrieved by the buffer information must be the topmost window when this method is
279         *                               called.
280         * @remarks              The ICameraEventListener::OnCameraPreviewed() method can be delayed or dropped depending on
281         *                               the system's performance. @n
282         *                               For more information on the relationship between this method and the PowerOn() method, and the
283         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
284         ">here</a>.
285         * @see                  StopPreview()
286         * @see          ICameraEventListener::OnCameraPreviewed()
287         */
288         result StartPreview(const Tizen::Graphics::BufferInfo* pBufferInfo, bool previewedData = false);
289
290         /**
291         * Stops displaying the preview image on the camera device.
292         *
293         * @since                2.0
294         * @privlevel        public
295         * @privilege    %http://tizen.org/privilege/camera
296         *
297         * @return               An error code
298         * @exception    E_SUCCESS                               The method is successful.
299         * @exception    E_INVALID_STATE                 This instance is in an invalid state for this method.
300         * @exception    E_DEVICE_BUSY                   The camera is under use by other application.
301         * @exception    E_DEVICE_UNAVAILABLE    The camera becomes unavailable.
302         * @exception    E_DEVICE_FAILED                 The device operation has failed.
303         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
304         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
305         * @remarks      For more information on the relationship between this method and the PowerOn() method, and the
306         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
307         ">here</a>.
308         * @see                  StartPreview()
309         */
310         result StopPreview(void);
311
312         /**
313         * Captures the current image data from the camera sensor. @n
314         * After capturing the image, the camera's state changes to ::CAMERA_STATE_CAPTURED. @n
315         * The camera's preview must be restarted by calling the StartPreview() method. @n
316         * In a zero-shutter-lag camera, after capturing the image, the state changes to ::CAMERA_STATE_PREVIEW. @n
317         * The camera does not need to restart the preview in this case. @n
318         * The captured image is passed through ICameraEventListener::OnCameraCaptured().
319         *
320         * @since                2.0
321         * @privlevel        public
322         * @privilege    %http://tizen.org/privilege/camera
323         *
324         * @return               An error code
325         * @exception    E_SUCCESS                                       The method is successful.
326         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
327         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
328         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
329         * @exception    E_DEVICE_FAILED                         The device operation has failed.
330         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support capture feature.
331         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
332         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
333         * @remarks      For more information on the relationship between this method and the PowerOn() method, and the
334         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
335         ">here</a>.
336         * @remarks              In a zero-shutter-lag camera, the state changes to ::CAMERA_STATE_PREVIEW after capturing.
337         * @remarks              The zero-shutter-lag capability can be checked using MediaCapability::GetValue(const Tizen::Base::String& key, bool& value) with
338         *                               ::CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ::CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG keys.
339         * @see                  ICameraEventListener::OnCameraCaptured()
340         */
341         result Capture(void);
342
343         /**
344         * Gets the state of the camera in CameraState.
345         *
346         * @since                2.0
347         *
348         * @return           The current state of the camera
349         * @see          StopPreview()
350         * @see          SetAutoFocus()
351         * @see          Capture()
352         */
353         CameraState GetState(void) const;
354
355         /**
356         * Sets the brightness level of the camera input data.
357         *
358         * @since                2.0
359         * @privlevel        public
360         * @privilege    %http://tizen.org/privilege/camera
361         *
362         * @return               An error code
363         * @param[in]    brightness                                      The brightness level to set @n
364         *                                                                                       The range of this parameter is from @c 0 to @c 9.
365         * @exception    E_SUCCESS                                       The method is successful.
366         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
367         * @exception    E_OUT_OF_RANGE                          The specified @c brightness is out of range.
368         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
369         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
370         * @exception    E_DEVICE_FAILED                         The device operation has failed.
371         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support brightness configuration feature.
372         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
373         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
374         * @remarks              The default brightness level is @c 5. @n
375         *                               The device's supported range for the brightness level is from @c 0 to @c 9. @n
376         *                               This method works correctly when PowerOn() is executed. @n@n
377         *                               For more information on the relationship between this method and the PowerOn() method, and the
378         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
379         ">here</a>.
380         * @see                  GetBrightness()
381         */
382         result SetBrightness(int brightness);
383
384         /**
385         * Gets the brightness level of the camera input data.
386         *
387         * @since                2.0
388         *
389         * @return               The current brightness level @n
390         *                               The returned value ranges from @c 0 to @c 9.
391         * @remarks              The device's supported range for the brightness level is from @c 0 to @c 9.
392         * @see                  SetBrightness()
393         */
394         int GetBrightness(void) const;
395
396         /**
397         * Sets the contrast level of the %Camera input data.
398         *
399         * @since                2.0
400         * @privlevel        public
401         * @privilege    %http://tizen.org/privilege/camera
402         *
403         * @return           An error code
404         * @param[in]    contrast                                        The contrast level to set @n
405         *                                                                                       The range of this parameter is from @c 0 to @c 9.
406         * @exception    E_SUCCESS                                       The method is successful.
407         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
408         * @exception    E_OUT_OF_RANGE                          The specified contrast is out of range.
409         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
410         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
411         * @exception    E_DEVICE_FAILED                         The device operation has failed.
412         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support contrast configuration feature.
413         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
414         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
415         * @remarks              The default contrast level is @c 5. @n
416         *                               The device's supported range for the contrast level is from @c 0 to @c 9. @n
417         *                               This method works correctly when PowerOn() is executed. @n@n
418         *                               For more information on the relationship between this method and the PowerOn() method, and the
419         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
420         ">here</a>.
421         * @see                  GetContrast()
422         */
423         result SetContrast(int contrast);
424
425         /**
426         * Gets the contrast level of the camera input data.
427         *
428         * @since                2.0
429         *
430         * @return               The current contrast level @n
431         *                               The returned value ranges from @c 0 to @c 9.
432         * @remarks              The device's supported range for the contrast level is from @c 0 to @c 9.
433         * @see                  SetContrast()
434         */
435         int GetContrast(void) const;
436
437         /**
438         * Zooms in the camera.
439         *
440         * @since                2.0
441         * @privlevel        public
442         * @privilege    %http://tizen.org/privilege/camera
443         *
444         * @return               An error code
445         * @exception    E_SUCCESS                                       The method is successful.
446         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
447         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
448         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
449         * @exception    E_DEVICE_FAILED                         The device operation has failed.
450         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support zooming feature.
451         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
452         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
453         * @remarks              This method returns E_UNSUPPORTED_OPERATION in the Emulator.
454         *                               If Camera supports only ::CAMERA_ZOOM_TYPE_SMART, the zoom ratio can differ according
455         *                               to the preview, capture, and recording resolutions.
456         *                               The supported zoom types can be obtained by using the
457         *                               MediaCapability::GetValueN(CAMERA_PRIMARY_ZOOM_TYPE) method. @n@n
458         *               For more information on the relationship between this method and the PowerOn() method, and the
459         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
460         ">here</a>.
461         * @see                  ZoomOut()
462         * @see          GetZoomLevel()
463         * @see          GetMaxZoomLevel()
464         */
465         result ZoomIn(void);
466
467         /**
468         * Zooms out the camera.
469         *
470         * @since                2.0
471         * @privlevel        public
472         * @privilege    %http://tizen.org/privilege/camera
473         *
474         * @return               An error code
475         * @exception    E_SUCCESS                                       The method is successful.
476         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
477         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
478         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
479         * @exception    E_DEVICE_FAILED                         The device operation has failed.
480         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support zooming feature.
481         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
482         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
483         * @remarks              This method returns E_UNSUPPORTED_OPERATION in the Emulator.
484         *                               If CameraZoomType supports only ::CAMERA_ZOOM_TYPE_SMART, zoom ratio can differ according to
485         *                               the preview, capture, and recording resolutions.
486         *                               The supported zoom types can be obtained by using the
487         *                               MediaCapability::GetValueN(CAMERA_PRIMARY_ZOOM_TYPE) method. @n@n
488         *               For more information on the relationship between this method and the PowerOn() method, and the
489         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
490         ">here</a>.
491         * @see                  ZoomIn()
492         * @see          GetZoomLevel()
493         * @see          GetMaxZoomLevel()
494         */
495         result ZoomOut(void);
496
497         /**
498         * Gets the zoom level of the camera.
499         *
500         * @since                2.0
501         *
502         * @return               The current zoom level
503         * @remarks              The zoom level is different for each camera device.
504         * @see                  ZoomIn()
505         * @see              ZoomOut()
506         * @see          GetMaxZoomLevel()
507         */
508         int GetZoomLevel(void) const;
509
510         /**
511         * Gets the maximum zoom level supported by this %Camera.
512         *
513         * @since                2.0
514         *
515         * @return               The maximum zoom level
516         * @remarks              The zoom level is different for each camera device.
517         * @see                  ZoomIn()
518         * @see          ZoomOut()
519         * @see          GetZoomLevel()
520         */
521         int GetMaxZoomLevel(void) const;
522
523         /**
524         * Sets the current resolution of the preview.
525         *
526         * @since                2.0
527         * @privlevel        public
528         * @privilege    %http://tizen.org/privilege/camera
529         *
530         * @return               An error code
531         * @param[in]    resolution                  The preview resolution @n
532         *                                                                       It must be one of the listed dimensions that are extracted using GetSupportedPreviewResolutionListN().
533         * @exception    E_SUCCESS                                       The method is successful.
534         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
535         * @exception    E_OUT_OF_RANGE                          The position or size is out of range.
536         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
537         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
538         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
539         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support preview resolution configuration feature.
540         * @exception    E_DEVICE_FAILED                         The device operation has failed.
541         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
542         * @remarks              This method works in the ::CAMERA_STATE_INITIALIZED state. @n@n
543         *                               For more information on the relationship between this method and the PowerOn() method, and the
544         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
545         ">here</a>.
546         * @see                  GetPreviewResolution()
547         */
548         result SetPreviewResolution(const Tizen::Graphics::Dimension& resolution);
549
550         /**
551         * Gets the current resolution of the preview.
552         *
553         * @since                2.0
554         *
555         * @return               The current preview resolution
556         * @see                  SetPreviewResolution()
557         */
558         Tizen::Graphics::Dimension GetPreviewResolution(void) const;
559
560         /**
561         * Gets the supported preview resolution list of the %Camera class. @n
562         * Each item in the returned list contains a pointer of Tizen::Graphics::Dimension value.
563         *
564         * @since                2.0
565         *
566         * @return       A list of dimensions that represent the preview resolutions supported by the %Camera class, @n
567         *                               else @c null if no preview resolution is supported or an exception occurs
568         * @exception    E_SUCCESS                               The method is successful.
569         * @exception    E_SYSTEM                                A system error has occurred.
570         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
571         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
572         *                               The return value and each item in the list must be deleted by the caller.
573         * @see                  SetPreviewResolution()
574         * @see          GetPreviewResolution()
575         */
576         Tizen::Base::Collection::IList* GetSupportedPreviewResolutionListN(void) const;
577
578
579         /**
580         * Sets the capturing resolution of the camera. @n
581         * Initially, the default resolution is set using the internal configuration.
582         *
583         * @since                2.0
584         * @privlevel        public
585         * @privilege    %http://tizen.org/privilege/camera
586         *
587         * @return               An error code
588         * @param[in]    resolution                                      The display resolution @n
589         *                                                                       The display resolution must be one of the values extracted using GetSupportedCaptureResolutionListN().
590         * @exception    E_SUCCESS                                       The method is successful.
591         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
592         * @exception    E_SYSTEM                                        A system error has occurred.
593         * @exception    E_OUT_OF_RANGE                          The specified resolution is out of range.
594         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
595         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
596         * @exception    E_DEVICE_FAILED                         The device operation has failed.
597         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support capture resolution configuration feature.
598         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
599         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
600         * @remarks                      For more information on the relationship between this method and the PowerOn() method, and the
601         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
602         ">here</a>.
603         * @remarks              In a zero-shutter-lag camera, the default preview format applies this feature correctly. The other preview formats are not guaranteed.
604         * @remarks              The zero-shutter-lag capability can be checked using MediaCapability::GetValue(const Tizen::Base::String& key, bool& value) with
605         *                               ::CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ::CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG keys.
606         * @see                  GetCaptureResolution()
607         */
608         result SetCaptureResolution(const Tizen::Graphics::Dimension& resolution);
609
610         /**
611         * Gets the resolution for capturing the data of the camera.
612         *
613         * @since                2.0
614         *
615         * @return               The current resolution for capturing the data of the camera
616         * @see                  SetCaptureResolution()
617         * @see          GetSupportedCaptureResolutionListN()
618         */
619         Tizen::Graphics::Dimension GetCaptureResolution(void) const;
620
621         /**
622         * Gets a list of the capturing resolutions supported by the %Camera class. @n
623         * Each item of the list has a pointer of the Tizen::Graphics::Dimension value.
624         *
625         * @since                2.0
626         *
627         * @return               A list of the capture resolutions supported by the %Camera class @n
628         *                               else @c null if no capture resolution is supported or an exception occurs
629         * @exception    E_SUCCESS                               The method is successful.
630         * @exception    E_SYSTEM                                A system error has occurred.
631         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
632         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
633         *                               The return value and each item in the list must be deleted by the caller.
634         * @see                  SetCaptureResolution()
635         * @see          GetCaptureResolution()
636         */
637         Tizen::Base::Collection::IList* GetSupportedCaptureResolutionListN(void) const;
638
639         /**
640         * Sets the effect for the input data of the camera.
641         *
642         * @since                2.0
643         * @privlevel        public
644         * @privilege    %http://tizen.org/privilege/camera
645         *
646         * @return               An error code
647         * @param[in]    effect                                          The effect for the input data of the camera
648         * @exception    E_SUCCESS                                       The method is successful.
649         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
650         * @exception    E_INVALID_ARG                           The specified input parameter is invalid.
651         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
652         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
653         * @exception    E_DEVICE_FAILED                         The device operation has failed.
654         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support effect configuration feature.
655         * @exception    E_UNSUPPORTED_TYPE          The specified @c effect is not supported.
656         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
657         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
658         * @remarks              The default effect is ::CAMERA_EFFECT_NONE.
659         *                               This method returns E_UNSUPPORTED_OPERATION in the Emulator.
660         *                               This method works correctly when PowerOn() is executed. @n@n
661         *                               For more information on the relationship between this method and the PowerOn() method, and the
662         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
663         ">here</a>.
664         * @see                  GetEffect()
665         */
666         result SetEffect(CameraEffect effect);
667
668         /**
669         * Gets the effect for the input data of the camera.
670         *
671         * @since                2.0
672         *
673         * @return               The effect for the input data of the camera
674         * @see                  SetEffect()
675         */
676         CameraEffect GetEffect(void) const;
677
678         /**
679         * @if OSPDEPREC
680         * Sets the camera's flash.
681         *
682         * @brief <i> [Deprecated]  </i>
683         * @deprecated   This method is deprecated. @n
684         * Instead of using this method, use the SetFlashMode() method.
685         * @since                2.0
686         * @privlevel        public
687         * @privilege    %http://tizen.org/privilege/camera
688         *
689         * @return               An error code
690         * @param[in]    flashOn                                         Set to @c true to switch on the flash light, @n
691         *                                                                                       else @c false
692         * @exception    E_SUCCESS                                       The method is successful.
693         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
694         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
695         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
696         * @exception    E_DEVICE_FAILED                         The device operation has failed.
697         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
698         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support flash configuration feature.
699         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
700         * @remarks              The flash is switched on when the camera captures a picture. If the value of @c flashOn is
701         *                               set to @c true, this method returns E_UNSUPPORTED_OPERATION in the Emulator. @n
702         *                               SetFlash(true) works same as SetFlashMode(CAMERA_FLASH_MODE_ON) and SetFlash(false) works same as SetFlashMode(CAMERA_FLASH_MODE_OFF). @n
703         *                               For more information on the relationship between this method and the PowerOn() method, and the
704         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
705         ">here</a>.
706         * @remarks              In a zero-shutter-lag camera, only the default preview format applies this feature.
707         * @see                  IsFlashOn()
708         * @see          SetFlashMode()
709         * @see          CameraFlashMode
710         *
711         */
712         result SetFlash(bool flashOn)
713         {
714                 CameraFlashMode flashMode = CAMERA_FLASH_MODE_ON;
715                 if (!flashOn)
716                 {
717                         flashMode = CAMERA_FLASH_MODE_OFF;
718                 }
719                 return SetFlashMode(flashMode);
720         }
721
722         /**
723         * @if OSPDEPREC
724         * Checks whether the camera's flash is switched on.
725         *
726         * @brief <i> [Deprecated]  </i>
727         * @deprecated   This method is deprecated. @n
728         * Instead of using this method, use the GetFlashMode() method.
729         * @since                2.0
730         *
731         * @return               @c true if the flash light is on, @n
732         *                               else @c false
733         * @remarks              This method works same as return (GetFlashMode()!=CAMERA_FLASH_MODE_OFF).
734         * @see                  SetFlash()
735         * @see          GetFlashMode()
736         * @see          CameraFlashMode
737         * @endif
738         */
739         bool IsFlashOn(void) const
740         {
741                 return (GetFlashMode() != CAMERA_FLASH_MODE_OFF);
742         }
743
744         /**
745         * Sets the camera's flash mode.
746         *
747         * @since                2.0
748         * @privlevel        public
749         * @privilege    %http://tizen.org/privilege/camera
750         *
751         * @return               An error code
752         * @param[in]    flashMode                                       flash mode to switch on the flash light.
753         * @exception    E_SUCCESS                                       The method is successful.
754         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
755         * @exception    E_INVALID_ARG                           The specified flash mode is invalid.
756         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
757         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
758         * @exception    E_DEVICE_FAILED                         The device operation has failed.
759         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
760         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support flash configuration feature.
761         * @exception    E_UNSUPPORTED_TYPE          The specified @c flashMode is not supported.
762         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
763         * @remarks              Normally the flash splashes before the camera captures a picture. @n
764         *                               ::CAMERA_FLASH_MODE_CONTINUOUS keeps the flash turned on after the method is called until ::CAMERA_FLASH_MODE_OFF is set. @n
765         *                               This method returns E_UNSUPPORTED_OPERATION in the Emulator.
766         * @remarks              In a zero-shutter-lag camera, the default preview format applies this feature correctly. The other preview formats are not guaranteed.
767         * @remarks              The zero-shutter-lag capability can be checked using MediaCapability::GetValue(const Tizen::Base::String& key, bool& value) with
768         *                               ::CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ::CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG keys.
769         * @see                  GetFlashMode()
770         */
771         result SetFlashMode(CameraFlashMode flashMode);
772
773         /**
774         * Gets the flash mode of the camera.
775         *
776         * @since                2.0
777         *
778         * @return               The flash mode of the camera
779         * @remarks              If the %Camera doesn't support the flash mode, this method always returns ::CAMERA_FLASH_MODE_OFF.
780         * @see                  SetFlashMode()
781         */
782         CameraFlashMode GetFlashMode(void) const;
783
784         /**
785         * Sets the exposure level of the camera.
786         *
787         * @since                2.0
788         * @privlevel        public
789         * @privilege    %http://tizen.org/privilege/camera
790         *
791         * @return               An error code
792         * @param[in]    exposure                                        The camera exposure level @n
793         *                                                                                       The range of this parameter is from @c 0 to @c 9.
794         * @exception    E_SUCCESS                                       The method is successful.
795         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
796         * @exception    E_OUT_OF_RANGE                          The specified exposure level is out of range.
797         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
798         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
799         * @exception    E_DEVICE_FAILED                         The device operation has failed.
800         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support exposure configuration feature.
801         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
802         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
803         * @remarks              The default exposure level is @c 5.
804         *                               The supported range for exposure level is from @c 0 to @c 9.
805         *                               This method returns E_UNSUPPORTED_OPERATION in the Emulator.
806         *                               This method works correctly when PowerOn() is executed. @n@n
807         *                               For more information on the relationship between this method and the PowerOn() method, and the
808         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
809         ">here</a>.
810         * @see                  GetExposure()
811         */
812         result SetExposure(int exposure);
813
814         /**
815         * Gets the exposure level of the camera.
816         *
817         * @since                2.0
818         *
819         * @return               An integer value representing the exposure level of the camera @n
820         *                               The returned value ranges from @c 0 to @c 9.
821         * @remarks              The supported range for exposure level is from @c 0 to @c 9.
822         * @see                  SetExposure()
823         */
824         int GetExposure(void) const;
825
826         /**
827         * Sets the white balance level of the camera.
828         *
829         * @since                2.0
830         * @privlevel        public
831         * @privilege    %http://tizen.org/privilege/camera
832         *
833         * @return               An error code
834         * @param[in]    whiteBalance                            The camera white balance level
835         * @exception    E_SUCCESS                                       The method is successful.
836         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
837         * @exception    E_INVALID_ARG                           The specified input parameter is invalid.
838         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
839         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
840         * @exception    E_DEVICE_FAILED                         The device operation has failed.
841         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support white balance configuration feature.
842         * @exception    E_UNSUPPORTED_TYPE          The specified @c whiteBalance is not supported.
843         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
844         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
845         * @remarks              The default white balance is ::CAMERA_WHITE_BALANCE_AUTO.
846         *                               This method returns E_UNSUPPORTED_OPERATION in the Emulator.
847         *                               This method works correctly when PowerOn() is executed. @n@n
848         *                               For more information on the relationship between this method and the PowerOn() method, and the
849         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
850         ">here</a>.
851         * @see                  GetWhiteBalance()
852         */
853         result SetWhiteBalance(CameraWhiteBalance whiteBalance);
854
855         /**
856         * Gets the white balance level of the camera.
857         *
858         * @since                2.0
859         *
860         * @return               The white balance level of the camera
861         * @see                  SetWhiteBalance()
862         */
863         CameraWhiteBalance GetWhiteBalance(void) const;
864
865         /**
866         * Sets the capturing quality of the camera.
867         *
868         * @since                2.0
869         * @privlevel        public
870         * @privilege    %http://tizen.org/privilege/camera
871         *
872         * @return               An error code
873         * @param[in]    quality                                         The camera's quality level
874         * @exception    E_SUCCESS                                       The method is successful.
875         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
876         * @exception    E_INVALID_ARG                           The specified @c quality is not supported.
877         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
878         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
879         * @exception    E_DEVICE_FAILED                         The device operation has failed.
880         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support capturing quality configuration feature.
881         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
882         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
883         * @remarks              The default quality is ::CAMERA_QUALITY_NORMAL.
884         *                               This method works correctly when PowerOn() is executed. @n@n
885         *                               For more information on the relationship between this method and the PowerOn() method, and the
886         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
887         ">here</a>.
888         * @see                  GetQuality()
889         */
890         result SetQuality(CameraQuality quality);
891
892         /**
893         * Gets the capturing quality of the camera.
894         *
895         * @since                2.0
896         *
897         * @return               The %Camera quality level
898         * @see                  SetQuality()
899         */
900         CameraQuality GetQuality(void) const;
901
902         /**
903         * Sets the focus mode of the camera.
904         *
905         * @since                2.0
906         * @privlevel        public
907         * @privilege    %http://tizen.org/privilege/camera
908         *
909         * @return               An error code
910         * @param[in]    focusMode                               focus mode
911         * @exception    E_SUCCESS                                       The method is successful.
912         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
913         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
914         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
915         * @exception    E_DEVICE_FAILED                         The device operation has failed.
916         * @exception    E_INVALID_ARG                           The specified focus mode is invalid.
917         * @exception    E_UNSUPPORTED_OPERATION  The target device does not support focus mode configuration feature.
918         * @exception    E_UNSUPPORTED_TYPE                The specified @c focusMode is not supported.
919         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
920         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
921         * @remarks      ::CAMERA_FOCUS_MODE_NONE always throws E_INVALID_ARG.
922         * @see          GetFocusMode()
923         */
924         result SetFocusMode(CameraFocusMode focusMode);
925
926         /**
927         * Gets the focus mode of the camera.
928         *
929         * @since                2.0
930         *
931         * @return               The %Camera focus mode
932         * @remarks      If the %Camera does not support the focus mode, this method always returns ::CAMERA_FOCUS_MODE_NONE.
933         * @see          SetFocusMode()
934         */
935         CameraFocusMode GetFocusMode(void) const;
936
937         /**
938         * Sets the auto focus point list.
939         *
940         * @since                2.0
941         * @privlevel        public
942         * @privilege    %http://tizen.org/privilege/camera
943         *
944         * @return               An error code
945         * @param[in]    pointList                               The auto focus point list which consists of Tizen::Graphics::Point pointers
946         * @exception    E_SUCCESS                                       The method is successful.
947         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
948         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
949         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
950         * @exception    E_DEVICE_FAILED                         The device operation has failed.
951         * @exception    E_INVALID_ARG                           The specified input parameter is invalid.
952         * @exception    E_UNSUPPORTED_OPERATION  The target device does not support focus pointing feature.
953         * @exception    E_UNSUPPORTED_TYPE                      This method is not supported for the current focus mode.
954         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
955         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
956         * @remarks      This method works fine when the current focus mode is @c CAMERA_FOCUS_MODE_NORMAL or @c CAMERA_FOCUS_MODE_MACRO.@n
957         *                       If the input parameter has a empty list, the focus area is changed to the center.
958         * @see          GetAutoFocusPointN()
959         */
960         result SetAutoFocusPoint(const Tizen::Base::Collection::IList& pointList);
961
962         /**
963         * Gets the auto focus point list. @n
964         * Each item of the list has a pointer of the Tizen::Graphics::Point value.
965         *
966         * @since                2.0
967         *
968         * @return               The %Camera auto focus point list @n
969         *               A list of points that represent the auto focus point, @n
970         *                               else @c null if no auto focus point is set or if an exception occurs.
971         * @exception    E_SUCCESS                                       The method is successful.
972         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
973         * @remarks      The specific error code can be accessed using the GetLastResult() method. @n
974         *                       The return value and each item in the list must be deleted by the caller.
975         * @see          SetAutoFocusPoint()
976         */
977         Tizen::Base::Collection::IList* GetAutoFocusPointN(void) const;
978
979         /**
980         * Sets the auto focus mode of the camera.
981         *
982         * @since                2.0
983         * @privlevel        public
984         * @privilege    %http://tizen.org/privilege/camera
985         *
986         * @return               An error code
987         * @param[in]    callback                                        Set to @c true to enable auto focus callback, @n
988         *                                                                                       else @c false
989         * @exception    E_SUCCESS                                       The method is successful.
990         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
991         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
992         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
993         * @exception    E_DEVICE_FAILED                         The device operation has failed.
994         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support auto focus feature.
995         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
996         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
997         * @remarks              If @c callback is set to @c false, the ICameraEventListener::OnCameraAutoFocused() method is not called.
998         *                               This method throws @c E_UNSUPPORTED_OPERATION in the emulator. @n
999         *               For more information on the relationship between this method and the PowerOn() method, and the
1000         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
1001         ">here</a>.
1002         */
1003         result SetAutoFocus(bool callback);
1004
1005         /**
1006         * Sets the capturing format of the camera. @n
1007         * Initially, the default format is set using the internal configuration.
1008         *
1009         * @since                2.0
1010         * @privlevel        public
1011         * @privilege    %http://tizen.org/privilege/camera
1012         *
1013         * @return               An error code
1014         * @param[in]    format                                          The camera's capture format @n
1015         *                                                                                       It must be one of the pixel formats extracted using GetSupportedCaptureFormatListN().
1016         * @exception    E_SUCCESS                                       The method is successful.
1017         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1018         * @exception    E_SYSTEM                                        A system error has occurred.
1019         * @exception    E_UNSUPPORTED_FORMAT            The specified format is not supported.
1020         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
1021         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
1022         * @exception    E_DEVICE_FAILED                         The device operation has failed.
1023         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support capture format configuration feature.
1024         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
1025         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1026         * @remarks              This method works correctly when PowerOn() is executed.
1027         * @see                  GetCaptureFormat()
1028         */
1029         result SetCaptureFormat(const Tizen::Graphics::PixelFormat format);
1030
1031         /**
1032         * Gets the capturing format of the camera.
1033         *
1034         * @since                2.0
1035         *
1036         * @return               The capturing format of the camera
1037         * @see                  SetCaptureFormat()
1038         * @see          GetSupportedCaptureFormatListN()
1039         */
1040         Tizen::Graphics::PixelFormat GetCaptureFormat(void) const;
1041
1042         /**
1043         * Gets the supported capturing format list for the %Camera class. @n
1044         * Each list item has a Tizen::Graphics::PixelFormat value.
1045         *
1046         * @since                2.0
1047         *
1048         * @return               A list of the formats supported by the %Camera class, @n
1049         *                               else @c null if no capture format is supported or an exception occurs
1050         * @exception    E_SUCCESS                               The method is successful.
1051         * @exception    E_SYSTEM                                A system error has occurred.
1052         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
1053         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
1054         *                               The return value must be deleted.
1055         * @see                  SetCaptureFormat()
1056         * @see          GetCaptureFormat()
1057         */
1058         Tizen::Base::Collection::IListT <Tizen::Graphics::PixelFormat>* GetSupportedCaptureFormatListN(void) const;
1059
1060         /**
1061         * Sets the preview format of the camera. @n
1062         * Initially, the default format is set using the internal configuration.
1063         *
1064         * @since                2.0
1065         * @privlevel        public
1066         * @privilege    %http://tizen.org/privilege/camera
1067         *
1068         * @return               An error code
1069         * @param[in]    format                                          The camera's preview format @n
1070         *                                                                                       It must be one of the pixel formats extracted using GetSupportedPreviewFormatListN().
1071         * @exception    E_SUCCESS                                       The method is successful.
1072         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1073         * @exception    E_SYSTEM                                        A system error has occurred.
1074         * @exception    E_UNSUPPORTED_FORMAT            The specified format is not supported.
1075         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
1076         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
1077         * @exception    E_DEVICE_FAILED                         The device operation has failed.
1078         * @exception    E_UNSUPPORTED_OPERATION     The target device does not support preview format configuration feature.
1079         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
1080         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1081         * @remarks              This method works in ::CAMERA_STATE_INITIALIZED state. @n@n
1082         *                               For more information on the relationship between this method and the PowerOn() method, and the
1083         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
1084         ">here</a>.
1085         * @see                  GetPreviewFormat()
1086         * @see          GetSupportedPreviewFormatListN()
1087         */
1088         result SetPreviewFormat(const Tizen::Graphics::PixelFormat format);
1089
1090         /**
1091         * Gets the preview format of the camera.
1092         *
1093         * @since                2.0
1094         *
1095         * @return               The preview format of the camera
1096         * @see                  SetPreviewFormat()
1097         * @see          GetSupportedPreviewFormatListN()
1098         */
1099         Tizen::Graphics::PixelFormat GetPreviewFormat(void) const;
1100
1101         /**
1102         * Gets the supported preview format list for the %Camera class. @n
1103         * Each list item has a Tizen::Graphics::PixelFormat value.
1104         *
1105         * @since                2.0
1106         *
1107         * @return               A list of the preview format supported by the %Camera class, @n
1108         *                               else @c null if no preview format is supported or an exception occurs
1109         * @exception    E_SUCCESS                               The method is successful.
1110         * @exception    E_SYSTEM                                A system error has occurred.
1111         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
1112         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
1113         *                               The return value must be deleted.
1114         * @see                  SetPreviewFormat()
1115         * @see          GetPreviewFormat()
1116         */
1117         Tizen::Base::Collection::IListT <Tizen::Graphics::PixelFormat>* GetSupportedPreviewFormatListN(void) const;
1118
1119
1120         /**
1121         * Sets the ISO level of the camera.
1122         *
1123         * @since                2.0
1124         * @privlevel        public
1125         * @privilege    %http://tizen.org/privilege/camera
1126         *
1127         * @return               An error code
1128         * @param[in]    isoLevel                                        The camera's ISO level @n
1129         *                                                                                       The default ISO level is set from the internal configuration.
1130         * @exception    E_SUCCESS                                       The method is successful.
1131         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1132         * @exception    E_OUT_OF_RANGE                          The specified ISO level is out of range.
1133         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
1134         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
1135         * @exception    E_DEVICE_FAILED                         The device operation has failed.
1136         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support iso level configuration feature.
1137         * @exception    E_UNSUPPORTED_TYPE          The specified @c isoLevel is not supported.
1138         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
1139         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1140         * @remarks              In some devices this method works in the ::CAMERA_STATE_PREVIEW state.
1141         *                               This method throws E_UNSUPPORTED_OPERATION in the Emulator. @n@n
1142         *                               For more information on the relationship between this method and the PowerOn() method, and the
1143         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
1144         ">here</a>.
1145         * @see                  GetIsoLevel()
1146         */
1147         result SetIsoLevel(CameraIsoLevel isoLevel);
1148
1149         /**
1150         * Gets the ISO level of the camera.
1151         *
1152         * @since                2.0
1153         *
1154         * @return               The ISO level of the camera
1155         * @see                  SetIsoLevel()
1156         */
1157         CameraIsoLevel GetIsoLevel(void) const;
1158
1159         /**
1160         * Sets the preview frame rate of the camera. @n
1161         * Initially, the default frame rate is set using the internal configuration.
1162         *
1163         * @since                2.0
1164         * @privlevel        public
1165         * @privilege    %http://tizen.org/privilege/camera
1166         *
1167         * @return               An error code
1168         * @param[in]    fps                                                     The frame rate per second
1169         * @exception    E_SUCCESS                                       The method is successful.
1170         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1171         * @exception    E_OUT_OF_RANGE                          The specified @c fps is out of range on this device.
1172         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
1173         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
1174         * @exception    E_DEVICE_FAILED                         The device operation has failed.
1175         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support preview frame rate configuration feature.
1176         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
1177         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1178         * @remarks              This method works in ::CAMERA_STATE_INITIALIZED state. @n@n
1179         *                               For more information on the relationship between this method and the PowerOn() method, and the
1180         *               state transition caused by this method, see <a href="../org.tizen.native.appprogramming/html/guide/media/launching_camera.htm
1181         ">here</a>.
1182         * @see                  GetPreviewFrameRate()
1183         * @see          GetSupportedPreviewFrameRateListN()
1184         * @see          FRAME_RATE_AUTO
1185         */
1186         result SetPreviewFrameRate(int fps);
1187
1188         /**
1189         * Gets the frame rate of the camera.
1190         *
1191         * @since                2.0
1192         *
1193         * @return               The frame rate of the camera @n
1194         *               If the frame rate is not set using SetPreviewFrameRate(), the system-dependent default frame rate is returned.
1195         * @see                  GetSupportedPreviewFrameRateListN()
1196         */
1197         int GetPreviewFrameRate(void) const;
1198
1199         /**
1200         * Gets the supported preview frame rate list for the %Camera class. @n
1201         * Each list item has an integer value.
1202         *
1203         * @since                2.0
1204         *
1205         * @return               A list of the preview frame rate supported by the %Camera class, @n
1206         *                               else @c null if no frame rate is supported or an exception occurs
1207         * @exception    E_SUCCESS                               The method is successful.
1208         * @exception    E_SYSTEM                                A system error has occurred.
1209         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
1210         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
1211         *                               The return value must be deleted by the caller. @n
1212         *                               This method returns fps list that can be supported by all resolutions.
1213         * @see                  SetPreviewFrameRate()
1214         * @see          GetPreviewFrameRate()
1215         * @see          FRAME_RATE_AUTO
1216         * @see                  GetSupportedPreviewFrameRateListN(const Tizen::Graphics::Dimension& dim) const
1217         */
1218         Tizen::Base::Collection::IListT <int>* GetSupportedPreviewFrameRateListN(void) const;
1219
1220         /**
1221         * Gets the supported preview frame rate list of the input resolution of the %Camera class. @n
1222         * Each item of the list has an integer value.
1223         *
1224         * @since                2.0
1225         *
1226         * @return               A list of the preview frame rate of the input preview resolution, @n
1227         *                               else @c null if no frame rate is supported or if an exception occurs
1228         * @param[in]    dim                                             The preview resolution of the camera
1229         * @exception    E_SUCCESS                               The method is successful.
1230         * @exception    E_INVALID_ARG                   The specified input resolution is invalid.
1231         * @exception    E_SYSTEM                                A system error has occurred.
1232         * @exception    E_OUT_OF_MEMORY                 The memory is insufficient.
1233         * @remarks              The specific error code can be accessed using the GetLastResult() method. @n
1234         *                               The return value must be deleted by the caller. @n
1235         * @see                  SetPreviewFrameRate()
1236         * @see          GetPreviewFrameRate()
1237         * @see                  GetSupportedPreviewFrameRateListN(void) const
1238         */
1239         Tizen::Base::Collection::IListT <int>* GetSupportedPreviewFrameRateListN(const Tizen::Graphics::Dimension& dim) const;
1240
1241         /**
1242         * Sets the orientation value in the Exchangeable Image File Format (EXIF) field of the captured data.
1243         *
1244         * @since                2.0
1245         * @privlevel        public
1246         * @privilege    %http://tizen.org/privilege/camera
1247         *
1248         * @return               An error code
1249         * @param[in]    orientation                                     The orientation value to set in EXIF
1250         * @exception    E_SUCCESS                                       The method is successful.
1251         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1252         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1253         * @exception    E_OUT_OF_RANGE                          The input value is out of range.
1254         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support exif orientation configuration feature.
1255         * @exception    E_SYSTEM                                        A system error has occurred.
1256         * @remarks              The default value of orientation is @c CAMERA_EXIF_ORIENTATION_TOP_LEFT. @n
1257         *                               This method works correctly when PowerOn() is executed. The orientation value set by this method can be obtained using the
1258         *                               Tizen::Content::ImageData::GetOrientation() method after writing the captured data to a file.
1259         */
1260         result SetExifOrientation(CameraExifOrientation orientation);
1261
1262         /**
1263         * Sets the GPS coordinates in the Exchangeable %Image File Format (EXIF) field for the captured data.
1264         *
1265         * @since                2.0
1266         * @privlevel        public
1267         * @privilege    %http://tizen.org/privilege/camera
1268         *
1269         * @return               An error code
1270         * @param[in]    latitude                                        The latitude value to set in EXIF @n
1271         *                                                                                       The valid range is [-90.0, 90.0].
1272         * @param[in]    longitude                                       The longitude value to set in EXIF @n
1273         *                                                                                       The valid range is [-180.0, 180.0]
1274         * @param[in]    altitude                                        The altitude value to set in EXIF
1275         * @exception    E_SUCCESS                                       The method is successful.
1276         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1277         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1278         * @exception    E_OUT_OF_RANGE                          The input value is out of range.
1279         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support exif gps coordinates configuration feature.
1280         * @exception    E_SYSTEM                                        A system error has occurred.
1281         * @remarks              This method sets the GPS coordinates and enables entering the coordinates into the Exchangeable Image File Format (EXIF).
1282         * @remarks              By default, the GPS coordinates are not entered in JPEG's EXIF.
1283         * @remarks              The GPS coordinates that are set using this method are entered in every call to the
1284         *                               Capture() method, until DisableExifGpsCoordinates() is called or this instance is destroyed. @n
1285         *                               This method works correctly when PowerOn() is executed. @n
1286         *                               The values set by this method can result in an error as compared to the values stored in the Exchangeable Image File Format (EXIF) field.
1287         */
1288         result SetExifGpsCoordinates(double latitude, double longitude, float altitude);
1289
1290         /**
1291         * Disables the insertion of the GPS coordinates in the Exchangeable %Image File Format (EXIF) field for the captured data.
1292         *
1293         * @since                2.0
1294         * @privlevel        public
1295         * @privilege    %http://tizen.org/privilege/camera
1296         *
1297         * @return               An error code
1298         * @exception    E_SUCCESS                                       The method is successful.
1299         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1300         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1301         * @exception    E_OUT_OF_RANGE                          The input value is out of range.
1302         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support exif gps coordinates configuration feature.
1303         * @exception    E_SYSTEM                                        A system error has occurred.
1304         * @see          SetExifGpsCoordinates()
1305         */
1306         result DisableExifGpsCoordinates(void);
1307
1308         /**
1309         * Sets the flip type for the previewed and captured data.
1310         *
1311         * @since                2.0
1312         * @privlevel        public
1313         * @privilege    %http://tizen.org/privilege/camera
1314         *
1315         * @return               An error code
1316         * @param[in]    flip                                            The camera flip type
1317         * @exception    E_SUCCESS                                       The method is successful.
1318         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1319         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1320         * @exception    E_INVALID_ARG                           The input value is out of range.
1321         * @exception    E_UNSUPPORTED_OPERATION         The target device does not support flip configuration feature.
1322         * @exception    E_UNSUPPORTED_TYPE          The specified @c flip is not supported.
1323         * @exception    E_SYSTEM                                        A system error has occurred.
1324         * @remarks              This method works in the ::CAMERA_STATE_INITIALIZED state.
1325         * @remarks              Finally the last specified type is applied even with the several types applicable.
1326         * @remarks              In a zero-shutter-lag camera, the default preview format is not guaranteed to apply this feature correctly.
1327         * @remarks              The zero-shutter-lag capability can be checked using MediaCapability::GetValue(const Tizen::Base::String& key, bool& value) with
1328         *                               ::CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ::CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG keys.
1329         * @see          GetFlip()
1330         */
1331         result SetFlip(CameraFlipType flip);
1332
1333         /**
1334         * Gets the flip type for the previewed and captured data.
1335         *
1336         * @since                2.0
1337         *
1338         * @return               The camera flip type
1339         * @see      SetFlip()
1340         */
1341         CameraFlipType GetFlip(void) const;
1342
1343         /**
1344         * Sets the rotation for the previewed data.
1345         *
1346         * @since                2.0
1347         * @privlevel        public
1348         * @privilege    %http://tizen.org/privilege/camera
1349         *
1350         * @return           An error code
1351         * @param[in] rotation                                      The camera rotation
1352         * @exception E_SUCCESS                               The method is successful.
1353         * @exception E_PRIVILEGE_DENIED         The application does not have the privilege to call this method.
1354         * @exception E_INVALID_STATE                         This instance is in an invalid state for this method.
1355         * @exception E_INVALID_ARG                    The input value is out of range.
1356         * @exception E_UNSUPPORTED_OPERATION            The target device does not support preview rotation configuration feature.
1357         * @exception E_UNSUPPORTED_TYPE               The specified @c rotation is not supported.
1358         * @exception E_SYSTEM                                A system error has occurred.
1359         * @remarks   This method works in the ::CAMERA_STATE_INITIALIZED state.
1360         * @remarks   The last specified type is applied even with the several types applicable.
1361         * @remarks   This method rotates the preview and recording data but not the captured image. @n
1362         *            The captured image's orientation is always following the physical rotation.
1363         * @remarks   When the preview is rotated, the preview callback data's width and height can be changed. @n
1364         *            Thus the application must recognize these changes when it uses the preview data in ICameraEventListener::OnCameraPreviewed() callback.
1365         * @remarks   For the intended view of preview, Tizen::Ui::Controls::OverlayRegion::OVERLAY_REGION_TYPE_NORMAL must be selected when Tizen::Ui::Controls::OverlayRegion is created.
1366         * @remarks              In a zero-shutter-lag camera, the default preview format is not guaranteed to apply this feature correctly.
1367         * @remarks              The zero-shutter-lag capability can be checked using MediaCapability::GetValue(const Tizen::Base::String& key, bool& value) with
1368         *                               ::CAMERA_PRIMARY_SUPPORT_ZERO_SHUTTER_LAG, ::CAMERA_SECONDARY_SUPPORT_ZERO_SHUTTER_LAG keys.
1369         * @see                     GetPreviewRotation()
1370         *
1371         */
1372         result SetPreviewRotation(CameraRotation rotation);
1373
1374         /**
1375         *
1376         * Gets the rotation for the previewed data.
1377         *
1378         * @since                2.0
1379         *
1380         * @return           The camera rotation
1381         * @see              SetPreviewRotation()
1382         *
1383         */
1384         CameraRotation GetPreviewRotation(void) const;
1385
1386         /**
1387         * Sets the metering mode of the camera.
1388         *
1389         * @since                2.0
1390         * @privlevel        public
1391         * @privilege    %http://tizen.org/privilege/camera
1392         *
1393         * @return               An error code
1394         * @param[in]    meteringMode                            The metering mode
1395         * @exception    E_SUCCESS                                       The method is successful.
1396         * @exception    E_INVALID_STATE                         This instance is in an invalid state for this method.
1397         * @exception    E_DEVICE_BUSY                           The camera is under use by other application.
1398         * @exception    E_DEVICE_UNAVAILABLE            The camera becomes unavailable.
1399         * @exception    E_DEVICE_FAILED                         The device operation has failed.
1400         * @exception    E_INVALID_ARG                           The specified metering mode is invalid.
1401         * @exception    E_UNSUPPORTED_OPERATION  The target device does not support metering mode configuration feature.
1402         * @exception    E_UNSUPPORTED_TYPE                The specified @c meteringMode is not supported.
1403         * @exception    E_OUT_OF_MEMORY                         The memory is insufficient.
1404         * @exception    E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
1405         * @remarks      ::CAMERA_METERING_MODE_NONE always throws E_INVALID_ARG.
1406         * @see          GetMeteringMode()
1407         */
1408         result SetMeteringMode(CameraMeteringMode meteringMode);
1409
1410         /**
1411         * Gets the metering mode of the camera.
1412         *
1413         * @since                2.0
1414         *
1415         * @return               The %Camera metering mode
1416         * @remarks      If the %Camera does not support the metering mode, this method always returns ::CAMERA_METERING_MODE_NONE.
1417         * @see          SetMeteringMode()
1418         */
1419         CameraMeteringMode GetMeteringMode(void) const;
1420
1421         /**
1422          * Sets the scene mode of the camera.
1423          *
1424          * @since               2.1
1425          * @privlevel        public
1426          * @privilege    %http://tizen.org/privilege/camera
1427          *
1428          * @return             An error code
1429          * @param[in]       sceneMode                                                  The scene mode
1430          * @exception       E_SUCCESS                                                               The method is successful.
1431          * @exception       E_INVALID_STATE                                         This instance is in an invalid state for this method.
1432          * @exception       E_DEVICE_BUSY                                            The camera is under use by another application.
1433          * @exception       E_DEVICE_UNAVAILABLE                  The camera becomes unavailable.
1434          * @exception       E_DEVICE_FAILED                                         The device operation has failed.
1435          * @exception       E_INVALID_ARG                                            The specified @c sceneMode is invalid.
1436          * @exception       E_UNSUPPORTED_OPERATION         The target device does not support scene mode configuration feature.
1437          * @exception       E_UNSUPPORTED_TYPE                      The specified @c sceneMode is not supported.
1438          * @exception       E_PRIVILEGE_DENIED                                    The application does not have the privilege to call this method.
1439          * @remarks             In a specific scene mode, camera's attributes such as brightness, metering mode, iso level, white balance, flash, and focus are changed to the ones that are pre-defined by each scene mode. @n
1440          *                         In a specific scene mode, if an application sets any attribute that is related to the scene, the mode can be changed to ::CAMERA_SCENE_OFF. @n
1441          *                         Thus, it is recommended that the application check the current scene mode after setting the attributes. @n
1442          *                         In case that the scene mode is changed to ::CAMERA_SCENE_OFF, all the attributes set by the application are reloaded.
1443          */
1444          result SetSceneMode(CameraSceneMode sceneMode);
1445
1446
1447          /**
1448          * Gets the scene mode of the camera.
1449          *
1450          * @since               2.1
1451          *
1452          * @return                         The %Camera scene mode
1453          */
1454          CameraSceneMode GetSceneMode(void) const;
1455
1456         /**
1457         * Adds the stream filter to process the video stream data while previewing or recording.
1458         *
1459         * @since                2.1
1460         * @privlevel    public
1461         * @privilege    %http://tizen.org/privilege/camera
1462         *
1463         * @return               An error code
1464         * @param[in]    filter                  An instance of IVideoStreamFilter
1465         * @exception    E_SUCCESS                       The method is successful.
1466         * @exception    E_OBJ_ALREADY_EXIST     The filter already exists.
1467         * @exception    E_OUT_OF_MEMORY     The memory is insufficient.
1468         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
1469         * @remarks IVideoStreamFilter::ProcessVideoStream() will be called when the video frame is ready.
1470         */
1471         result AddVideoStreamFilter(Tizen::Media::IVideoStreamFilter& filter);
1472
1473         /**
1474         * Removes the stream filter to stop receiving the video stream data.
1475         *
1476         * @since                2.1
1477         * @privlevel    public
1478         * @privilege    %http://tizen.org/privilege/camera
1479         *
1480         * @return               An error code
1481         * @param[in]    filter                  An instance of IVideoStreamFilter
1482         * @exception    E_SUCCESS                       The method is successful.
1483         * @exception    E_OBJ_NOT_FOUND        The filter is not found.
1484         * @exception    E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
1485         */
1486         result RemoveVideoStreamFilter(Tizen::Media::IVideoStreamFilter& filter);
1487
1488         /**
1489          * This value can be used to set the preview frame rate by using the SetPreviewFrameRate() method. @n
1490          * If the preview frame rate is set using this value, the frame rate during the preview is automatically adjusted as per the light condition.
1491          *
1492          * @since               2.0
1493          */
1494         static const int FRAME_RATE_AUTO = 0xFFFFFFFF;
1495
1496 private:
1497         /**
1498          * This is the copy constructor for this class.
1499          *
1500          * @since               2.0
1501          *
1502          * @remarks         The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
1503          * @see                 Construct()
1504          */
1505         Camera(const Camera& rhs);
1506
1507         /**
1508          * This is the copy assignment operator for this class.
1509          *
1510          * @since               2.0
1511          *
1512          * @remarks         The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
1513          *
1514          */
1515         Camera& operator =(const Camera& rhs);
1516
1517         friend class _CameraImpl;
1518         _CameraImpl* __pImpl;
1519
1520 };
1521
1522 }}// Tizen::Media
1523
1524 #endif