dfe15112a5dfa0d3c49d326f1ea2c26ca661ac57
[platform/framework/native/media.git] / inc / FMediaIVideoRecorderEventListener.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                        FMediaIVideoRecorderEventListener.h
20  * @brief                       This is the header file for the %IVideoRecorderEventListener interface.
21  *
22  * This header file contains the declarations of the %IVideoRecorderEventListener interface.
23  */
24
25 #ifndef _FMEDIA_IVIDEO_RECORDER_EVENT_LISTENER_H_
26 #define _FMEDIA_IVIDEO_RECORDER_EVENT_LISTENER_H_
27
28 #include <FBase.h>
29 #include <FMediaRecorderTypes.h>
30
31 namespace Tizen { namespace Media
32 {
33
34 /**
35  * @interface   IVideoRecorderEventListener
36  * @brief                       This interface represents a listener that receives events associated with the %VideoRecorder class.
37  * @since               2.0
38  *
39  * The %IVideoRecorderEventListener interface specifies the methods used to notify the status of the video recorder.
40  * The video recorder engine works asynchronously. Therefore, it is important to implement this listener to ensure that the recorder flows correctly.
41  * When an operation of each method is completed, an event is generated and a method of this interface is called.
42  *
43  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/recording_video.htm">Recording Video</a>.
44  */
45 class _OSP_EXPORT_ IVideoRecorderEventListener
46         : virtual public Tizen::Base::Runtime::IEventListener
47 {
48
49 public:
50         /**
51         * This is the destructor for this class.
52         *
53         * @since                2.0
54         */
55         virtual ~IVideoRecorderEventListener(void) {}
56
57         /**
58         *       Called when the VideoRecorder::Stop() method is completed.
59         *
60         * @since                2.0
61         *
62         * @param[in]     r      The cause of the error
63         *       @exception       E_SUCCESS      The method is successful.
64         *       @exception       E_SYSTEM       A system error has occurred.
65         *
66         */
67         virtual void OnVideoRecorderStopped(result r) = 0;
68
69         /**
70         *       Called when the VideoRecorder::Cancel() method is completed.
71         *
72         * @since                2.0
73         *
74         * @param[in]   r        The cause of the error
75         *       @exception       E_SUCCESS      The method is successful.
76         *       @exception       E_SYSTEM       A system error has occurred.
77         */
78         virtual void OnVideoRecorderCanceled(result r) = 0;
79
80         /**
81         *       Called when the VideoRecorder::Pause() method is completed.
82         *
83         * @since                2.0
84         *
85         * @param[in]     r      The cause of the error
86         *       @exception       E_SUCCESS      The method is successful.
87         *       @exception       E_SYSTEM       A system error has occurred.
88         *
89         */
90         virtual void OnVideoRecorderPaused(result r) = 0;
91
92         /**
93         *       Called when the VideoRecorder::Record() method is completed.
94         *
95         * @since                2.0
96         *
97         * @param[in]     r      The cause of the error
98         *       @exception       E_SUCCESS      The method is successful.
99         *       @exception       E_SYSTEM       A system error has occurred.
100         *
101         */
102         virtual void OnVideoRecorderStarted(result r) = 0;
103
104         /**
105          *      Called when VideoRecorder reaches the end of the pre-defined time.
106          *
107          * @since               2.0
108          *
109          * @param[in]   endCondition    The end condition of the recording
110          * @see                         VideoRecorder::SetMaxRecordingTime()
111          *
112          */
113         virtual void OnVideoRecorderEndReached(RecordingEndCondition endCondition) = 0;
114
115         /**
116         *       Called when the VideoRecorder::Close() method is completed.
117         *
118         * @since                2.0
119         *
120         * @param[in]     r      The cause of the error
121         *       @exception       E_SUCCESS      The method is successful.
122         *       @exception       E_SYSTEM       A system error has occurred.
123         *
124         */
125         virtual void OnVideoRecorderClosed(result r) = 0;
126
127         /**
128         *       Called when an error occurred in VideoRecorder.
129         *
130         * @since                2.0
131         *
132         *       @param[in]      r               A video recorder error reason of type ::RecorderErrorReason
133         *       @remarks                        
134         *                               - ::RECORDER_ERROR_OUT_OF_STORAGE occurs when the recording size exceeds the maximum available capacity.
135         *                               - While recording to an external memory like MMC card, ::RECORDER_ERROR_STORAGE_FAILED can occur.
136         *                               - ::RECORDER_ERROR_DEVICE_FAILED occurs when the recording device has a problem like damaged shape or h/w failure.
137         */
138         virtual void OnVideoRecorderErrorOccurred(RecorderErrorReason r) = 0;
139
140 protected:
141         //
142         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
143         //
144         // This method is reserved and may change its name at any time without prior notice.
145         //
146         // @since               2.0
147         //
148         virtual void IVideoRecorderEventListener_Reserved1(void) {}
149
150         //
151         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
152         //
153         // This method is reserved and may change its name at any time without prior notice.
154         //
155         // @since               2.0
156         //
157         virtual void IVideoRecorderEventListener_Reserved2(void) {}
158
159 };
160
161 }}// Tizen::Media
162
163 #endif