|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalAll |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef __CALL_H__ |
|
23 #define __CALL_H__ |
|
24 |
|
25 #include <et_phone.h> |
|
26 #include "TSYCONFG.H" |
|
27 #include "ATBASE.H" |
|
28 #include "faxstd.h" |
|
29 #include <f32file.h> |
|
30 // |
|
31 // CAcquireEntry |
|
32 // |
|
33 class CAcquireOwnerList; |
|
34 class CFaxSharedFileHandles; |
|
35 class CAcquireEntry : public CBase |
|
36 /** |
|
37 @internalComponent |
|
38 */ |
|
39 { |
|
40 public: |
|
41 static CAcquireEntry* NewL(const TTsyReqHandle aTsyReqHandle); |
|
42 CAcquireEntry(const TTsyReqHandle aTsyReqHandle); |
|
43 ~CAcquireEntry(); |
|
44 void Deque(); |
|
45 public: |
|
46 TTsyReqHandle iTsyReqHandle; |
|
47 private: |
|
48 TDblQueLink iLink; |
|
49 friend class CAcquireOwnerList; |
|
50 }; |
|
51 |
|
52 // |
|
53 // CAcquireOwnerList |
|
54 // |
|
55 class CAcquireOwnerList : public CBase |
|
56 /** |
|
57 @internalComponent |
|
58 */ |
|
59 { |
|
60 public: |
|
61 static CAcquireOwnerList* NewL(); |
|
62 CAcquireOwnerList(); |
|
63 ~CAcquireOwnerList(); |
|
64 void ConstructL(); |
|
65 CAcquireEntry* FindByTsyReqHandle(const TTsyReqHandle aTsyReqHandle); |
|
66 void Remove(CAcquireEntry* aEntry); |
|
67 public: |
|
68 TDblQue<CAcquireEntry> iAcquireList; |
|
69 }; |
|
70 |
|
71 class CCallHayes; |
|
72 class CHeartbeatRunner : public CBase, public MBeating |
|
73 /** |
|
74 @internalComponent |
|
75 */ |
|
76 { |
|
77 public: |
|
78 static CHeartbeatRunner* NewL(CCallHayes* aCallHayes,CNotifications* aNotificationStore); |
|
79 ~CHeartbeatRunner(); |
|
80 TTimeIntervalSeconds CallDuration() const; |
|
81 void Start(); |
|
82 void Stop(); |
|
83 protected: |
|
84 CHeartbeatRunner(CCallHayes* aCallHayes,CNotifications* aNotificationStore); |
|
85 private: |
|
86 void ConstructL(); |
|
87 // functions for MBeating protocol |
|
88 void Beat(); // called when beat works ok |
|
89 void Synchronize(); // called when we need to synchronize |
|
90 private: |
|
91 TTime iStartTime; |
|
92 CHeartbeat* iHeartbeat; |
|
93 TInt iTicks; |
|
94 CCallHayes* iCallHayes; |
|
95 CNotifications* iNotificationStore; |
|
96 }; |
|
97 |
|
98 // |
|
99 // CCallHayes - General Call Functionality |
|
100 // |
|
101 |
|
102 class CATHangUp; |
|
103 class CATAnswerData; |
|
104 class CATConnectData; |
|
105 class CATQuickInit; |
|
106 class CATWaitForNoCarrier; |
|
107 class CCallHayes : public CCallBase |
|
108 /** |
|
109 @internalComponent |
|
110 */ |
|
111 { |
|
112 public: |
|
113 CCallHayes(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals); |
|
114 void ConstructL(const TName& aName); |
|
115 ~CCallHayes(); |
|
116 virtual void Init(); |
|
117 virtual TInt RegisterNotification(const TInt aIpc); |
|
118 virtual TInt DeregisterNotification(const TInt aIpc); |
|
119 static void CloseCall(TAny* aObj); |
|
120 virtual CTelObject::TReqMode ReqModeL(const TInt aIpc); |
|
121 // MCallBaseTSY pure virtuals |
|
122 virtual TInt GetInfo(const TTsyReqHandle aTsyReqHandle,RCall::TCallInfo* aCallInfo); |
|
123 virtual TInt NotifyCapsChange(const TTsyReqHandle aTsyReqHandle,RCall::TCaps* aCaps); |
|
124 virtual TInt NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
125 virtual TInt NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus); |
|
126 virtual TInt NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
127 virtual TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus); |
|
128 virtual TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
129 virtual TInt NotifyDurationChange(const TTsyReqHandle aTsyReqHandle,TTimeIntervalSeconds* aTime); |
|
130 virtual TInt NotifyDurationChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
131 virtual TInt LoanDataPort(const TTsyReqHandle aTsyReqHandle,RCall::TCommPort* aCommPort); |
|
132 virtual TInt LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle); |
|
133 virtual TInt RecoverDataPort(const TTsyReqHandle aTsyReqHandle); |
|
134 virtual TInt RecoverDataPortAndRelinquishOwnership(); |
|
135 virtual TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aCallStatus); |
|
136 virtual TInt TransferOwnership(const TTsyReqHandle aTsyReqHandle); |
|
137 virtual TInt AcquireOwnership(const TTsyReqHandle aTsyReqHandle); |
|
138 virtual TInt AcquireOwnershipCancel(const TTsyReqHandle aTsyReqHandle); |
|
139 virtual TInt GetBearerServiceInfo(const TTsyReqHandle aTsyReqHandle,RCall::TBearerService* aService); |
|
140 virtual TInt GetCallParams(const TTsyReqHandle aTsyReqHandle, TDes8* aParams); |
|
141 virtual TInt GetCallDuration(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime); |
|
142 virtual TInt GetFaxSettings(const TTsyReqHandle aTsyReqHandle,RCall::TFaxSessionSettings* aSettings); |
|
143 virtual TInt SetFaxSettings(const TTsyReqHandle aTsyReqHandle,const RCall::TFaxSessionSettings* aSettings); |
|
144 |
|
145 // MTelObjectTSY pure virtuals |
|
146 virtual CTelObject* OpenNewObjectByNameL(const TDesC&); |
|
147 virtual CTelObject* OpenNewObjectL(TDes& aNewName); |
|
148 virtual TInt CheckAndSetRegistrationParams(const TInt aIpc,const TDes8* aDes1,const TDes8* aDes2); |
|
149 |
|
150 |
|
151 // MSubSessionExtBaseTSY pure virtual |
|
152 virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage); |
|
153 |
|
154 // own pure virtual |
|
155 virtual void AnswerImmediately()=0; |
|
156 |
|
157 // other funtions |
|
158 RCall::TStatus GetCoreCallStatus(); |
|
159 TInt ChangeCallStatus(RMobileCall::TMobileCallStatus aCallStatus); |
|
160 void ChangeLineStatus(RCall::TStatus aLineStatus); |
|
161 void SetToIdle(); |
|
162 void SetToIdleAndCompleteReq(TTsyReqHandle aTsyReqHandle,TInt aStatus); |
|
163 TCallInfoTSY* CallInfo(); |
|
164 void GetCallInfo(TCallInfoIndex* aCallInfoIndex); |
|
165 TBool CheckName(const TDesC& aName) const; |
|
166 void GetCallDuration(TTimeIntervalSeconds& aTime) const; |
|
167 void StartCallTicker() const; |
|
168 void StopCallTicker() const; |
|
169 void ResetIsForIncomingCall(); |
|
170 TBool IsForIncomingCall() const; |
|
171 void SetOwnedByTSY(); |
|
172 void SetUnownedByTSY(); |
|
173 TBool IsOwnedByTSY() const; |
|
174 virtual TBool CollateCurrentMobileCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)=0; |
|
175 virtual TBool CollateCurrentCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)=0; |
|
176 |
|
177 protected: |
|
178 void SetCallParams(const TDesC8* aParams); |
|
179 void GetDefaultCallParams(); |
|
180 TInt ValidateRequest(const TTsyReqHandle aTsyReqHandle, RCall::TStatus aLineStatus); |
|
181 |
|
182 public: |
|
183 CPhoneGlobals* iPhoneGlobals; |
|
184 CATWaitForNoCarrier* iWaitForNoCarrier; |
|
185 protected: |
|
186 TCallInfoTSY iCallInfo; |
|
187 CATIO* iIo; |
|
188 CATInit* iInit; |
|
189 CATQuickInit* iQuickInit; |
|
190 CAcquireOwnerList* iList; |
|
191 CHeartbeatRunner* iCallTimer; |
|
192 TBool iIsForIncomingCall; |
|
193 TBool iIsOwnedByTSY; |
|
194 TTsyReqHandle iAnswerTsyReqHandle; |
|
195 RMobileCall::TMobileCallCapsV1 iMobileCaps; |
|
196 RCall::TCaps iCaps; |
|
197 }; |
|
198 |
|
199 |
|
200 // |
|
201 // CCallMobile - Call functionality for mobile phones |
|
202 // |
|
203 class CCallMobile : public CCallHayes |
|
204 /** |
|
205 @internalComponent |
|
206 */ |
|
207 { |
|
208 public: |
|
209 CCallMobile(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aGlobals); |
|
210 ~CCallMobile(); |
|
211 |
|
212 virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage); |
|
213 virtual TInt CancelService(const TInt aIpc,const TTsyReqHandle aTsyReqHandle); |
|
214 virtual TReqMode ReqModeL(const TInt aIpc); |
|
215 virtual TInt NumberOfSlotsL(const TInt aIpc); |
|
216 |
|
217 private: |
|
218 virtual TInt GetCaps(const TTsyReqHandle aTsyReqHandle,RCall::TCaps* aCaps); |
|
219 |
|
220 // ETELMM supported requests |
|
221 TInt GetMobileCallCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps); |
|
222 TInt NotifyMobileCallCapsChange(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps); |
|
223 TInt NotifyMobileCallCapsChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
224 |
|
225 TInt GetMobileCallStatus(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aStatus); |
|
226 TInt NotifyMobileCallStatusChange(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aStatus); |
|
227 TInt NotifyMobileCallStatusChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
228 |
|
229 virtual void CollateCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)=0; |
|
230 virtual TBool CollateCurrentMobileCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps); |
|
231 virtual TBool CollateCurrentCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps); |
|
232 }; |
|
233 |
|
234 |
|
235 |
|
236 //Added for Java Demo 4.4.99 |
|
237 // |
|
238 // CCallMobileVoice - Specific Voice Call Functionality |
|
239 // |
|
240 class CATDialVoice; |
|
241 class CATHangUpVoice; |
|
242 class CATAnswerVoice; |
|
243 class CCallMobileVoice : public CCallMobile |
|
244 /** |
|
245 @internalComponent |
|
246 */ |
|
247 { |
|
248 public: |
|
249 static CCallMobileVoice* NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName); |
|
250 CCallMobileVoice(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aGlobals); |
|
251 ~CCallMobileVoice(); |
|
252 |
|
253 // MCallBaseTSY pure virtuals |
|
254 virtual TInt RecoverDataPortAndRelinquishOwnership(); |
|
255 // |
|
256 virtual TInt LoanDataPort(const TTsyReqHandle aTsyReqHandle,RCall::TCommPort* aCommPort); |
|
257 virtual TInt LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle); |
|
258 virtual TInt RecoverDataPort(const TTsyReqHandle aTsyReqHandle); |
|
259 virtual TInt Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber); |
|
260 virtual TInt DialCancel(const TTsyReqHandle aTsyReqHandle); |
|
261 virtual TInt Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams); |
|
262 virtual TInt ConnectCancel(const TTsyReqHandle aTsyReqHandle); |
|
263 virtual TInt AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams); |
|
264 virtual TInt AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle); |
|
265 virtual TInt HangUp(const TTsyReqHandle aTsyReqHandle); |
|
266 virtual TInt HangUpCancel(const TTsyReqHandle aTsyReqHandle); |
|
267 virtual TInt RelinquishOwnership(); |
|
268 |
|
269 virtual void AnswerImmediately(); |
|
270 virtual void CollateCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps); |
|
271 |
|
272 protected: |
|
273 void ConstructL(const TName& aName); |
|
274 |
|
275 private: |
|
276 CATDialVoice* iDialVoice; |
|
277 CATAnswerVoice* iAnswerVoice; |
|
278 CATHangUpVoice* iHangUpVoice; |
|
279 }; |
|
280 |
|
281 // |
|
282 // CCallMobileData - Specific Data Call Functionality |
|
283 // |
|
284 class CATDialData; |
|
285 class CATHangUpData; |
|
286 class CATSetToOnlineDataMode; |
|
287 class CATSetCBST; |
|
288 class CCallMobileData : public CCallMobile |
|
289 /** |
|
290 @internalComponent |
|
291 */ |
|
292 { |
|
293 public: |
|
294 static CCallMobileData* NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName); |
|
295 CCallMobileData(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aGlobals); |
|
296 ~CCallMobileData(); |
|
297 |
|
298 // MCallBaseTSY pure virtuals |
|
299 virtual TInt RecoverDataPortAndRelinquishOwnership(); |
|
300 // |
|
301 virtual TInt LoanDataPort(const TTsyReqHandle aTsyReqHandle,RCall::TCommPort* aCommPort); |
|
302 virtual TInt LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle); |
|
303 virtual TInt RecoverDataPort(const TTsyReqHandle aTsyReqHandle); |
|
304 virtual TInt Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber); |
|
305 virtual TInt DialCancel(const TTsyReqHandle aTsyReqHandle); |
|
306 virtual TInt Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams); |
|
307 virtual TInt ConnectCancel(const TTsyReqHandle aTsyReqHandle); |
|
308 virtual TInt AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams); |
|
309 virtual TInt AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle); |
|
310 virtual TInt HangUp(const TTsyReqHandle aTsyReqHandle); |
|
311 virtual TInt HangUpCancel(const TTsyReqHandle aTsyReqHandle); |
|
312 virtual TInt RelinquishOwnership(); |
|
313 |
|
314 // CCallHayes pure virtual |
|
315 virtual void AnswerImmediately(); |
|
316 |
|
317 virtual void CollateCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps); |
|
318 |
|
319 // Utility function used by objects created by this class |
|
320 // (this has been done to reduce code size). |
|
321 TInt AssembleCBSTSetString(TBuf8<KGenericBufferSize>& aTxBuffer); |
|
322 |
|
323 protected: |
|
324 void ConstructL(const TName& aName); |
|
325 virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage); |
|
326 |
|
327 private: |
|
328 // Utility functions |
|
329 void SetDataCallParams(const TDesC8* aCallParams); |
|
330 TInt GetMobileDataCallCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps); |
|
331 |
|
332 private: |
|
333 CATSetCBST* iSetCBST; |
|
334 CATDialData* iDialData; |
|
335 CATAnswerData* iAnswerData; |
|
336 CATConnectData* iConnectData; |
|
337 CATHangUpData* iHangUpData; |
|
338 CATSetToOnlineDataMode* iATSetToOnlineDataMode; |
|
339 }; |
|
340 |
|
341 class CATDialFax; |
|
342 class CATConnectFax; |
|
343 class CATAnswerFax; |
|
344 class CATHangUpFax; |
|
345 class CFaxHayes; |
|
346 class CFaxSession; // the class defined by the fax server |
|
347 class CFaxCompletion; |
|
348 class CCallMobileFax : public CCallMobile |
|
349 /** |
|
350 @internalComponent |
|
351 */ |
|
352 { |
|
353 public: |
|
354 static CCallMobileFax* NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName); |
|
355 CCallMobileFax(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aGlobals); |
|
356 ~CCallMobileFax(); |
|
357 |
|
358 // MTelObjectTSY pure virtual |
|
359 virtual CTelObject* OpenNewObjectByNameL(const TDesC&); |
|
360 |
|
361 // MCallBaseTSY pure virtuals |
|
362 virtual TInt Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber); |
|
363 virtual TInt DialCancel(const TTsyReqHandle aTsyReqHandle); |
|
364 virtual TInt Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams); |
|
365 virtual TInt ConnectCancel(const TTsyReqHandle aTsyReqHandle); |
|
366 virtual TInt AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams); |
|
367 virtual TInt AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle); |
|
368 virtual TInt HangUp(const TTsyReqHandle aTsyReqHandle); |
|
369 virtual TInt HangUpCancel(const TTsyReqHandle aTsyReqHandle); |
|
370 virtual TInt RelinquishOwnership(); |
|
371 virtual TInt GetFaxSettings(const TTsyReqHandle aTsyReqHandle,RCall::TFaxSessionSettings* aSettings); |
|
372 virtual TInt SetFaxSettings(const TTsyReqHandle aTsyReqHandle,const RCall::TFaxSessionSettings* aSettings); |
|
373 virtual TInt SetFaxSharedHeaderFile(const TTsyReqHandle aTsyReqHandle, CFaxSharedFileHandles* aFaxSharedFileHandles); |
|
374 // CCallHayes pure virtual |
|
375 virtual void AnswerImmediately(); |
|
376 |
|
377 virtual void CollateCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps); |
|
378 |
|
379 TInt FaxConnectHandler(const TTsyReqHandle aTsyReqHandle); |
|
380 TInt ValidateFaxClass(TFaxClass& aFaxClass); |
|
381 void FaxCancelCommand(const TTsyReqHandle aTsyReqHandle); |
|
382 void FaxDial(const TTsyReqHandle aTsyReqHandle,TDesC* aTelNumber); |
|
383 void FaxConnect(const TTsyReqHandle aTsyReqHandle); |
|
384 void FaxAnswer(const TTsyReqHandle aTsyReqHandle); |
|
385 void FaxHangUp(const TTsyReqHandle aTsyReqHandle); |
|
386 |
|
387 TInt OpenFax(TDesC* aTelNumber,TFaxMode aFaxMode); |
|
388 void GetFaxBaseL(); |
|
389 void RemoveFax(CFaxHayes* aFaxHayes); |
|
390 void CleanUpFaxServer(); |
|
391 private: |
|
392 void ConstructL(const TName& aName); |
|
393 public: |
|
394 CFaxSession* iFaxSession; |
|
395 private: |
|
396 CATDialFax* iDialFax; |
|
397 CATConnectFax* iConnectFax; |
|
398 CATAnswerFax* iAnswerFax; |
|
399 CATHangUpFax* iHangUpFax; |
|
400 RCall::TFaxSessionSettings iFaxSettings; |
|
401 CFaxHayes* iFax; |
|
402 CFaxCompletion* iFaxCompletion; |
|
403 RLibrary iFaxServerLib; |
|
404 RFax::TProgress* iFaxProgress; |
|
405 CFaxSharedFileHandles* iFileHandles; |
|
406 }; |
|
407 |
|
408 |
|
409 #endif |