|
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 <e32base.h> |
|
17 #include "ET_PHONE.H" |
|
18 #include "DDEF.H" |
|
19 #include "DBAD.H" |
|
20 #include "DBDEF.H" |
|
21 #include "../DSTDNC/DNCDEF.H" |
|
22 |
|
23 |
|
24 // |
|
25 // First Ordinal Functions |
|
26 // |
|
27 extern "C" |
|
28 { |
|
29 IMPORT_C CPhoneFactoryBase* LibEntry(); // Force "Proper Name" export |
|
30 } |
|
31 |
|
32 EXPORT_C CPhoneFactoryBase* LibEntry() |
|
33 { |
|
34 return new CPhoneFactoryBad; |
|
35 } |
|
36 |
|
37 // |
|
38 // Bad Phone Factory Functions |
|
39 // |
|
40 CPhoneFactoryBad::CPhoneFactoryBad() |
|
41 { |
|
42 iVersion=TVersion(KTsyEtelMajorVersionNumber, |
|
43 KTsyEtelMinorVersionNumber, |
|
44 KTsyEtelBuildVersionNumber); |
|
45 } |
|
46 |
|
47 CPhoneFactoryBad::~CPhoneFactoryBad() |
|
48 {} |
|
49 |
|
50 CPhoneBase* CPhoneFactoryBad::NewPhoneL(const TDesC&) |
|
51 // |
|
52 // Only pretended to have two phones! |
|
53 // |
|
54 { |
|
55 User::Leave(KErrGeneral); |
|
56 return NULL; |
|
57 } |
|
58 |
|
59 TInt CPhoneFactoryBad::GetPhoneInfo(const TInt aIndex,RTelServer::TPhoneInfo& aInfo) |
|
60 // |
|
61 // Pretending There are Two Phones DSTD and DSTDNC |
|
62 // |
|
63 { |
|
64 switch(aIndex) |
|
65 { |
|
66 case 0: |
|
67 aInfo.iNetworkType=DSTDPM_NETWORK_TYPE; |
|
68 aInfo.iName=DSTD_PHONE_NAME; |
|
69 aInfo.iNumberOfLines=DSTDPM_NUMBER_OF_LINES; |
|
70 return KErrNone; |
|
71 case 1: |
|
72 aInfo.iNetworkType=DSTDNC_NETWORK_TYPE; |
|
73 aInfo.iName=DSTDNC_PHONE_NAME; |
|
74 aInfo.iNumberOfLines=DSTDNC_NUMBER_OF_LINES; |
|
75 return KErrNone; |
|
76 default: |
|
77 return KErrNotFound; |
|
78 } |
|
79 } |
|
80 |
|
81 TInt CPhoneFactoryBad::EnumeratePhones() |
|
82 // |
|
83 // Return as Two Phones |
|
84 // |
|
85 { |
|
86 return (DBAD_NUMBER_OF_PHONES); |
|
87 } |
|
88 |
|
89 TBool CPhoneFactoryBad::IsSupported(const TInt) |
|
90 { |
|
91 return EFalse; |
|
92 } |