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 |
// This header file contains TSY classes that represent the core ETel API support
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalAll
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef __CORETSY_H
|
|
24 |
#define __CORETSY_H
|
|
25 |
|
|
26 |
#include <e32base.h>
|
|
27 |
#include <et_phone.h>
|
|
28 |
#include "ETELMM.H"
|
|
29 |
|
|
30 |
#ifdef __MARM__
|
|
31 |
const TInt KEtelTimerGranularity = 31000;
|
|
32 |
#else
|
|
33 |
const TInt KEtelTimerGranularity = 80000;
|
|
34 |
#endif
|
|
35 |
|
|
36 |
// Pretend version numbers - not sure why they are here!
|
|
37 |
const TUint KTsyEtelMajorVersionNumber=0;
|
|
38 |
const TUint KTsyEtelMinorVersionNumber=0;
|
|
39 |
const TUint KTsyEtelBuildVersionNumber=1;
|
|
40 |
|
|
41 |
enum TTsyPanic
|
|
42 |
{
|
|
43 |
KErrEtelDataCorrupted,
|
|
44 |
KErrEtelInvalidRequestMode,
|
|
45 |
KErrEtelNotRecognisedCancelHandle,
|
|
46 |
};
|
|
47 |
|
|
48 |
void TsyPanic(TTsyPanic aPanic);
|
|
49 |
|
|
50 |
class TTsyTimer
|
|
51 |
{
|
|
52 |
public:
|
|
53 |
TTsyTimer();
|
|
54 |
TBool iPending;
|
|
55 |
TDeltaTimerEntry iEntry;
|
|
56 |
TTsyReqHandle iTsyReqHandle;
|
|
57 |
};
|
|
58 |
|
|
59 |
//
|
|
60 |
// CPhoneFactoryDummyBase
|
|
61 |
//
|
|
62 |
|
|
63 |
class CPhoneFactoryDummyBase : public CPhoneFactoryBase
|
|
64 |
{
|
|
65 |
public:
|
|
66 |
CPhoneFactoryDummyBase();
|
|
67 |
~CPhoneFactoryDummyBase();
|
|
68 |
void ConstructL();
|
|
69 |
|
|
70 |
void QueueTimer(TTsyTimer& aTsyTimer,const TTsyReqHandle aHandle,TTimeIntervalMicroSeconds32 aTimeInMicroSeconds,
|
|
71 |
TInt (*aFunction)(TAny *aPtr), TAny* aPtr);
|
|
72 |
TBool RemoveTimer(TTsyTimer& aHandle);
|
|
73 |
void ResetPending(TTsyTimer& aHandle);
|
|
74 |
|
|
75 |
virtual TInt GetPhoneInfo(const TInt aIndex, RTelServer::TPhoneInfo& aPhoneFactoryBaseInfo);
|
|
76 |
virtual TInt EnumeratePhones();
|
|
77 |
|
|
78 |
|
|
79 |
private:
|
|
80 |
CDeltaTimer* iTimer;
|
|
81 |
};
|
|
82 |
|
|
83 |
//
|
|
84 |
// CSubSessionExtDummyBase
|
|
85 |
//
|
|
86 |
|
|
87 |
class CSubSessionExtDummyBase : public CSubSessionExtBase
|
|
88 |
{
|
|
89 |
public:
|
|
90 |
CSubSessionExtDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
91 |
~CSubSessionExtDummyBase();
|
|
92 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
93 |
private:
|
|
94 |
CPhoneFactoryDummyBase* iFac;
|
|
95 |
};
|
|
96 |
|
|
97 |
//
|
|
98 |
// CFaxDummyBase
|
|
99 |
//
|
|
100 |
|
|
101 |
class CFaxDummyBase : public CFaxBase
|
|
102 |
{
|
|
103 |
public:
|
|
104 |
CFaxDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
105 |
~CFaxDummyBase();
|
|
106 |
|
|
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 |
// CFaxDMmTsy
|
|
133 |
//
|
|
134 |
|
|
135 |
class CFaxDMmTsy : public CFaxDummyBase
|
|
136 |
{
|
|
137 |
public:
|
|
138 |
static CFaxDMmTsy* NewL(CPhoneFactoryDummyBase* aFac);
|
|
139 |
CFaxDMmTsy(CPhoneFactoryDummyBase* aFac);
|
|
140 |
void ConstructL();
|
|
141 |
~CFaxDMmTsy();
|
|
142 |
virtual TInt RegisterNotification(const TInt aIpc);
|
|
143 |
virtual TInt DeregisterNotification(const TInt aIpc);
|
|
144 |
// virtual TInt NumberOfSlotsL(const TInt aIpc);
|
|
145 |
RHandleBase* GlobalKernelObjectHandle();
|
|
146 |
|
|
147 |
private:
|
|
148 |
RChunk iChunk;
|
|
149 |
};
|
|
150 |
|
|
151 |
//
|
|
152 |
// CCallDummyBase
|
|
153 |
//
|
|
154 |
|
|
155 |
class CCallDummyBase : public CCallBase
|
|
156 |
{
|
|
157 |
public:
|
|
158 |
CCallDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
159 |
void ConstructL();
|
|
160 |
~CCallDummyBase();
|
|
161 |
|
|
162 |
virtual TInt Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber);
|
|
163 |
virtual TInt DialCancel(const TTsyReqHandle aTsyReqHandle);
|
|
164 |
|
|
165 |
virtual TInt Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams);
|
|
166 |
virtual TInt ConnectCancel(const TTsyReqHandle aTsyReqHandle);
|
|
167 |
|
|
168 |
virtual TInt AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams);
|
|
169 |
virtual TInt AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle);
|
|
170 |
|
|
171 |
virtual TInt HangUp(const TTsyReqHandle aTsyReqHandle);
|
|
172 |
virtual TInt HangUpCancel(const TTsyReqHandle aTsyReqHandle);
|
|
173 |
|
|
174 |
virtual TInt NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RCall::TCaps* aCaps);
|
|
175 |
virtual TInt NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
176 |
|
|
177 |
virtual TInt NotifyDurationChange(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime);
|
|
178 |
virtual TInt NotifyDurationChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
179 |
|
|
180 |
virtual TInt NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus);
|
|
181 |
virtual TInt NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
182 |
|
|
183 |
virtual TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus);
|
|
184 |
virtual TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
185 |
|
|
186 |
virtual TInt LoanDataPort(const TTsyReqHandle aTsyReqHandle,RCall::TCommPort*);
|
|
187 |
virtual TInt LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle);
|
|
188 |
|
|
189 |
virtual TInt RecoverDataPort(const TTsyReqHandle aTsyReqHandle);
|
|
190 |
virtual TInt RecoverDataPortAndRelinquishOwnership();
|
|
191 |
|
|
192 |
virtual TInt TransferOwnership(const TTsyReqHandle aTsyReqHandle);
|
|
193 |
virtual TInt AcquireOwnership(const TTsyReqHandle aTsyReqHandle);
|
|
194 |
virtual TInt AcquireOwnershipCancel(const TTsyReqHandle aTsyReqHandle);
|
|
195 |
virtual TInt RelinquishOwnership();
|
|
196 |
|
|
197 |
virtual TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus*);
|
|
198 |
virtual TInt GetCaps(const TTsyReqHandle aTsyReqHandle,RCall::TCaps* aCaps);
|
|
199 |
virtual TInt GetInfo(const TTsyReqHandle aTsyReqHandle, RCall::TCallInfo* aCallInfo);
|
|
200 |
virtual TInt GetBearerServiceInfo(const TTsyReqHandle aTsyReqHandle,RCall::TBearerService*);
|
|
201 |
virtual TInt GetCallParams(const TTsyReqHandle aTsyReqHandle, TDes8* aParams);
|
|
202 |
virtual TInt GetCallDuration(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime);
|
|
203 |
|
|
204 |
virtual TInt GetFaxSettings(const TTsyReqHandle aTsyReqHandle,RCall::TFaxSessionSettings* aSettings);
|
|
205 |
virtual TInt SetFaxSettings(const TTsyReqHandle aTsyReqHandle,const RCall::TFaxSessionSettings* aSettings);
|
|
206 |
|
|
207 |
// Handler functions
|
|
208 |
static TInt NotifyCapsChangeHandler(TAny* aPtr);
|
|
209 |
static TInt NotifyDurationChangeHandler(TAny* aPtr);
|
|
210 |
static TInt NotifyStatusChangeHandler(TAny* aPtr);
|
|
211 |
static TInt LoanDataPortHandler(TAny* aPtr);
|
|
212 |
static TInt DialHandler(TAny* aPtr);
|
|
213 |
static TInt AnswerHandler(TAny* aPtr);
|
|
214 |
static TInt HangUpHandler(TAny* aPtr);
|
|
215 |
|
|
216 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
217 |
private:
|
|
218 |
static CCallDummyBase* This(TAny* aPtr);
|
|
219 |
CPhoneFactoryDummyBase* iFac;
|
|
220 |
|
|
221 |
TTsyTimer iNotifyCapsChange;
|
|
222 |
TTsyTimer iNotifyDurationChange;
|
|
223 |
TTsyTimer iNotifyStatusChange;
|
|
224 |
TTsyTimer iDial;
|
|
225 |
TTsyTimer iAnswer;
|
|
226 |
TTsyTimer iHangUp;
|
|
227 |
TTsyTimer iLoanDataPortTimer;
|
|
228 |
|
|
229 |
RCall::THookStatus* iNotifyHookChangeParams;
|
|
230 |
RCall::TStatus* iNotifyStatusChangeParams;
|
|
231 |
protected:
|
|
232 |
RMobileCall::TMobileHscsdCallParamsV8 iDataCallParams;
|
|
233 |
RMobileCall::TMobileCallParamsV7 iMobileCallParams;
|
|
234 |
};
|
|
235 |
|
|
236 |
//
|
|
237 |
// CLineDummyBase
|
|
238 |
//
|
|
239 |
class CLineDummyBase : public CLineBase
|
|
240 |
{
|
|
241 |
public:
|
|
242 |
CLineDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
243 |
void ConstructL();
|
|
244 |
~CLineDummyBase();
|
|
245 |
|
|
246 |
virtual TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus);
|
|
247 |
virtual TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
248 |
|
|
249 |
virtual TInt NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus);
|
|
250 |
virtual TInt NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
251 |
|
|
252 |
virtual TInt NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RLine::TCaps* aCaps);
|
|
253 |
virtual TInt NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
254 |
|
|
255 |
virtual TInt NotifyIncomingCall(const TTsyReqHandle aTsyReqHandle, TName* aName);
|
|
256 |
virtual TInt NotifyIncomingCallCancel(const TTsyReqHandle aTsyReqHandle);
|
|
257 |
|
|
258 |
virtual TInt NotifyCallAdded(const TTsyReqHandle aTsyReqHandle,TName* aName);
|
|
259 |
virtual TInt NotifyCallAddedCancel(const TTsyReqHandle aTsyReqHandle);
|
|
260 |
|
|
261 |
virtual TInt GetCaps(const TTsyReqHandle aTsyReqHandle,RLine::TCaps* aCaps);
|
|
262 |
virtual TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus*);
|
|
263 |
virtual TInt GetHookStatus(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus* aHookStatus);
|
|
264 |
virtual TInt GetInfo(const TTsyReqHandle aTsyReqHandle, RLine::TLineInfo* aLineInfo);
|
|
265 |
|
|
266 |
virtual TInt EnumerateCall(const TTsyReqHandle aTsyReqHandle,TInt* aCount);
|
|
267 |
virtual TInt GetCallInfo(const TTsyReqHandle aTsyReqHandle,TCallInfoIndex*);
|
|
268 |
|
|
269 |
// Handler functions
|
|
270 |
static TInt NotifyCapsChangeHandler(TAny* aPtr);
|
|
271 |
static TInt NotifyStatusChangeHandler(TAny* aPtr);
|
|
272 |
static TInt NotifyIncomingCallHandler(TAny* aPtr);
|
|
273 |
static TInt NotifyCallAddedHandler(TAny* aPtr);
|
|
274 |
|
|
275 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
276 |
private:
|
|
277 |
static CLineDummyBase* This(TAny* aPtr);
|
|
278 |
CPhoneFactoryDummyBase* iFac;
|
|
279 |
|
|
280 |
TTsyTimer iNotifyCapsChange;
|
|
281 |
TTsyTimer iNotifyIncomingCall;
|
|
282 |
TTsyTimer iNotifyStatusChange;
|
|
283 |
TTsyTimer iNotifyCallAdded;
|
|
284 |
|
|
285 |
RCall::TStatus* iStatusParams;
|
|
286 |
RLine::TCaps* iCapsParams;
|
|
287 |
TName* iNameParams;
|
|
288 |
|
|
289 |
protected:
|
|
290 |
TInt iNameIndex;
|
|
291 |
};
|
|
292 |
|
|
293 |
//
|
|
294 |
// CPhoneDummyBase
|
|
295 |
//
|
|
296 |
class CPhoneDummyBase : public CPhoneBase
|
|
297 |
{
|
|
298 |
public:
|
|
299 |
CPhoneDummyBase(CPhoneFactoryDummyBase* aFac);
|
|
300 |
void ConstructL();
|
|
301 |
~CPhoneDummyBase();
|
|
302 |
|
|
303 |
virtual TInt ControlledInitialisation(const TTsyReqHandle aTsyReqHandle);
|
|
304 |
virtual TInt ControlledInitialisationCancel(const TTsyReqHandle aTsyReqHandle);
|
|
305 |
|
|
306 |
virtual TInt NotifyModemDetected(const TTsyReqHandle aTsyReqHandle, RPhone::TModemDetection* aDetection);
|
|
307 |
virtual TInt NotifyModemDetectedCancel(const TTsyReqHandle aTsyReqHandle);
|
|
308 |
|
|
309 |
virtual TInt NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RPhone::TCaps* aCaps);
|
|
310 |
virtual TInt NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle);
|
|
311 |
|
|
312 |
virtual TInt GetInfo(const TTsyReqHandle aTsyReqHandle, RPhone::TPhoneInfo* aPhoneInfo);
|
|
313 |
virtual TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RPhone::TStatus*);
|
|
314 |
virtual TInt GetCaps(const TTsyReqHandle aTsyReqHandle,RPhone::TCaps*);
|
|
315 |
|
|
316 |
virtual TInt EnumerateLines(const TTsyReqHandle aTsyReqHandle,TInt*);
|
|
317 |
virtual TInt GetLineInfo(const TTsyReqHandle aTsyReqHandle,TLineInfoIndex*);
|
|
318 |
|
|
319 |
// Handler functions
|
|
320 |
static TInt NotifyPhoneDetectedHandler(TAny* aPtr);
|
|
321 |
static TInt NotifyCapsChangeHandler(TAny* aPtr);
|
|
322 |
|
|
323 |
CPhoneFactoryDummyBase* FacPtr() const;
|
|
324 |
|
|
325 |
private:
|
|
326 |
static CPhoneDummyBase* This(TAny* aPtr);
|
|
327 |
CPhoneFactoryDummyBase* iFac;
|
|
328 |
|
|
329 |
TTsyTimer iNotifyPhoneDetected;
|
|
330 |
TTsyTimer iNotifyCapsChange;
|
|
331 |
|
|
332 |
RPhone::TModemDetection* iDetectionParams;
|
|
333 |
|
|
334 |
protected:
|
|
335 |
};
|
|
336 |
|
|
337 |
|
|
338 |
#endif
|