Tizen 2.0 Release
[framework/osp/media.git] / inc / FMediaVoipAudioSessionManager.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                        FMediaVoipAudioSessionManager.h
20  * @brief                       This is the header file for the %VoipAudioSessionManager class.
21  *
22  * This header file contains the declarations of the %VoipAudioSessionManager class.
23  */
24
25 #ifndef _FMEDIA_VOIP_AUDIO_SESSION_MANAGER_H_
26 #define _FMEDIA_VOIP_AUDIO_SESSION_MANAGER_H_
27
28 #include <FMediaAudioManagerTypes.h>
29
30 namespace Tizen { namespace Media
31 {
32 /**
33  * @if VISPARTNER
34  *      @class VoipAudioSessionManager
35  * @brief       This class is used to manage audio session for VoIP call.
36  * The audio system related operation will be performed based on the VoIP call scenario with the methods of this class.
37  * As the precondition, all media-related instances MUST be destroyed before this class is used.
38  *
39  *      @since          2.0
40  *
41  * @final This class is not intended for extension.
42  *
43  *      @visibility                     partner
44  *
45  * @remarks   Only one instance of the class works at a time.
46  * @endif
47  */
48 class _OSP_EXPORT_ VoipAudioSessionManager
49         :public Tizen::Base::Object
50 {
51 public:
52         /**
53         *       @if VISPARTNER
54         *       Gets the VoIP audio session  manager instance's pointer.
55         *
56         *       @since          2.0
57         *
58         *       @visibility                             partner
59         *       @privilege                              %http://tizen.org/privilege/audiomanager.voipsession
60         *
61         *       @return                 A pointer to the VoIP audio session manager instance, @n
62                                                                         else @c null if it fails
63         *       @exception                      E_SUCCESS                                               The method is successful
64         *       @exception                      E_OUT_OF_MEMORY                 Not enough memory to perform the operation
65         *       @exception                      E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method
66         *       @remarks            The specific error code can be accessed using the GetLastResult() method.
67         *       @endif
68         */
69         static VoipAudioSessionManager* GetInstance(void);
70
71         /**
72         * @if VISPARTNER
73         *       Enters a new VoIP call session
74         *
75         *       @since          2.0
76         *
77         *       @visibility                             partner
78         *       @privilege                              %http://tizen.org/privilege/audiomanager.voipsession
79         *
80         *       @return                                 An error code
81         *       @exception                      E_SUCCESS                                               The method is successful
82         *       @exception                      E_OUT_OF_MEMORY                 Not enough memory to make a VoIP call
83         *       @exception                      E_INVALID_STATE                         This instance is in an invalid state for this method
84         *       @exception                      E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method
85         *       @remarks                        The method returns E_INVALID_STATE when this method is called more than once.
86         *       @remarks                        All media-related instances MUST be destroyed before entering the VoIP call audio session.@n
87                                                                         if not,  this method returns E_INVALID_STATE.
88         *       @endif
89         */
90         result EnterCallSession(void);
91
92         /**
93         * @if VISPARTNER
94         *       Sets the VoIP call session's current operation mode such as voice calling, ringing, or playing media stream.
95         *
96         *       @since          2.0
97         *
98         *       @visibility                             partner
99         *       @privilege                              %http://tizen.org/privilege/audiomanager.voipsession
100         *
101         *       @return                                 An error code
102         *       @param[in]                              mode                                                                    The VoIP audio session mode
103         *       @exception                      E_SUCCESS                                               The method is successful
104         *       @exception                      E_INVALID_STATE                         This instance is in an invalid state for this method.
105         *       @exception                      E_INVALID_ARG                                   A specified input parameter is invalid
106         *       @exception                      E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method
107         *       @remarks This method should be called after EnterCallSession(), if not, this method returns E_INVALID_STATE.
108         *       @endif
109         */
110         result SetCallSessionMode(VoipAudioSessionMode mode);
111
112         /**
113         * @if VISPARTNER
114         *       Gets the current VoIP call session mode
115         *
116         *       @since          2.0
117         *
118         *       @visibility                             partner
119         *       @privilege                              %http://tizen.org/privilege/audiomanager.voipsession
120         *
121         *       @return                                 VoIP audio session mode,@n
122                                                                                 or returns VOIP_AUDIO_SESSION_MODE_NONE when this method fail.
123         *       @exception                      E_SUCCESS                                               The method is successful
124         *       @exception                      E_INVALID_STATE                         This instance is in an invalid state for this method.
125         *       @exception                      E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method
126         *       @remarks                        If exception is occured then this method returns VOIP_CALL_SESSION_MODE_NONE
127         *       @remarks This method should be called after EnterCallSession(), if not, this method returns E_INVALID_STATE.
128         *       @endif
129         */
130         VoipAudioSessionMode GetCallSessionMode(void) const;
131
132         /**
133         * @if VISPARTNER
134         *       Exits current VoIP call session
135         *
136         *       @since          2.0
137         *
138         *       @visibility                             partner
139         *       @privilege                              %http://tizen.org/privilege/audiomanager.voipsession
140         *
141         *       @return                         An error code
142         *       @exception                      E_SUCCESS                                               The method is successful
143         *  @exception                   E_INVALID_STATE                         This instance is in an invalid state for this method.
144         *       @exception                      E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method
145         *       @remarks This method should be called after EnterCallSession(), if not, this method returns E_INVALID_STATE.
146         *       @endif
147         */
148         result ExitCallSession(void);
149
150 private:
151         /**
152         * @if VISPARTNER
153         *       This default constructor is intentionally declared as private to implement the Singleton semantic.
154         *
155         *       @since          2.0
156         *
157         *       @visibility                             partner
158         *       @endif
159         */
160         VoipAudioSessionManager(void);
161
162         /**
163         *  @if VISPARTNER
164         *       This destructor is intentionally declared as private to implement the Singleton semantic.
165         *
166         *       @since          2.0
167         *
168         *       @visibility                             partner
169         *       @endif
170         */
171         virtual ~VoipAudioSessionManager(void);
172
173         /**
174          * @if VISPARTNER
175          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
176          *
177          * @since               2.0
178          *
179          * @visibility          partner
180          * @endif
181          */
182         VoipAudioSessionManager(const VoipAudioSessionManager& rhs);
183
184         /**
185          * @if VISPARTNER
186          * The implementation of this copy assignment  operator is intentionally blank and declared as private to prohibit assigning of objects.
187          *
188          * @since               2.0
189          *
190          * @visibility          partner
191          * @endif
192          */
193         VoipAudioSessionManager& operator =(const VoipAudioSessionManager& rhs);
194
195         class _VoipAudioSessionManagerImpl* __pVoipAudioSessionManagerImpl;
196
197 };
198
199 }} // Tizen::Media
200
201 #endif