2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FMediaVoipAudioSessionManager.h
20 * @brief This is the header file for the %VoipAudioSessionManager class.
22 * This header file contains the declarations of the %VoipAudioSessionManager class.
25 #ifndef _FMEDIA_VOIP_AUDIO_SESSION_MANAGER_H_
26 #define _FMEDIA_VOIP_AUDIO_SESSION_MANAGER_H_
28 #include <FMediaAudioManagerTypes.h>
30 namespace Tizen { namespace Media
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.
41 * @final This class is not intended for extension.
45 * @remarks Only one instance of the class works at a time.
48 class _OSP_EXPORT_ VoipAudioSessionManager
49 :public Tizen::Base::Object
54 * Gets the VoIP audio session manager instance's pointer.
59 * @privilege %http://tizen.org/privilege/audiomanager.voipsession
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.
69 static VoipAudioSessionManager* GetInstance(void);
73 * Enters a new VoIP call session
78 * @privilege %http://tizen.org/privilege/audiomanager.voipsession
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.
90 result EnterCallSession(void);
94 * Sets the VoIP call session's current operation mode such as voice calling, ringing, or playing media stream.
99 * @privilege %http://tizen.org/privilege/audiomanager.voipsession
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.
110 result SetCallSessionMode(VoipAudioSessionMode mode);
114 * Gets the current VoIP call session mode
118 * @visibility partner
119 * @privilege %http://tizen.org/privilege/audiomanager.voipsession
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.
130 VoipAudioSessionMode GetCallSessionMode(void) const;
134 * Exits current VoIP call session
138 * @visibility partner
139 * @privilege %http://tizen.org/privilege/audiomanager.voipsession
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.
148 result ExitCallSession(void);
153 * This default constructor is intentionally declared as private to implement the Singleton semantic.
157 * @visibility partner
160 VoipAudioSessionManager(void);
164 * This destructor is intentionally declared as private to implement the Singleton semantic.
168 * @visibility partner
171 virtual ~VoipAudioSessionManager(void);
175 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
179 * @visibility partner
182 VoipAudioSessionManager(const VoipAudioSessionManager& rhs);
186 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit assigning of objects.
190 * @visibility partner
193 VoipAudioSessionManager& operator =(const VoipAudioSessionManager& rhs);
195 class _VoipAudioSessionManagerImpl* __pVoipAudioSessionManagerImpl;