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 |
#include "DSTDNC.H"
|
|
17 |
#include "DNCDEF.H"
|
|
18 |
#include "../DSTD/DDEF.H"
|
|
19 |
|
|
20 |
#include "../TETEL/Tetelcs.h"
|
|
21 |
|
|
22 |
//
|
|
23 |
// CFaxDstdNc
|
|
24 |
//
|
|
25 |
CFaxDstdNc* CFaxDstdNc::NewL(CPhoneFactoryDummyBase* aFac)
|
|
26 |
//
|
|
27 |
// Create new instances of Fax
|
|
28 |
//
|
|
29 |
{
|
|
30 |
CFaxDstdNc* fax=new(ELeave) CFaxDstdNc(aFac);
|
|
31 |
CleanupStack::PushL(fax);
|
|
32 |
fax->ConstructL();
|
|
33 |
CleanupStack::Pop();
|
|
34 |
return fax;
|
|
35 |
}
|
|
36 |
|
|
37 |
CFaxDstdNc::CFaxDstdNc(CPhoneFactoryDummyBase* aFac)
|
|
38 |
:CFaxDummyBase(aFac)
|
|
39 |
{}
|
|
40 |
|
|
41 |
void CFaxDstdNc::ConstructL()
|
|
42 |
{
|
|
43 |
TInt r = iChunk.CreateGlobal(KNullDesC,sizeof (RFax::TProgress), sizeof (RFax::TProgress),EOwnerProcess);
|
|
44 |
if (r == KErrNone)
|
|
45 |
{
|
|
46 |
RFax::TProgress* progress = new(iChunk.Base()) RFax::TProgress;
|
|
47 |
progress->iLastUpdateTime = 0;
|
|
48 |
progress->iAnswerback.Zero ();
|
|
49 |
progress->iPhase = ENotYetStarted;
|
|
50 |
progress->iSpeed = 9600;
|
|
51 |
progress->iResolution = EFaxNormal;
|
|
52 |
progress->iCompression = EModifiedHuffman;
|
|
53 |
progress->iECM = 0;
|
|
54 |
progress->iPage = 0;
|
|
55 |
progress->iLines = 0;
|
|
56 |
}
|
|
57 |
else
|
|
58 |
User::Leave(r);
|
|
59 |
}
|
|
60 |
|
|
61 |
CFaxDstdNc::~CFaxDstdNc()
|
|
62 |
{
|
|
63 |
iChunk.Close();
|
|
64 |
}
|
|
65 |
|
|
66 |
RHandleBase* CFaxDstdNc::GlobalKernelObjectHandle()
|
|
67 |
{
|
|
68 |
return &iChunk;
|
|
69 |
}
|
|
70 |
//
|
|
71 |
// CCallDstdNc
|
|
72 |
//
|
|
73 |
CCallDstdNc* CCallDstdNc::NewL(CPhoneFactoryDummyBase* aFac)
|
|
74 |
//
|
|
75 |
// Static function to create new call
|
|
76 |
//
|
|
77 |
{
|
|
78 |
CCallDstdNc* call=new(ELeave) CCallDstdNc(aFac);
|
|
79 |
CleanupStack::PushL(call);
|
|
80 |
call->ConstructL();
|
|
81 |
CleanupStack::Pop();
|
|
82 |
return call;
|
|
83 |
}
|
|
84 |
|
|
85 |
CCallDstdNc::CCallDstdNc(CPhoneFactoryDummyBase* aFac)
|
|
86 |
:CCallDummyBase(aFac)
|
|
87 |
{}
|
|
88 |
|
|
89 |
void CCallDstdNc::ConstructL()
|
|
90 |
//
|
|
91 |
// For future use
|
|
92 |
//
|
|
93 |
{
|
|
94 |
CCallDummyBase::ConstructL();
|
|
95 |
iLoanCommPort=EFalse;
|
|
96 |
}
|
|
97 |
|
|
98 |
CCallDstdNc::~CCallDstdNc()
|
|
99 |
{
|
|
100 |
}
|
|
101 |
|
|
102 |
TInt CCallDstdNc::ExtFunc(const TTsyReqHandle,const TInt,const TDataPackage&)
|
|
103 |
//
|
|
104 |
// not supported by the core tsy
|
|
105 |
//
|
|
106 |
{
|
|
107 |
return KErrNotSupported;
|
|
108 |
}
|
|
109 |
|
|
110 |
CTelObject* CCallDstdNc::OpenNewObjectByNameL(const TDesC&)
|
|
111 |
//
|
|
112 |
// open aFax within the context of a call
|
|
113 |
//
|
|
114 |
{
|
|
115 |
return REINTERPRET_CAST(CTelObject*,CFaxDstdNc::NewL(FacPtr()));
|
|
116 |
}
|
|
117 |
|
|
118 |
CTelObject* CCallDstdNc::OpenNewObjectL(TDes&)
|
|
119 |
{
|
|
120 |
User::Leave(KErrNotSupported);
|
|
121 |
return NULL;
|
|
122 |
}
|
|
123 |
|
|
124 |
TInt CLineDstdNc::EnumerateCall(const TTsyReqHandle aUid,TInt* aCount)
|
|
125 |
{
|
|
126 |
*aCount=1;
|
|
127 |
ReqCompleted(aUid,KErrNone);
|
|
128 |
return KErrNone;
|
|
129 |
}
|
|
130 |
|
|
131 |
TInt CLineDstdNc::GetCallInfo(const TTsyReqHandle aUid,TCallInfoIndex* aCallInfo)
|
|
132 |
{
|
|
133 |
aCallInfo->iInfo.iStatus=DSTDNC_CALL_STATUS;
|
|
134 |
aCallInfo->iInfo.iCallCapsFlags=DSTDNC_CALL_CAPS;
|
|
135 |
|
|
136 |
ReqCompleted(aUid,KErrNone);
|
|
137 |
return KErrNone;
|
|
138 |
}
|
|
139 |
|
|
140 |
//
|
|
141 |
// CLineDstdNc
|
|
142 |
//
|
|
143 |
CLineDstdNc* CLineDstdNc::NewL(const TDesC&,CPhoneFactoryDummyBase* aFac)
|
|
144 |
//
|
|
145 |
// Static Function for a New Line
|
|
146 |
//
|
|
147 |
{
|
|
148 |
CLineDstdNc* line=new(ELeave) CLineDstdNc(aFac);
|
|
149 |
CleanupStack::PushL(line);
|
|
150 |
line->ConstructL();
|
|
151 |
CleanupStack::Pop();
|
|
152 |
return line;
|
|
153 |
}
|
|
154 |
|
|
155 |
CLineDstdNc::CLineDstdNc(CPhoneFactoryDummyBase* aFac)
|
|
156 |
:CLineDummyBase(aFac)
|
|
157 |
{}
|
|
158 |
|
|
159 |
void CLineDstdNc::ConstructL()
|
|
160 |
{}
|
|
161 |
|
|
162 |
CLineDstdNc::~CLineDstdNc()
|
|
163 |
{}
|
|
164 |
|
|
165 |
CTelObject* CLineDstdNc::OpenNewObjectByNameL(const TDesC& aName)
|
|
166 |
//
|
|
167 |
// Open subsession extension within context of a line
|
|
168 |
//
|
|
169 |
{
|
|
170 |
if (aName.Compare(DSTDNC_CALL_NAME)==KErrNone)
|
|
171 |
return REINTERPRET_CAST(CCallBase*,CCallDstdNc::NewL(FacPtr()));
|
|
172 |
return NULL;
|
|
173 |
}
|
|
174 |
|
|
175 |
CTelObject* CLineDstdNc::OpenNewObjectL(TDes& aNewName)
|
|
176 |
{
|
|
177 |
aNewName.Append(DSTDNC_MODULE_NAME);
|
|
178 |
aNewName.AppendNum(iNameIndex++);
|
|
179 |
return REINTERPRET_CAST(CCallBase*,CCallDstdNc::NewL(FacPtr()));
|
|
180 |
}
|
|
181 |
|
|
182 |
TInt CLineDstdNc::ExtFunc(const TTsyReqHandle,const TInt,const TDataPackage&)
|
|
183 |
//
|
|
184 |
// not supported by the core tsy
|
|
185 |
//
|
|
186 |
{
|
|
187 |
return KErrNotSupported;
|
|
188 |
}
|
|
189 |
|
|
190 |
//
|
|
191 |
// CPhoneDstdNc
|
|
192 |
//
|
|
193 |
CPhoneDstdNc* CPhoneDstdNc::NewL(CPhoneFactoryDummyBase* aFac)
|
|
194 |
//
|
|
195 |
// Create new phone
|
|
196 |
//
|
|
197 |
{
|
|
198 |
CPhoneDstdNc* phone=new(ELeave) CPhoneDstdNc(aFac);
|
|
199 |
CleanupStack::PushL(phone);
|
|
200 |
phone->ConstructL();
|
|
201 |
CleanupStack::Pop();
|
|
202 |
return phone;
|
|
203 |
}
|
|
204 |
|
|
205 |
CPhoneDstdNc::CPhoneDstdNc(CPhoneFactoryDummyBase* aFac)
|
|
206 |
:CPhoneDummyBase(aFac)
|
|
207 |
{}
|
|
208 |
|
|
209 |
void CPhoneDstdNc::ConstructL()
|
|
210 |
{}
|
|
211 |
|
|
212 |
CPhoneDstdNc::~CPhoneDstdNc()
|
|
213 |
{}
|
|
214 |
|
|
215 |
TInt CPhoneDstdNc::EnumerateLines(const TTsyReqHandle aTsyReqHandle,TInt* aNumLines)
|
|
216 |
{
|
|
217 |
*aNumLines=DSTDNC_NUMBER_OF_LINES; // just one line on this phone
|
|
218 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
219 |
return KErrNone;
|
|
220 |
}
|
|
221 |
|
|
222 |
TInt CPhoneDstdNc::GetLineInfo(const TTsyReqHandle aTsyReqHandle,TLineInfoIndex* aLineInfo)
|
|
223 |
{
|
|
224 |
if (aLineInfo->iIndex!=0)
|
|
225 |
return(KErrArgument);
|
|
226 |
|
|
227 |
aLineInfo->iInfo.iStatus=DSTDNC_LINE_STATUS;
|
|
228 |
aLineInfo->iInfo.iName.Copy(DSTDNC_LINE_NAME);
|
|
229 |
|
|
230 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
231 |
return KErrNone;
|
|
232 |
}
|
|
233 |
|
|
234 |
CTelObject::TReqMode CPhoneDstdNc::ReqModeL(const TInt)
|
|
235 |
//
|
|
236 |
// Request Mode for Phone
|
|
237 |
//
|
|
238 |
{
|
|
239 |
CTelObject::TReqMode ret=0;
|
|
240 |
return ret;
|
|
241 |
}
|
|
242 |
|
|
243 |
|
|
244 |
TInt CPhoneDstdNc::ExtFunc(const TTsyReqHandle aTsyReqHandle, const TInt aIpc, const TDataPackage&)
|
|
245 |
{
|
|
246 |
switch(aIpc)
|
|
247 |
{
|
|
248 |
//Only CustomIPC2 is supported by this TSY.
|
|
249 |
|
|
250 |
case ETestCustomIPC2: //IPC 9056
|
|
251 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
252 |
return KErrNone;
|
|
253 |
|
|
254 |
//Custom IPCs 1,3,4,5,6,7,8 & 9 are not supported for various reasons.
|
|
255 |
//Typically a TSY will not explicitly list the IPCs it does not support but they are listed
|
|
256 |
//here for clarity
|
|
257 |
case ETestCustomIPC1: //IPC 1000055 - No support for this IPC in this TSY
|
|
258 |
case ETestCustomIPC6: //IPC 1000500 - No support for this IPC in this TSY
|
|
259 |
case ETestCustomIPC3: //IPC 1000099 - No support for this IPC in this TSY
|
|
260 |
case ETestCustomIPC4: //IPC 1000100 - Should never be supported by a TSY as IPC is outside allocated range
|
|
261 |
case ETestCustomIPC5: //IPC 1000499 - Should never be supported by a TSY as IPC is outside allocated range
|
|
262 |
case ETestCustomIPC7: //IPC 1000099 - No support for this IPC in this TSY
|
|
263 |
case ETestCustomIPC8: //IPC 1000600 - Should never be supported by a TSY as IPC is outside allocated range
|
|
264 |
case ETestCustomIPC9: //IPC 999999 - Should never be supported by a TSY as IPC is outside allocated range
|
|
265 |
return KErrNotSupported;
|
|
266 |
}
|
|
267 |
|
|
268 |
return KErrNotSupported;
|
|
269 |
}
|
|
270 |
|
|
271 |
|
|
272 |
CTelObject* CPhoneDstdNc::OpenNewObjectByNameL(const TDesC& aName)
|
|
273 |
//
|
|
274 |
// Open New Line within the Context of a Phone
|
|
275 |
//
|
|
276 |
{
|
|
277 |
if (aName.Compare(DSTDNC_LINE_NAME)==KErrNone)
|
|
278 |
return REINTERPRET_CAST(CTelObject*,CLineDstdNc::NewL(aName,FacPtr()));
|
|
279 |
return NULL;
|
|
280 |
}
|
|
281 |
|
|
282 |
CTelObject* CPhoneDstdNc::OpenNewObjectL(TDes&)
|
|
283 |
{
|
|
284 |
User::Leave(KErrNotSupported);
|
|
285 |
return NULL;
|
|
286 |
}
|
|
287 |
|
|
288 |
void CPhoneDstdNc::Init()
|
|
289 |
{}
|
|
290 |
|
|
291 |
TSecurityPolicy CPhoneDstdNc::GetRequiredPlatSecCaps(const TInt aIpc)
|
|
292 |
{
|
|
293 |
switch(aIpc)
|
|
294 |
{
|
|
295 |
case ETestCustomIPC2:
|
|
296 |
return TSecurityPolicy(ECapabilityReadUserData);
|
|
297 |
|
|
298 |
case ETestCustomIPC1: //Not supported by this TSY
|
|
299 |
case ETestCustomIPC6: //Not supported by this TSY
|
|
300 |
case ETestCustomIPC3: //Not supported by this TSY
|
|
301 |
case ETestCustomIPC4: //Not in range of IPCs allocated to Custom IPCs should be caught by Etel's policy table
|
|
302 |
case ETestCustomIPC5: //Not in range of IPCs allocated to Custom IPCs should be caught by Etel's policy table
|
|
303 |
case ETestCustomIPC7: //Not supported by this TSY
|
|
304 |
case ETestCustomIPC8: //Not in range of IPCs allocated to Custom IPCs should be caught by Etel's policy table
|
|
305 |
case ETestCustomIPC9: //Not in range of IPCs allocated to Custom IPCs should be caught by Etel's policy table
|
|
306 |
return TSecurityPolicy(TSecurityPolicy::EAlwaysFail);
|
|
307 |
|
|
308 |
default:
|
|
309 |
//For any non-Custom IPCs return a policy that will always cause the capability check to pass
|
|
310 |
return TSecurityPolicy(TSecurityPolicy::EAlwaysPass);
|
|
311 |
}
|
|
312 |
}
|
|
313 |
|
|
314 |
//
|
|
315 |
// DSTDNC Phone Factory Functions
|
|
316 |
//
|
|
317 |
CPhoneFactoryDstdNc* CPhoneFactoryDstdNc::NewL()
|
|
318 |
{
|
|
319 |
CPhoneFactoryDstdNc *This = new (ELeave) CPhoneFactoryDstdNc;
|
|
320 |
CleanupStack::PushL(This);
|
|
321 |
This->ConstructL();
|
|
322 |
CleanupStack::Pop();
|
|
323 |
return This;
|
|
324 |
}
|
|
325 |
|
|
326 |
CPhoneFactoryDstdNc::CPhoneFactoryDstdNc()
|
|
327 |
//
|
|
328 |
// Constructor for Phone Factory
|
|
329 |
//
|
|
330 |
{
|
|
331 |
iVersion=TVersion( KTsyEtelMajorVersionNumber,
|
|
332 |
KTsyEtelMinorVersionNumber,
|
|
333 |
KTsyEtelBuildVersionNumber);
|
|
334 |
}
|
|
335 |
|
|
336 |
CPhoneFactoryDstdNc::~CPhoneFactoryDstdNc()
|
|
337 |
//
|
|
338 |
// D'tor
|
|
339 |
//
|
|
340 |
{
|
|
341 |
}
|
|
342 |
|
|
343 |
CPhoneBase* CPhoneFactoryDstdNc::NewPhoneL(const TDesC& aName)
|
|
344 |
//
|
|
345 |
// Create New Instance of Phone
|
|
346 |
//
|
|
347 |
{
|
|
348 |
if (aName.Compare(DSTDNC_PHONE_NAME)==KErrNone)
|
|
349 |
return CPhoneDstdNc::NewL(this);
|
|
350 |
return NULL;
|
|
351 |
}
|
|
352 |
|
|
353 |
TInt CPhoneFactoryDstdNc::GetPhoneInfo(const TInt aIndex, RTelServer::TPhoneInfo& aInfo)
|
|
354 |
//
|
|
355 |
// Get Phone Info
|
|
356 |
//
|
|
357 |
{
|
|
358 |
switch (aIndex)
|
|
359 |
{
|
|
360 |
case 0:
|
|
361 |
aInfo.iNetworkType=DSTDNC_NETWORK_TYPE;
|
|
362 |
aInfo.iName=DSTDNC_PHONE_NAME;
|
|
363 |
aInfo.iNumberOfLines=DSTDNC_NUMBER_OF_LINES;
|
|
364 |
return KErrNone;
|
|
365 |
default:
|
|
366 |
return KErrNotFound;
|
|
367 |
}
|
|
368 |
}
|
|
369 |
|
|
370 |
TInt CPhoneFactoryDstdNc::EnumeratePhones()
|
|
371 |
{
|
|
372 |
return (DSTDNC_NUMBER_OF_PHONES);
|
|
373 |
}
|
|
374 |
|
|
375 |
//
|
|
376 |
// First Ordinal Functions
|
|
377 |
//
|
|
378 |
extern "C"
|
|
379 |
{
|
|
380 |
IMPORT_C CPhoneFactoryBase* LibEntry(); // Force "Proper Name" export
|
|
381 |
}
|
|
382 |
|
|
383 |
EXPORT_C CPhoneFactoryBase* LibEntry()
|
|
384 |
{
|
|
385 |
CPhoneFactoryDstdNc* factory = NULL;
|
|
386 |
TRAP_IGNORE(factory = CPhoneFactoryDstdNc::NewL());
|
|
387 |
return factory;
|
|
388 |
}
|