24
|
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 |
#ifndef __DSTD_ACQUIRE_H
|
|
22 |
#define __DSTD_ACQUIRE_H
|
|
23 |
|
|
24 |
#include <e32base.h>
|
|
25 |
#include "ET_PHONE.H"
|
|
26 |
|
|
27 |
/**
|
|
28 |
@internalComponent
|
|
29 |
*/
|
|
30 |
enum TTsyPanic
|
|
31 |
{
|
|
32 |
KTsyPanicDataCorrupted,
|
|
33 |
KTsyPanicNotRecognisedCancelHandle,
|
|
34 |
KTsyPanicUnexpectedReturnValue
|
|
35 |
};
|
|
36 |
/**
|
|
37 |
@internalComponent
|
|
38 |
*/
|
|
39 |
void TsyPanic(TTsyPanic aPanic);
|
|
40 |
|
|
41 |
class CPhoneFactoryDummyBase;
|
|
42 |
class TTsyTimer
|
|
43 |
/**
|
|
44 |
@internalComponent
|
|
45 |
*/
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
TTsyTimer();
|
|
49 |
TBool iPending;
|
|
50 |
TDeltaTimerEntry iEntry;
|
|
51 |
TTsyReqHandle iTsyReqHandle;
|
|
52 |
};
|
|
53 |
|
|
54 |
//
|
|
55 |
// CAcquireEntry
|
|
56 |
//
|
|
57 |
class CAcquireOwnerList;
|
|
58 |
class CAcquireEntry : public CBase
|
|
59 |
/**
|
|
60 |
@internalTechnology
|
|
61 |
*/
|
|
62 |
{
|
|
63 |
public:
|
|
64 |
static CAcquireEntry* NewL(const TTsyReqHandle aTsyReqHandle);
|
|
65 |
CAcquireEntry(const TTsyReqHandle aTsyReqHandle);
|
|
66 |
~CAcquireEntry();
|
|
67 |
void Deque();
|
|
68 |
public:
|
|
69 |
TTsyReqHandle iTsyReqHandle;
|
|
70 |
private:
|
|
71 |
TDblQueLink iLink;
|
|
72 |
friend class CAcquireOwnerList;
|
|
73 |
};
|
|
74 |
|
|
75 |
//
|
|
76 |
// CAcquireOwnerList
|
|
77 |
//
|
|
78 |
class CAcquireOwnerList : public CBase
|
|
79 |
/**
|
|
80 |
@internalTechnology
|
|
81 |
*/
|
|
82 |
{
|
|
83 |
public:
|
|
84 |
static CAcquireOwnerList* NewL();
|
|
85 |
CAcquireOwnerList();
|
|
86 |
~CAcquireOwnerList();
|
|
87 |
void ConstructL();
|
|
88 |
CAcquireEntry* FindByTsyReqHandle(const TTsyReqHandle aTsyReqHandle);
|
|
89 |
void Remove(CAcquireEntry* aEntry);
|
|
90 |
TDblQue<CAcquireEntry> iAcquireList;
|
|
91 |
};
|
|
92 |
|
|
93 |
//
|
|
94 |
// CFaxDummyBase
|
|
95 |
//
|
|
96 |
class CFaxDummyBase : public CFaxBase
|
|
97 |
/**
|
|
98 |
@internalTechnology
|
|
99 |
*/
|
|
100 |
{
|
|
101 |
public:
|
|
102 |
CFaxDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
103 |
~CFaxDummyBase();
|
|
104 |
virtual TInt RegisterNotification(const TInt aIpc);
|
|
105 |
virtual TInt DeregisterNotification(const TInt aIpc);
|
|
106 |
virtual CTelObject::TReqMode ReqModeL(const TInt aIpc);
|
|
107 |
virtual TInt Read(const TTsyReqHandle aTsyReqHandle,TDes8* aDes);
|
|
108 |
virtual TInt Write(const TTsyReqHandle aTsyReqHandle,TDesC8* aDes);
|
|
109 |
virtual TInt WaitForEndOfPage(const TTsyReqHandle aTsyReqHandle);
|
|
110 |
virtual TInt TerminateFaxSession(const TTsyReqHandle aTsyReqHandle);
|
|
111 |
virtual TInt GetProgress(const TTsyReqHandle aTsyReqHandle,RFax::TProgress* aProgress);
|
|
112 |
virtual TInt ProgressNotification(const TTsyReqHandle aTsyReqHandle, RFax::TProgress* aProgress);
|
|
113 |
virtual TInt ProgressNotificationCancel(const TTsyReqHandle aTsyReqHandle);
|
|
114 |
public:
|
|
115 |
static TInt WaitForEndOfPageHandler(TAny* aPtr);
|
|
116 |
static TInt ReadHandler(TAny* aPtr);
|
|
117 |
static TInt WriteHandler(TAny* aPtr);
|
|
118 |
static TInt ProgressNotificationHandler(TAny* aPtr);
|
|
119 |
private:
|
|
120 |
static CFaxDummyBase* This(TAny* aPtr);
|
|
121 |
CPhoneFactoryDummyBase* iFac;
|
|
122 |
TTsyTimer iRead;
|
|
123 |
TTsyTimer iWrite;
|
|
124 |
TTsyTimer iWaitForEndOfPage;
|
|
125 |
TTsyTimer iProgressNotification;
|
|
126 |
|
|
127 |
TDes8* iReadParams;
|
|
128 |
RFax::TProgress* iProgressNotificationParams;
|
|
129 |
};
|
|
130 |
|
|
131 |
//
|
|
132 |
// CCallDummyBase
|
|
133 |
//
|
|
134 |
class CCallDummyBase : public CCallBase
|
|
135 |
/**
|
|
136 |
@internalTechnology
|
|
137 |
*/
|
|
138 |
{
|
|
139 |
public:
|
|
140 |
CCallDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
141 |
void ConstructL();
|
|
142 |
~CCallDummyBase();
|
|
143 |
virtual TInt RegisterNotification(const TInt aIpc);
|
|
144 |
virtual TInt DeregisterNotification(const TInt aIpc);
|
|
145 |
virtual TInt TransferOwnership(const TTsyReqHandle aTsyReqHandle);
|
|
146 |
virtual TInt AcquireOwnership(const TTsyReqHandle aTsyReqHandle);
|
|
147 |
virtual TInt AcquireOwnershipCancel(const TTsyReqHandle aTsyReqHandle);
|
|
148 |
virtual TInt RelinquishOwnership();
|
|
149 |
virtual TInt CancelSubSession();
|
|
150 |
// virtual CTelObject::TReqMode ReqModeL(TInt aIpc);
|
|
151 |
// Core
|
|
152 |
static TInt NotifyCapsChangeHandler(TAny* aPtr);
|
|
153 |
static TInt NotifyDurationChangeHandler(TAny* aPtr);
|
|
154 |
static TInt NotifyHookChangeHandler(TAny* aPtr);
|
|
155 |
static TInt NotifyStatusChangeHandler(TAny* aPtr);
|
|
156 |
static TInt LoanDataPortHandler(TAny* aPtr);
|
|
157 |
static TInt DialHandler(TAny* aPtr);
|
|
158 |
static TInt ConnectHandler(TAny* aPtr);
|
|
159 |
static TInt AnswerHandler(TAny* aPtr);
|
|
160 |
static TInt HangUpHandler(TAny* aPtr);
|
|
161 |
|
|
162 |
virtual TInt GetInfo(const TTsyReqHandle aTsyReqHandle, RCall::TCallInfo* aCallInfo);
|
|
163 |
virtual TInt NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RCall::TCaps* aCaps);
|
|
164 |
virtual TInt NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
165 |
virtual TInt NotifyDurationChange(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime);
|
|
166 |
virtual TInt NotifyDurationChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
167 |
virtual TInt NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus);
|
|
168 |
virtual TInt NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
169 |
virtual TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus);
|
|
170 |
virtual TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
171 |
virtual TInt LoanDataPort(const TTsyReqHandle aTsyReqHandle,RCall::TCommPort*);
|
|
172 |
virtual TInt LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle);
|
|
173 |
virtual TInt RecoverDataPort(const TTsyReqHandle aTsyReqHandle);
|
|
174 |
virtual TInt RecoverDataPortAndRelinquishOwnership();
|
|
175 |
virtual TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus*);
|
|
176 |
virtual TInt GetCaps(const TTsyReqHandle aTsyReqHandle,RCall::TCaps* aCaps);
|
|
177 |
virtual TInt Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber);
|
|
178 |
virtual TInt Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams);
|
|
179 |
virtual TInt AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams);
|
|
180 |
virtual TInt HangUp(const TTsyReqHandle aTsyReqHandle);
|
|
181 |
virtual TInt GetBearerServiceInfo(const TTsyReqHandle aTsyReqHandle,RCall::TBearerService*);
|
|
182 |
virtual TInt DialCancel(const TTsyReqHandle aTsyReqHandle);
|
|
183 |
virtual TInt ConnectCancel(const TTsyReqHandle aTsyReqHandle);
|
|
184 |
virtual TInt AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle);
|
|
185 |
virtual TInt HangUpCancel(const TTsyReqHandle aTsyReqHandle);
|
|
186 |
virtual TInt GetCallParams(const TTsyReqHandle aTsyReqHandle, TDes8* aParams);
|
|
187 |
virtual TInt GetCallDuration(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime);
|
|
188 |
virtual TInt GetFaxSettings(const TTsyReqHandle aTsyReqHandle,RCall::TFaxSessionSettings* aSettings);
|
|
189 |
virtual TInt SetFaxSettings(const TTsyReqHandle aTsyReqHandle,const RCall::TFaxSessionSettings* aSettings);
|
|
190 |
virtual TInt SetFaxSharedHeaderFile(const TTsyReqHandle aTsyReqHandle, CFaxSharedFileHandles* aFaxSharedFileHandles);
|
|
191 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
192 |
private:
|
|
193 |
static CCallDummyBase* This(TAny* aPtr);
|
|
194 |
TInt ProcessingOwnership();
|
|
195 |
CPhoneFactoryDummyBase* iFac;
|
|
196 |
CAcquireOwnerList* iList;
|
|
197 |
TTsyTimer iNotifyCapsChange;
|
|
198 |
TTsyTimer iNotifyDurationChange;
|
|
199 |
TTsyTimer iNotifyHookChange;
|
|
200 |
TTsyTimer iNotifyStatusChange;
|
|
201 |
TTsyTimer iDial;
|
|
202 |
TTsyTimer iConnect;
|
|
203 |
TTsyTimer iAnswer;
|
|
204 |
TTsyTimer iHangUp;
|
|
205 |
TTsyTimer iLoanDataPortTimer;
|
|
206 |
RCall::THookStatus* iNotifyHookChangeParams;
|
|
207 |
RCall::TStatus* iNotifyStatusChangeParams;
|
|
208 |
};
|
|
209 |
|
|
210 |
//
|
|
211 |
// CLineDummyBase
|
|
212 |
//
|
|
213 |
class CLineDummyBase : public CLineBase
|
|
214 |
/**
|
|
215 |
@internalTechnology
|
|
216 |
*/
|
|
217 |
{
|
|
218 |
public:
|
|
219 |
CLineDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
220 |
void ConstructL();
|
|
221 |
~CLineDummyBase();
|
|
222 |
virtual TInt RegisterNotification(const TInt aIpc);
|
|
223 |
virtual TInt DeregisterNotification(const TInt aIpc);
|
|
224 |
virtual TInt CancelSubSession();
|
|
225 |
virtual TReqMode ReqModeL(const TInt aIpc);
|
|
226 |
virtual TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus);
|
|
227 |
virtual TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
228 |
virtual TInt GetHookStatus(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus* aHookStatus);
|
|
229 |
|
|
230 |
virtual TInt GetInfo(const TTsyReqHandle aTsyReqHandle, RLine::TLineInfo* aLineInfo);
|
|
231 |
virtual TInt NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RLine::TCaps* aCaps);
|
|
232 |
virtual TInt NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
233 |
virtual TInt NotifyIncomingCall(const TTsyReqHandle aTsyReqHandle, TName* aName);
|
|
234 |
virtual TInt NotifyIncomingCallCancel(const TTsyReqHandle aTsyReqHandle);
|
|
235 |
virtual TInt NotifyCallAdded(const TTsyReqHandle aTsyReqHandle,TName* aName);
|
|
236 |
virtual TInt NotifyCallAddedCancel(const TTsyReqHandle aTsyReqHandle);
|
|
237 |
virtual TInt GetCaps(const TTsyReqHandle aTsyReqHandle,RLine::TCaps* aCaps);
|
|
238 |
virtual TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus*);
|
|
239 |
virtual TInt NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus);
|
|
240 |
virtual TInt NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
241 |
|
|
242 |
static TInt NotifyCapsChangeHandler(TAny* aPtr);
|
|
243 |
static TInt NotifyStatusChangeHandler(TAny* aPtr);
|
|
244 |
static TInt NotifyIncomingCallHandler(TAny* aPtr);
|
|
245 |
static TInt NotifyHookChangeHandler(TAny* aPtr);
|
|
246 |
static TInt NotifyCallAddedHandler(TAny* aPtr);
|
|
247 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
248 |
private:
|
|
249 |
static CLineDummyBase* This(TAny* aPtr);
|
|
250 |
CPhoneFactoryDummyBase* iFac;
|
|
251 |
TTsyTimer iNotifyCapsChange;
|
|
252 |
TTsyTimer iNotifyIncomingCall;
|
|
253 |
TTsyTimer iNotifyHookChange;
|
|
254 |
TTsyTimer iNotifyStatusChange;
|
|
255 |
TTsyTimer iNotifyCallAdded;
|
|
256 |
RCall::THookStatus* iHookStatusParams;
|
|
257 |
RCall::TStatus* iStatusParams;
|
|
258 |
|
|
259 |
protected:
|
|
260 |
TInt iNameIndex;
|
|
261 |
};
|
|
262 |
|
|
263 |
//
|
|
264 |
// CPhoneDummyBase
|
|
265 |
//
|
|
266 |
class CPhoneDummyBase : public CPhoneBase
|
|
267 |
/**
|
|
268 |
@internalTechnology
|
|
269 |
*/
|
|
270 |
{
|
|
271 |
public:
|
|
272 |
CPhoneDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
273 |
void ConstructL();
|
|
274 |
~CPhoneDummyBase();
|
|
275 |
|
|
276 |
virtual TInt RegisterNotification(const TInt aIpc);
|
|
277 |
virtual TInt DeregisterNotification(const TInt aIpc);
|
|
278 |
virtual TInt CancelSubSession();
|
|
279 |
// virtual TReqMode ReqModeL(const TInt aIpc);
|
|
280 |
virtual TInt ControlledInitialisation(const TTsyReqHandle aTsyReqHandle);
|
|
281 |
virtual TInt ControlledInitialisationCancel(const TTsyReqHandle aTsyReqHandle);
|
|
282 |
virtual TInt NotifyModemDetected(const TTsyReqHandle aTsyReqHandle, RPhone::TModemDetection* aDetection);
|
|
283 |
virtual TInt NotifyModemDetectedCancel(const TTsyReqHandle aTsyReqHandle);
|
|
284 |
virtual TInt GetInfo(const TTsyReqHandle aTsyReqHandle, RPhone::TPhoneInfo* aPhoneInfo);
|
|
285 |
virtual TInt NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RPhone::TCaps* aCaps);
|
|
286 |
virtual TInt NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
287 |
virtual TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RPhone::TStatus*);
|
|
288 |
virtual TInt GetCaps(const TTsyReqHandle aTsyReqHandle,RPhone::TCaps*);
|
|
289 |
public:
|
|
290 |
|
|
291 |
static TInt HookChangeHandler(TAny* aPtr);
|
|
292 |
static TInt NotifyPhoneDetectedHandler(TAny* aPtr);
|
|
293 |
static TInt NotifyCapsChangeHandler(TAny* aPtr);
|
|
294 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
295 |
|
|
296 |
private:
|
|
297 |
static CPhoneDummyBase* This(TAny* aPtr);
|
|
298 |
TTsyTimer iNotifyPhoneDetected;
|
|
299 |
TTsyTimer iNotifyCapsChange;
|
|
300 |
RPhone::TModemDetection* iDetectionParams;
|
|
301 |
CPhoneFactoryDummyBase* iFac;
|
|
302 |
void Dummy();
|
|
303 |
};
|
|
304 |
|
|
305 |
//
|
|
306 |
// CPhoneFactoryDummyBase
|
|
307 |
//
|
|
308 |
#ifdef __MARM__
|
|
309 |
const TInt KEtelTimerGranularity = 31000;
|
|
310 |
#else
|
|
311 |
const TInt KEtelTimerGranularity = 80000;
|
|
312 |
#endif
|
|
313 |
|
|
314 |
class CPhoneFactoryDummyBase : public CPhoneFactoryBase
|
|
315 |
/**
|
|
316 |
@internalTechnology
|
|
317 |
*/
|
|
318 |
{
|
|
319 |
public:
|
|
320 |
CPhoneFactoryDummyBase();
|
|
321 |
void ConstructL();
|
|
322 |
~CPhoneFactoryDummyBase();
|
|
323 |
|
|
324 |
void QueueTimer(TTsyTimer& aTsyTimer,
|
|
325 |
const TTsyReqHandle aHande,
|
|
326 |
TTimeIntervalMicroSeconds32 aTimeInMicroSeconds,
|
|
327 |
TInt (*aFunction)(TAny *aPtr), TAny* aPtr);
|
|
328 |
TBool RemoveTimer(TTsyTimer& aHandle);
|
|
329 |
void ResetPending(TTsyTimer& aHandle);
|
|
330 |
TBool IsSupported(const TInt aMixin);
|
|
331 |
private:
|
|
332 |
CDeltaTimer* iTimer;
|
|
333 |
};
|
|
334 |
|
|
335 |
class CSubSessionExtDummyBase : public CSubSessionExtBase
|
|
336 |
/**
|
|
337 |
@internalTechnology
|
|
338 |
*/
|
|
339 |
{
|
|
340 |
public:
|
|
341 |
CSubSessionExtDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
342 |
~CSubSessionExtDummyBase();
|
|
343 |
virtual TInt RegisterNotification(const TInt aIpc);
|
|
344 |
virtual TInt DeregisterNotification(const TInt aIpc);
|
|
345 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
346 |
virtual TInt CancelSubSession();
|
|
347 |
private:
|
|
348 |
CPhoneFactoryDummyBase* iFac;
|
|
349 |
};
|
|
350 |
/**
|
|
351 |
@internalComponent
|
|
352 |
*/
|
|
353 |
const TUint KTsyEtelMajorVersionNumber=1;
|
|
354 |
const TUint KTsyEtelMinorVersionNumber=0;
|
|
355 |
const TUint KTsyEtelBuildVersionNumber=606;
|
|
356 |
|
|
357 |
|
|
358 |
#endif
|