24
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Sony Ericsson Mobile Communications AB
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Sony Ericsson Mobile Communications AB - initial contribution.
|
|
11 |
* Nokia Corporation - additional changes.
|
|
12 |
*
|
|
13 |
* Contributors:
|
|
14 |
*
|
|
15 |
* Description:
|
|
16 |
* TelephonyActNetwork Active Object class, used by CTelephonyFunctions class.
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
|
|
21 |
/**
|
|
22 |
@file
|
|
23 |
*/
|
|
24 |
|
|
25 |
#include <etel.h>
|
|
26 |
#include <etelmm.h>
|
|
27 |
#include "Etel3rdParty.h"
|
|
28 |
|
|
29 |
const TInt KOneSecond = 1000000;
|
|
30 |
|
|
31 |
class CTelephony;
|
|
32 |
class CTelephonyFunctions; // forward reference
|
|
33 |
class CAsyncRequestBaseAct;
|
|
34 |
class MEventObserver;
|
|
35 |
|
|
36 |
/**
|
|
37 |
*/
|
|
38 |
class CDialNewCallAct : public CAsyncRequestBaseAct
|
|
39 |
{
|
|
40 |
|
|
41 |
public:
|
|
42 |
static CDialNewCallAct* NewL(CTelephonyFunctions* aTelephonyFunctions);
|
|
43 |
~CDialNewCallAct();
|
|
44 |
void DialNewCall(TDes8& aId,const CTelephony::TTelNumber& aTelNumber, CTelephony::TCallId& aCallId,
|
|
45 |
CTelephony::TCallId& aTempCallId);
|
|
46 |
|
|
47 |
protected:
|
|
48 |
void Complete();
|
|
49 |
TInt RunError(TInt aLeaveCode);
|
|
50 |
void DoCancel();
|
|
51 |
|
|
52 |
private:
|
|
53 |
CDialNewCallAct(CTelephonyFunctions* aTelephonyFunctions);
|
|
54 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
55 |
CTelephony::TCallId* iCallId;
|
|
56 |
CTelephony::TCallId iTempCallId;
|
|
57 |
CTelephony::TCallParamsV1* iISVcallParams;
|
|
58 |
RMobileCall::TEtel3rdPartyMobileCallParamsV1 iMMcallParams;
|
|
59 |
RMobileCall::TEtel3rdPartyMobileCallParamsV1Pckg iMMCallParamsPckg;
|
|
60 |
};
|
|
61 |
|
|
62 |
|
|
63 |
class CGetCallDynamicCapsAct : public CAsyncRequestBaseAct
|
|
64 |
/**
|
|
65 |
*/
|
|
66 |
{
|
|
67 |
|
|
68 |
public:
|
|
69 |
static CGetCallDynamicCapsAct* NewL(CTelephonyFunctions* aTelephonyFunctions);
|
|
70 |
~CGetCallDynamicCapsAct();
|
|
71 |
void GetCallDynamicCaps(TDes8* aId);
|
|
72 |
|
|
73 |
protected:
|
|
74 |
void Complete();
|
|
75 |
TInt RunError(TInt aLeaveCode);
|
|
76 |
void DoCancel();
|
|
77 |
|
|
78 |
private:
|
|
79 |
CGetCallDynamicCapsAct(CTelephonyFunctions* aTelephonyFunctions);
|
|
80 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
81 |
};
|
|
82 |
|
|
83 |
|
|
84 |
class CHoldAct : public CAsyncRequestBaseAct
|
|
85 |
/**
|
|
86 |
This is an active object responsible for interacting with Multimode ETel
|
|
87 |
*/
|
|
88 |
{
|
|
89 |
|
|
90 |
public:
|
|
91 |
static CHoldAct* NewL(CTelephonyFunctions* aTelephonyFunctions);
|
|
92 |
~CHoldAct();
|
|
93 |
void Hold(const CTelephony::TCallId& aCallId);
|
|
94 |
|
|
95 |
protected:
|
|
96 |
void Complete();
|
|
97 |
TInt RunError(TInt aLeaveCode);
|
|
98 |
void DoCancel();
|
|
99 |
|
|
100 |
private:
|
|
101 |
CHoldAct(CTelephonyFunctions* aTelephonyFunctions);
|
|
102 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
103 |
CTelephony::TCallId iCallId;
|
|
104 |
};
|
|
105 |
|
|
106 |
class CResumeAct : public CAsyncRequestBaseAct
|
|
107 |
/**
|
|
108 |
This is an active object responsible for interacting with Multimode ETel
|
|
109 |
*/
|
|
110 |
{
|
|
111 |
|
|
112 |
public:
|
|
113 |
static CResumeAct* NewL(CTelephonyFunctions* aTelephonyFunctions);
|
|
114 |
~CResumeAct();
|
|
115 |
void Resume(const CTelephony::TCallId& aCallId);
|
|
116 |
|
|
117 |
protected:
|
|
118 |
void Complete();
|
|
119 |
TInt RunError(TInt aLeaveCode);
|
|
120 |
void DoCancel();
|
|
121 |
|
|
122 |
private:
|
|
123 |
CResumeAct(CTelephonyFunctions* aTelephonyFunctions);
|
|
124 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
125 |
CTelephony::TCallId iCallId;
|
|
126 |
};
|
|
127 |
|
|
128 |
class CSwapAct : public CAsyncRequestBaseAct
|
|
129 |
/**
|
|
130 |
This is an active object responsible for interacting with Multimode ETel
|
|
131 |
*/
|
|
132 |
{
|
|
133 |
|
|
134 |
public:
|
|
135 |
static CSwapAct* NewL(CTelephonyFunctions* aTelephonyFunctions);
|
|
136 |
~CSwapAct();
|
|
137 |
void Swap(const CTelephony::TCallId& aCallId);
|
|
138 |
|
|
139 |
protected:
|
|
140 |
void Complete();
|
|
141 |
TInt RunError(TInt aLeaveCode);
|
|
142 |
void DoCancel();
|
|
143 |
|
|
144 |
private:
|
|
145 |
CSwapAct(CTelephonyFunctions* aTelephonyFunctions);
|
|
146 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
147 |
CTelephony::TCallId iCallId;
|
|
148 |
};
|
|
149 |
|
|
150 |
class CHangupAct : public CAsyncRequestBaseAct
|
|
151 |
/**
|
|
152 |
This is an active object responsible for interacting with Multimode ETel
|
|
153 |
*/
|
|
154 |
{
|
|
155 |
|
|
156 |
public:
|
|
157 |
static CHangupAct* NewL(CTelephonyFunctions* aTelephonyFunctions);
|
|
158 |
~CHangupAct();
|
|
159 |
void Hangup(const CTelephony::TCallId& aCallId);
|
|
160 |
|
|
161 |
protected:
|
|
162 |
void Complete();
|
|
163 |
TInt RunError(TInt aLeaveCode);
|
|
164 |
void DoCancel();
|
|
165 |
|
|
166 |
private:
|
|
167 |
CHangupAct(CTelephonyFunctions* aTelephonyFunctions);
|
|
168 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
169 |
CTelephony::TCallId iCallId;
|
|
170 |
};
|
|
171 |
|
|
172 |
class CAnswerIncomingCallAct : public CAsyncRequestBaseAct, public MEventObserver
|
|
173 |
/**
|
|
174 |
This is an active object responsible for interacting with Multimode ETel
|
|
175 |
*/
|
|
176 |
{
|
|
177 |
|
|
178 |
public:
|
|
179 |
static CAnswerIncomingCallAct* NewL(CTelephonyFunctions* aTelephonyFunctions, MIncomingCallNameSubject& aIncomingCallNameSubject, RArray<RMobileCall>& aCallPool, RArray<CTelephonyFunctions::TCallPoolOperation>& aCallPoolStatus);
|
|
180 |
~CAnswerIncomingCallAct();
|
|
181 |
void AnswerIncomingCall(CTelephony::TCallId& aCallId, CTelephony::TCallId& aTempCallId);
|
|
182 |
|
|
183 |
// Implementation of pure virtual function in MEventObserver.
|
|
184 |
void EventCompleted();
|
|
185 |
|
|
186 |
protected:
|
|
187 |
void Complete();
|
|
188 |
TInt RunError(TInt aLeaveCode);
|
|
189 |
void DoCancel();
|
|
190 |
|
|
191 |
private:
|
|
192 |
CAnswerIncomingCallAct(CTelephonyFunctions* aTelephonyFunctions, MIncomingCallNameSubject& aIncomingCallNameSubject, RArray<RMobileCall>& aCallPool, RArray<CTelephonyFunctions::TCallPoolOperation>& aCallPoolStatus);
|
|
193 |
void ConstructL();
|
|
194 |
|
|
195 |
CTelephony::TCallId* iCallId;
|
|
196 |
CTelephony::TCallId iTempCallId;
|
|
197 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
198 |
RMobileCall::TEtel3rdPartyMobileCallParamsV1 iMMcallParams;
|
|
199 |
RMobileCall::TEtel3rdPartyMobileCallParamsV1Pckg iMMCallParamsPckg;
|
|
200 |
|
|
201 |
/**
|
|
202 |
The state a CAnswerIncomingCallAct object is in.
|
|
203 |
*/
|
|
204 |
enum TAnswerIncomingCallState
|
|
205 |
{
|
|
206 |
/** Idle. Default state when a CAnswerIncomingCallAct object is created. */
|
|
207 |
EAnswerIncomingCallStateIdle,
|
|
208 |
/** Answering an incoming call. Enters this state when the line status is ringing and there is a valid call name stored in CNotifyIncomingCallAct object. */
|
|
209 |
EAnswerIncomingCallStateAnswering,
|
|
210 |
/** Waiting for CNotifyIncomingCallAct::NotifyIncomingCall() to complete. */
|
|
211 |
EAnswerIncomingCallStateWaiting
|
|
212 |
};
|
|
213 |
|
|
214 |
/**
|
|
215 |
State this active object is currently in.
|
|
216 |
*/
|
|
217 |
TAnswerIncomingCallState iState;
|
|
218 |
/**
|
|
219 |
Timer object used to wait for NotifyIncomingCall to complete.
|
|
220 |
*/
|
|
221 |
RTimer iTimer;
|
|
222 |
/**
|
|
223 |
Reference to active object owned by iTelephonyFunctions
|
|
224 |
which implements MIncomingCallNameSubject interface.
|
|
225 |
Allows this AO to retrieve the call name of an incoming call.
|
|
226 |
*/
|
|
227 |
MIncomingCallNameSubject& iIncomingCallNameSubject;
|
|
228 |
/**
|
|
229 |
Reference to the call pool array owned by iTelephonyFunctions.
|
|
230 |
*/
|
|
231 |
RArray<RMobileCall>& iCallPool;
|
|
232 |
/**
|
|
233 |
Reference to the call pool status array owned by iTelephonyFunctions.
|
|
234 |
*/
|
|
235 |
RArray<CTelephonyFunctions::TCallPoolOperation>& iCallPoolStatus;
|
|
236 |
|
|
237 |
};
|
|
238 |
|
|
239 |
class CNotifyCallStatusAct : public CAsyncRequestBaseAct
|
|
240 |
/**
|
|
241 |
This is an active object responsible for interacting with Multimode ETel
|
|
242 |
*/
|
|
243 |
{
|
|
244 |
|
|
245 |
public:
|
|
246 |
static CNotifyCallStatusAct* NewL(CTelephonyFunctions* aTelephonyFunctions, CTelephonyFunctions::TOperations aPendingOperation);
|
|
247 |
~CNotifyCallStatusAct();
|
|
248 |
void NotifyCallStatus(TDes8& aId, const CTelephony::TCallId& aCallId);
|
|
249 |
|
|
250 |
protected:
|
|
251 |
void Complete();
|
|
252 |
TInt RunError(TInt aLeaveCode);
|
|
253 |
void DoCancel();
|
|
254 |
|
|
255 |
private:
|
|
256 |
CNotifyCallStatusAct(CTelephonyFunctions* aTelephonyFunctions, CTelephonyFunctions::TOperations aPendingOperation);
|
|
257 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
258 |
CTelephony::TCallStatusV1* iISVCallStatus;
|
|
259 |
RMobileCall:: TMobileCallStatus iMMCallStatus;
|
|
260 |
CTelephony::TCallId iCallId;
|
|
261 |
CTelephonyFunctions::TOperations iPendingOperation;
|
|
262 |
};
|
|
263 |
|
|
264 |
class CNotifyRemotePartyInfoAct : public CAsyncRequestBaseAct
|
|
265 |
/**
|
|
266 |
This is an active object responsible for interacting with Multimode ETel
|
|
267 |
*/
|
|
268 |
{
|
|
269 |
|
|
270 |
public:
|
|
271 |
static CNotifyRemotePartyInfoAct* NewL(CTelephonyFunctions* aTelephonyFunctions, CTelephonyFunctions::TOperations aPendingOperation);
|
|
272 |
~CNotifyRemotePartyInfoAct();
|
|
273 |
void NotifyRemotePartyInfo(TDes8& aId, const CTelephony::TCallId& aCallId);
|
|
274 |
|
|
275 |
protected:
|
|
276 |
void Complete();
|
|
277 |
TInt RunError(TInt aLeaveCode);
|
|
278 |
void DoCancel();
|
|
279 |
|
|
280 |
private:
|
|
281 |
CNotifyRemotePartyInfoAct(CTelephonyFunctions* aTelephonyFunctions, CTelephonyFunctions::TOperations aPendingOperation);
|
|
282 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
283 |
CTelephony::TRemotePartyInfoV1* iISVRemotePartyInfo;
|
|
284 |
RMobileCall::TMobileCallRemotePartyInfoV1 iMMRemotePartyInfo;
|
|
285 |
RMobileCall::TMobileCallRemotePartyInfoV1Pckg iMMRemotePartyInfoPckg;
|
|
286 |
CTelephony::TCallId iCallId;
|
|
287 |
CTelephonyFunctions::TOperations iPendingOperation;
|
|
288 |
};
|
|
289 |
|
|
290 |
/**
|
|
291 |
This is an active object responsible for interacting with Multimode
|
|
292 |
ETel.
|
|
293 |
|
|
294 |
This active object is owned by the CTelephonyFunctions object and
|
|
295 |
continuously monitors for the the NotifyIncomingCall event.
|
|
296 |
When an incoming call arrives, this AO stores the call
|
|
297 |
name and sends a notification of an incoming call to any observers
|
|
298 |
that want to be notified of this event.
|
|
299 |
|
|
300 |
One of the observers of this AO is CAnswerIncomingCallAct.
|
|
301 |
If a client requests to answer an incoming call, the request is only
|
|
302 |
passed on to the tsy (by CAnswerIncomingCallAct) if this AO has sent
|
|
303 |
the notification of an incoming call to it (and has a valid call name
|
|
304 |
available). This ensures that an attempt to answer a call before the
|
|
305 |
call object has been created is not made since the call object is
|
|
306 |
only guaranteed to exist when an incoming call notification has been
|
|
307 |
sent.
|
|
308 |
*/
|
|
309 |
class CNotifyIncomingCallAct : public CAsyncRequestBaseAct, public MIncomingCallNameSubject
|
|
310 |
{
|
|
311 |
public:
|
|
312 |
static CNotifyIncomingCallAct* NewL(CTelephonyFunctions* aTelephonyFunctions);
|
|
313 |
~CNotifyIncomingCallAct();
|
|
314 |
void NotifyIncomingCall();
|
|
315 |
|
|
316 |
void ResetCallName();
|
|
317 |
TInt CallName(TName&) const;
|
|
318 |
|
|
319 |
void RegisterObserver(MEventObserver* aObserver);
|
|
320 |
void DeregisterObserver(MEventObserver* aObserver);
|
|
321 |
|
|
322 |
protected:
|
|
323 |
void Complete();
|
|
324 |
TInt RunError(/*TInt aLeaveCode*/);
|
|
325 |
void DoCancel();
|
|
326 |
|
|
327 |
private:
|
|
328 |
CNotifyIncomingCallAct(CTelephonyFunctions* aTelephonyFunctions);
|
|
329 |
/**
|
|
330 |
Pointer to the CTelephonyFunctions object which owns this object.
|
|
331 |
*/
|
|
332 |
CTelephonyFunctions* iTelephonyFunctions;
|
|
333 |
/**
|
|
334 |
Stores the call name retrieved from the completion of RLine::NotifyIncomingCall().
|
|
335 |
Empty when there is no incoming call.
|
|
336 |
*/
|
|
337 |
TName iCallName;
|
|
338 |
/**
|
|
339 |
Stores pointers to objects which want to be notified when this
|
|
340 |
object completes.
|
|
341 |
*/
|
|
342 |
RPointerArray<MEventObserver> iIncomingCallCompletionObservers;
|
|
343 |
/**
|
|
344 |
Possible states that CNotifyIncomingCallAct can be in.
|
|
345 |
*/
|
|
346 |
enum TNotifyIncomingCallActState
|
|
347 |
{
|
|
348 |
ENotifyIncomingCallActStateOperating,
|
|
349 |
ENotifyIncomingCallActStateCleanUp
|
|
350 |
};
|
|
351 |
/**
|
|
352 |
The current state of this active object.
|
|
353 |
*/
|
|
354 |
TNotifyIncomingCallActState iState;
|
|
355 |
};
|
|
356 |
|