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