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 * #include <FTelephony.h>
53 * using namespace Tizen::Base;
54 * using namespace Tizen::Telephony;
58 * , public ITelephonyCallEventListener
64 * // ITelephonyCallEventListener
65 * void OnTelephonyCallStatusChangedN(CallStatus callStatus, CallInfo* pCallInfo);
67 * void GetCallInfo(void);
71 * MyClass::OnTelephonyCallStatusChangedN(CallStatus callStatus, CallInfo* pCallInfo)
76 * if (callStatus == CALL_STATUS_RINGING)
78 * callType = pCallInfo->GetCallType();
79 * number = pCallInfo->GetNumber();
86 * MyClass::GetCallInfo(void)
88 * CallType callType = TYPE_UNDEFINED_CALL;
89 * CallStatus callStatus = CALL_STATUS_UNDEFINED;
91 * CallManager* pCallManager = new (std::nothrow) CallManager();
93 * result r = pCallManager->Construct(*this);
96 * delete pCallManager;
100 * callStatus = pCallManager->GetCurrentCallStatus();
101 * if (callStatus == CALL_STATUS_COMMUNICATING)
103 * callType = pCallManager->GetCurrentCallType();
106 * delete pCallManager;
113 class _OSP_EXPORT_ CallManager
114 : public Tizen::Base::Object
118 * 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.
125 * This destructor overrides Tizen::Base::Object::~Object().
129 virtual ~CallManager(void);
132 * Initializes a new instance of this class. @n
133 * This is the two phase construction.
136 * @feature %http://tizen.org/feature/network.telephony
137 * @return An error code
138 * @exception E_SUCCESS The method is successful.
139 * @exception E_SYSTEM A system error has occurred.
140 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. @b Since: @b 2.1
141 * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
142 * @remarks Before calling this method, check whether the feature is supported by
143 * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
145 result Construct(void);
148 * Initializes a new instance of this class. @n
149 * This is the two phase construction.
152 * @feature %http://tizen.org/feature/network.telephony
153 * @return An error code
154 * @param[in] listener The listener for change in status of a call
155 * @exception E_SUCCESS The method is successful.
156 * @exception E_SYSTEM A system error has occurred.
157 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. @b Since: @b 2.1
158 * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
159 * @remarks Before calling this method, check whether the feature is supported by
160 * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
162 result Construct(ITelephonyCallEventListener& listener);
165 * Sets the listener that listens to the call forwarding request.
169 * @privlevel platform
170 * @privilege %http://tizen.org/privilege/callforward
172 * @return An error code
173 * @param[in] pListener An ITelephonyCallForwardListener instance @n
174 * The parameter can be set to @c null to remove listener.
175 * @exception E_SUCCESS The method is successful.
176 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
177 * @exception E_SYSTEM A system error has occurred.
179 result SetCallForwardListener(ITelephonyCallForwardListener* pListener);
182 * Requests call forwarding with the specified number. @n
183 * The %RequestCallForward() method sends the request to the network, and receives the response asynchronously.
187 * @privlevel platform
188 * @privilege %http://tizen.org/privilege/callforward
190 * @return An error code
191 * @param[in] phoneNumber The phone number for call forwarding
192 * @exception E_SUCCESS The method is successful.
193 * @exception E_INVALID_STATE This instance is in an invalid state.
194 * @exception E_INVALID_FORMAT The specified phone number is in an invalid format.
195 * @exception E_IN_PROGRESS The previous request is in progress.
196 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
197 * @exception E_NETWORK_UNAVAILABLE The operation has failed because the device is in the offline mode.
198 * @exception E_SERVICE_UNAVAILABLE The operation has failed because the device is out of the coverage area or in the emergency mode.
199 * @exception E_SYSTEM A system error has occurred.
200 * @remarks The call will be forwarded unconditionally. Voice call only. @n
201 * The phone number can start with plus(+) and the remaining part must be number.
202 * @see ITelephonyCallForwardListener::OnTelephonyCallForwardResponseReceived()
204 result RequestCallForward(const Tizen::Base::String& phoneNumber);
207 * Stops call forwarding.
211 * @privlevel platform
212 * @privilege %http://tizen.org/privilege/callforward
214 * @return An error code
215 * @exception E_SUCCESS The method is successful.
216 * @exception E_INVALID_STATE This instance is in an invalid state.
217 * @exception E_IN_PROGRESS The previous request is in progress.
218 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
219 * @exception E_NETWORK_UNAVAILABLE The operation has failed because the device is in the offline mode.
220 * @exception E_SERVICE_UNAVAILABLE The operation has failed because the device is out of the coverage area or in the emergency mode.
221 * @exception E_SYSTEM A system error has occurred.
222 * @see ITelephonyCallForwardListener::OnTelephonyCallForwardStopped()
224 result StopCallForward(void);
227 * Gets the phone number to which the call must be forwarded.
231 * @privlevel platform
232 * @privilege %http://tizen.org/privilege/callforward
234 * @return An error code
235 * @exception E_SUCCESS The method is successful.
236 * @exception E_IN_PROGRESS The previous request is in progress.
237 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
238 * @exception E_NETWORK_UNAVAILABLE The operation has failed because the device is in the offline mode.
239 * @exception E_SERVICE_UNAVAILABLE The operation has failed because the device is out of the coverage area or in the emergency mode.
240 * @exception E_SYSTEM A system error has occurred.
241 * @see ITelephonyCallForwardListener::OnTelephonyCallForwardNumberReceived
243 result GetCallForwardNumber(void) const;
246 * Gets the call type of the current call.
250 * @return The current call type, @n
251 * else @c TYPE_UNDEFINED_CALL if the method fails
253 CallType GetCurrentCallType(void) const;
256 * Gets the call status of the current call.
260 * @return The current call status, @n
261 * else @c CALL_STATUS_UNDEFINED if the method fails
263 CallStatus GetCurrentCallStatus(void) const;
267 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
269 * @param[in] rhs An instance of %CallManager
271 CallManager(const CallManager& rhs);
274 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
276 * @param[in] rhs An instance of %CallManager
278 CallManager& operator =(const CallManager& rhs);
281 _CallManagerImpl* __pCallManagerImpl;
283 friend class _CallManagerImpl;
286 } } // Tizen::Telephony
287 #endif // _FTEL_CALL_MANAGER_H_