2 // Open Service Platform
3 // Copyright (c) 2012-2013 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.
18 * @file FTelCallManager.h
19 * @brief This is the header file for the %CallManager class.
21 * This header file contains the declarations of the %CallManager class.
23 #ifndef _FTEL_CALL_MANAGER_H_
24 #define _FTEL_CALL_MANAGER_H_
28 #include <FTelTypes.h>
29 #include <FTelCallInfo.h>
30 #include <FTelITelephonyCallEventListener.h>
31 #include <FTelITelephonyCallForwardListener.h>
34 namespace Tizen { namespace Telephony
36 class _CallManagerImpl;
40 * @brief This class provides methods to obtain information about the current call.
44 * The %CallManager class provides methods to obtain information about the current call type and its status.
46 * The following example demonstrates how to use the %CallManager class to obtain information about a call.
51 * MyClass::GetCallInfo(void)
53 * CallType callType = TYPE_UNDEFINED_CALL;
54 * CallStatus callStatus = CALL_STATUS_UNDEFINED;
56 * CallManager* pCallManager = new CallManager();
58 * result r = pCallManager->Construct(*this);
61 * delete pCallManager;
65 * callStatus = pCallManager->GetCurrentCallStatus();
67 * if (callStatus == CALL_STATUS_COMMUNICATING)
69 * callType = pCallManager->GetCurrentCallType();
72 * delete pCallManager;
77 * MyClass::OnTelephonyCallStatusChangedN(CallStatus callStatus,CallInfo * pCallInfo)
82 * if (callStatus == CALL_STATUS_RINGING)
84 * callType = pCallInfo->GetCallType();
85 * number = pCallInfo->GetNumber();
94 class _OSP_EXPORT_ CallManager
95 : public Tizen::Base::Object
99 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
106 * This destructor overrides Tizen::Base::Object::~Object().
110 virtual ~CallManager(void);
113 * Initializes a new instance of this class. @n
114 * This is the two phase construction.
118 * @return An error code
119 * @exception E_SUCCESS The method is successful.
120 * @exception E_SYSTEM A system error has occurred.
122 result Construct(void);
125 * Initializes a new instance of this class. @n
126 * This is the two phase construction.
130 * @return An error code
131 * @param[in] listener The listener for change in status of a call
132 * @exception E_SUCCESS The method is successful.
133 * @exception E_SYSTEM A system error has occurred.
134 * @see ITelephonyCallEventListener
136 result Construct(ITelephonyCallEventListener& listener);
139 * Sets the listener that listens to the call forwarding request.
143 * @privlevel platform
144 * @privilege http://tizen.org/privilege/callforward
146 * @return An error code
147 * @param[in] pListener An ITelephonyCallForwardListener instance @n
148 * The parameter can be set to @c null to remove listener.
149 * @exception E_SUCCESS The method is successful.
150 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
151 * @exception E_SYSTEM A system error has occurred.
153 result SetCallForwardListener(ITelephonyCallForwardListener* pListener);
156 * Requests call forwarding with the specified number. @n
157 * This method sends the request to the network, and receives the response asynchronously.
161 * @privlevel platform
162 * @privilege http://tizen.org/privilege/callforward
164 * @return An error code
165 * @param[in] phoneNumber The phone number for call forwarding
166 * @exception E_SUCCESS The method is successful.
167 * @exception E_INVALID_STATE This instance is in an invalid state.
168 * @exception E_INVALID_FORMAT The specified phone number is in an invalid format.
169 * @exception E_IN_PROGRESS The previous request is in progress.
170 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
171 * @exception E_NETWORK_UNAVAILABLE The operation has failed because the device is in the offline mode.
172 * @exception E_SERVICE_UNAVAILABLE The operation has failed because the device is out of the coverage area or in the emergency mode.
173 * @exception E_SYSTEM A system error has occurred.
174 * @remarks The call will be forwarded unconditionally. Voice call only. @n
175 * The phone number can start with plus(+) and the remaining part must be number.
176 * @see ITelephonyCallForwardListener::OnTelephonyCallForwardResponseReceived()
178 result RequestCallForward(const Tizen::Base::String& phoneNumber);
181 * Stops call forwarding.
185 * @privlevel platform
186 * @privilege http://tizen.org/privilege/callforward
188 * @return An error code
189 * @exception E_SUCCESS The method is successful.
190 * @exception E_INVALID_STATE This instance is in an invalid state.
191 * @exception E_IN_PROGRESS The previous request is in progress.
192 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
193 * @exception E_NETWORK_UNAVAILABLE The operation has failed because the device is in the offline mode.
194 * @exception E_SERVICE_UNAVAILABLE The operation has failed because the device is out of the coverage area or in the emergency mode.
195 * @exception E_SYSTEM A system error has occurred.
196 * @see ITelephonyCallForwardListener::OnTelephonyCallForwardStopped()
198 result StopCallForward(void);
201 * Gets the phone number to which the call must be forwarded.
205 * @privlevel platform
206 * @privilege http://tizen.org/privilege/callforward
208 * @return An error code
209 * @exception E_SUCCESS The method is successful.
210 * @exception E_IN_PROGRESS The previous request is in progress.
211 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
212 * @exception E_NETWORK_UNAVAILABLE The operation has failed because the device is in the offline mode.
213 * @exception E_SERVICE_UNAVAILABLE The operation has failed because the device is out of the coverage area or in the emergency mode.
214 * @exception E_SYSTEM A system error has occurred.
215 * @see ITelephonyCallForwardListener::OnTelephonyCallForwardNumberReceived
217 result GetCallForwardNumber(void) const;
220 * Gets the call type of the current call.
224 * @return The current call type, @n
225 * else TYPE_UNDEFINED_CALL if the method fails
227 CallType GetCurrentCallType(void) const;
230 * Gets the call status of the current call.
234 * @return The current call status, @n
235 * else CALL_STATUS_UNDEFINED if the method fails
237 CallStatus GetCurrentCallStatus(void) const;
241 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
243 * @param[in] rhs An instance of %CallManager
245 CallManager(const CallManager& rhs);
248 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
250 * @param[in] rhs An instance of %CallManager
252 CallManager& operator =(const CallManager& rhs);
255 _CallManagerImpl* __pCallManagerImpl;
257 friend class _CallManagerImpl;
260 } } // Tizen::Telephony
261 #endif // _FTEL_CALL_MANAGER_H_