Merge "seek expection handling bug" into tizen_2.2
[platform/framework/native/media.git] / src / FMedia_CameraEvent.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                        FMedia_CameraEvent.h
20  * @brief                       This header file contains the declaration of _CameraEvent class.
21  *
22  */
23
24 #ifndef _FMEDIA_INTERNAL_CAMERA_EVENT_H_
25 #define _FMEDIA_INTERNAL_CAMERA_EVENT_H_
26
27 #include <FBaseByteBuffer.h>
28 #include <FBaseRt_Event.h>
29 #include "FMedia_CameraEventArg.h"
30
31 namespace Tizen { namespace Media
32 {
33
34 class _CameraImpl;
35
36 /**
37  * @class       _CameraEvent
38  * @brief               This class provides the Camera Event.
39  *
40  *      This class is the Camera event, which can notify to the listeners which derives ICameraEventListener.
41  *      This event is fired upon receipt of notification from subsystem.
42  *      For instances, when the auto-focusing is completed, ICameraEventListener::OnCameraAutoFocused is invoked.
43  *
44  *      @see    Camera, _CameraEventArg, ICameraEventListener
45  */
46 class _CameraEvent
47         : public Tizen::Base::Runtime::_Event
48 {
49
50 public:
51         /**
52          *      The constructor.
53          */
54         _CameraEvent(void);
55
56         /**
57          *      The destructor.
58          */
59         ~_CameraEvent(void);
60
61         /**
62          * Initializes a new instance of this class
63          *
64          *      @param[in]      cameraImpl      The _CameraImpl object
65          */
66         result Construct(_CameraImpl& cameraImpl);
67
68         /**
69          *      Sends event.
70          *
71          *  @return             The error code.
72          *  @param[in]  event                                   The event type.
73          *      @param[in]      err                                             The error reason
74          *      @param[in]      res                                             The result of the event
75          *      @param[in]      pByteBuffer                             The data
76          *      @exception      E_SUCCESS                                                    - This method is successful.
77          *      @exception      E_OUT_OF_MEMORY                                  - Failed to allocate the required/requested memory.
78          *      @exception      E_INVALID_STATE                 - This instance is in an invalid state for this method.
79          *      @exception      E_INVALID_ARG                                - The argument passed to a method contains an invalid value.
80          */
81         result SendEvent(_CameraEventType event, CameraErrorReason err, result res, Tizen::Base::ByteBuffer* pByteBuffer);
82
83 protected:
84         /**
85          *      Finds out and invokes the method of listener corresponding to the specified event argument.
86          *
87          *  @param[in]  listener                                               An event listener to be invoked. This must be an instance of ICameraEventListener.
88          *      @param[in]      arg                                                           An argument to be fired.
89          *      @exception      E_SUCCESS                                                    - This method is successful.
90          *      @exception      E_OUT_OF_MEMORY                                  - Failed to allocate the required/requested memory.
91          *      @exception      E_INVALID_STATE                 - This instance is in an invalid state for this method.
92          *      @exception      E_INVALID_ARG                                - The argument passed to a method contains an invalid value.
93          */
94         void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
95
96 private:
97         _CameraEvent(const _CameraEvent& rhs);
98         _CameraEvent& operator =(const _CameraEvent& rhs);
99
100         _CameraImpl* __pCameraImpl;
101
102 };
103
104 }}
105
106 #endif