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 FTel_CallManagerImpl.h
19 * @brief This is the header file for the _CallManagerImpl class.
21 * This header file contains the declarations of the _CallManagerImpl Class.
23 #ifndef _FTEL_INTERNAL_CALL_MANAGER_IMPL_H_
24 #define _FTEL_INTERNAL_CALL_MANAGER_IMPL_H_
27 #include <unique_ptr.h>
28 #include <tapi_type.h>
30 #include <FBaseObject.h>
31 #include <FTelCallInfo.h>
32 #include <FTelTypes.h>
35 namespace Tizen { namespace Base
40 namespace Tizen { namespace Telephony
42 class ITelephonyCallForwardListener;
43 class ITelephonyCallEventListener;
45 class _CallManagerEvent;
46 class _CallForwardEvent;
47 class _TelephonyIpcProxy;
51 * @class _CallManagerImpl
52 * @brief This class provides methods to obtain information about the current call.
55 * This class provides methods to obtain information about the current call type and its status.
57 * The following code snippet illustrates how to obtain information about a call.
59 class _CallManagerImpl
60 : public Tizen::Base::Object
63 * @enum _CallForwardingState
64 * Defines the state of the call forwarding.
66 enum _CallForwardingState
69 _CALL_FORWARD_REQUESTING,
70 _CALL_FORWARD_ON_SERVICE,
71 _CALL_FORWARD_STOPPING
75 * @enum _CallNotificationId
76 * Defines the call notification id
78 enum _CallNotificationId
80 _CALL_NOTI_VOICE_CALL_IDLE,
81 _CALL_NOTI_VOICE_CALL_COMMUNICATING,
82 _CALL_NOTI_VOICE_CALL_RINGING,
83 _CALL_NOTI_VOICE_CALL_DIALING,
84 _CALL_NOTI_VOICE_CALL_HOLDING,
85 _CALL_NOTI_VIDEO_CALL_IDLE,
86 _CALL_NOTI_VIDEO_CALL_COMMUNICATING,
87 _CALL_NOTI_VIDEO_CALL_RINGING,
88 _CALL_NOTI_VIDEO_CALL_DIALING,
89 _CALL_NOTI_PEER_CALL_HELD,
90 _CALL_NOTI_PEER_CALL_RETRIEVED,
97 * This is the default constructor for this class.
101 _CallManagerImpl(void);
103 * This is the destructor for this class.
107 virtual ~_CallManagerImpl(void);
110 * @see CallManager::Construct()
112 result Construct(ITelephonyCallEventListener* pListener = null);
115 * @see CallManager::SetCallForwardListener()
117 result SetCallForwardListener(ITelephonyCallForwardListener* pListener);
120 * @see CallManager::RequestCallForward(), OnCallForwardNumberReceivedCallback()
123 result RequestCallForward(const Tizen::Base::String& phoneNumber);
126 * @see CallManager::StopCallForward(), OnCallForwardStoppedCallback()
128 result StopCallForward(void);
131 * @see CallManager::GetCallForwardNumber(), OnCallForwardNumberReceivedCallback()
133 result GetCallForwardNumber(void);
136 * @see CallManager::GetCurrentCallType()
138 CallType GetCurrentCallType(void) const;
141 * @see CallManager::GetCurrentCallStatus()
143 CallStatus GetCurrentCallStatus(void) const;
145 void OnTelephonyCallForwardNumberReceived(Tizen::Base::String phoneNumber, result r);
146 void OnTelephonyCallForwardResponseReceived(Tizen::Base::String phoneNumber, result r);
147 void OnTelephonyCallForwardStopped(Tizen::Base::String phoneNumber, result r);
150 * Called when the status of a call is changed.
152 * @param[in] pHandle The call handle.
153 * @param[in] pNotiId The notification id.
154 * @param[in] pData The data of call status
155 * @param[in] pUserData The user data passed from the callback registration function
157 static void OnCallStatusChangedCallback(TapiHandle *pHandle, const char* pNotiId, void* pData, void* pUserData);
160 * Called when you get the information of call status
162 * @param[in] status The call status
163 * @param[in] pUserData The user data passed from the callback registration function
165 static void OnCallStatusCallback(TelCallStatus_t* pStatus, void* pUserData);
168 * Called when you get the information of call type
170 * @param[in] status The call status
171 * @param[in] pUserData The user data passed from the callback registration function
173 static void OnCallTypeCallback(TelCallStatus_t* pStatus, void* pUserData);
176 * Gets the Impl instance.
179 * @return The pointer to _CallManagerImpl
180 * @param[in] callManager An instance of CallManager
182 static _CallManagerImpl* GetInstance(CallManager& callManager);
185 * Gets the Impl instance.
188 * @return The pointer to _CallManagerImpl
189 * @param[in] callManager An instance of CallManager
191 static const _CallManagerImpl* GetInstance(const CallManager& callManager);
195 * Initialize the call status.
197 result InitializeInternalCallStatus(void);
200 * Checks the valid state of phone number.
202 bool IsPhoneNumberValid(const Tizen::Base::String& phoneNumber) const;
205 * Gets the phone number.
207 Tizen::Base::String GetPhoneNumber(TapiHandle* pCallHandle, int callId) const;
210 * Gets the string of call state.
212 const char* GetStringOfCallState(void) const;
215 * Gets the string of call forwarding state.
217 const char* GetStringOfCallFwdState(void) const;
220 * Gets the string of call event type.
222 const char* GetStringOfCallEventType(int type) const;
225 * This is the copy constructor for the %_CallManagerImpl class.
227 * @param[in] value An instance of %_CallManagerImpl
229 _CallManagerImpl(const _CallManagerImpl& value);
232 * This is the assignment operator.
233 * Do @b not use directly.
235 * @param[in] rhs An instance of %_CallManagerImpl
237 _CallManagerImpl& operator =(const _CallManagerImpl& rhs);
240 ITelephonyCallEventListener* __pCallEventListener;
241 ITelephonyCallForwardListener* __pCallForwardListener;
243 TapiHandle* __pHandle;
245 int __callFwdSubscriptionId;
246 int __callFwdStatusSubscriptionId;
249 int __callFwdReqNumId;
251 bool __isReqCallFwdNumInProgress;
253 CallStatus __curCallState;
254 _CallForwardingState __curCallFwdState;
256 _TelephonyIpcProxy* __pTelephonyServiceProxy;
258 std::unique_ptr<_CallManagerEvent> __pCallManagerEvent;
259 std::unique_ptr<_CallForwardEvent> __pCallForwardEvent;
261 const char* __pCallEventType[_CALL_NOTI_MAX];
263 }; // _CallManagerImpl
265 }} // Tizen::Telephony
266 #endif // _FTEL_INTERNAL_CALL_MANAGER_IMPL_H_