Tizen 2.0 Release
[framework/osp/media.git] / inc / FMediaITonePlayerEventListener.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                FMediaITonePlayerEventListener.h
20  * @brief               This is the header file for the %ITonePlayerEventListener interface.
21  *
22  * This header file contains the declarations of the %ITonePlayerEventListener interface.
23  */
24
25 #ifndef _FMEDIA_ITONE_PLAYER_EVENT_LISTENER_H_
26 #define _FMEDIA_ITONE_PLAYER_EVENT_LISTENER_H_
27
28 #include <FBaseRtIEventListener.h>
29 #include <FMediaTonePlayer.h>
30
31 namespace Tizen { namespace Media
32 {
33 class TonePlayer;
34 /**
35  * @interface   ITonePlayerEventListener
36  * @brief               This interface provides a listener for the tone player events.
37  *
38  * @since               2.0
39  *
40  * The %ITonePlayerEventListener interface specifies the methods used to notify the status of the tone player.
41  */
42
43 class _OSP_EXPORT_ ITonePlayerEventListener
44         : virtual public Tizen::Base::Runtime::IEventListener
45 {
46 public:
47         /**
48         * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
49         *
50         * @since                2.0
51         */
52         virtual ~ITonePlayerEventListener(void) {}
53
54         /**
55         *       Called when the tone player reaches to the end of the tone or the end of the list of tones.
56         *
57         *     @since            2.0
58         *
59         *       @param[in]      src             An instance of TonePlayer that fires the event
60         *
61         */
62         virtual void OnTonePlayerEndOfTone(Tizen::Media::TonePlayer& src) = 0;
63
64         /**
65         *       Called when the tone player is interrupted by a task of higher priority than the tone player.
66         *
67         *     @since            2.0
68         *
69         *       @param[in]      src             An instance of TonePlayer that fires the event
70         *
71         */
72         virtual void OnTonePlayerInterrupted(Tizen::Media::TonePlayer& src) = 0;
73
74         /**
75         *       Called when the interrupted tone player is released.
76         *
77         *     @since            2.0
78         *
79         *       @param[in]      src             An instance of TonePlayer that fires the event
80         *
81         */
82         virtual void OnTonePlayerReleased(Tizen::Media::TonePlayer& src) = 0;
83
84         /**
85         *       Called to notify an application that an error has occurred while the tone is played.
86         *
87         *   @since              2.0
88         *
89         *       @param[in]      src                                                                     An instance of TonePlayer that fires the event
90         *       @param[in]      r                                                                       A cause of the error
91         *       @exception      E_SYSTEM                                                        A system error has occurred.
92         */
93         virtual void OnTonePlayerErrorOccurred(Tizen::Media::TonePlayer& src, result r) = 0;
94
95         /**
96         *       Called when an audio playback focus is changed to another application.
97         *
98         *       @since          2.0
99         *
100         *       @param[in]              src             A pointer to the TonePlayer instance that fired the event
101         *       @remarks                After the audio focus is being changed, the playback is paused and the state of this instance is changed to TONE_PLAYER_STATE_PAUSED.
102         *       @remarks                An application can play again in the state of TONE_PLAYER_STATE_PAUSED but the interaction between device and user needs for playback again. Because there is a possibility of a race condition between applications which try to play without the interaction
103         *       @remarks                An application cannot start playback again even in the state of TONE_PLAYER_STATE_PAUSED due to other applications which have a higher priority.
104         */
105         virtual void OnTonePlayerAudioFocusChanged(Tizen::Media::TonePlayer& src) {}
106
107 protected:
108         //
109         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
110         //
111         // This method is reserved and may change its name at any time without prior notice.
112         //
113         // @since               2.0
114         //
115         virtual void ITonePlayerEventListener_Reserved1(void) {}
116
117         //
118         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
119         //
120         // This method is reserved and may change its name at any time without prior notice.
121         //
122         // @since               2.0
123         //
124         virtual void ITonePlayerEventListener_Reserved2(void) {}
125
126         //
127         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
128         //
129         // This method is reserved and may change its name at any time without prior notice.
130         //
131         // @since               2.0
132         //
133         virtual void ITonePlayerEventListener_Reserved3(void) {}
134
135 };
136
137 }}// Tizen::Media
138
139 #endif