|
1 // Copyright (c) 2002-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 "DbAccess.h" |
|
17 #include <cdbover.h> |
|
18 #include <cdbcols.h> |
|
19 |
|
20 CCommsDbAccess* CCommsDbAccess::NewL() |
|
21 { |
|
22 return CCommsDbAccess::NewL(EFalse); |
|
23 } |
|
24 |
|
25 CCommsDbAccess* CCommsDbAccess::NewL(TBool) |
|
26 { |
|
27 CCommsDbAccess* self = new(ELeave)CCommsDbAccess(); |
|
28 return self; |
|
29 } |
|
30 |
|
31 CCommsDbAccess::CCommsDbAccess() |
|
32 { |
|
33 } |
|
34 |
|
35 CCommsDbAccess::~CCommsDbAccess() |
|
36 { |
|
37 } |
|
38 |
|
39 TInt CCommsDbAccess::GetConnectionAttempts() |
|
40 { |
|
41 |
|
42 return 2; |
|
43 } |
|
44 |
|
45 |
|
46 void CCommsDbAccess::GetBearerAvailabilityTsyNameL(TDes& aTsyName) |
|
47 { |
|
48 GetTsyNameL(aTsyName); |
|
49 } |
|
50 |
|
51 void CCommsDbAccess::GetTsyNameL(TDes& aTsyName) |
|
52 { |
|
53 _LIT(KTsyName, "mm"); |
|
54 aTsyName = KTsyName(); |
|
55 } |
|
56 |
|
57 void CCommsDbAccess::GetCurrentSettingsL(TConnectionSettings& aSettings, TCommDbConnectionDirection aDirection, TUint32) |
|
58 { |
|
59 |
|
60 aSettings.iRank = 1; |
|
61 aSettings.iDirection = aDirection; |
|
62 aSettings.iDialogPref = ECommDbDialogPrefPrompt; //ECommDbDialogPrefDoNotPrompt; |
|
63 aSettings.iBearerSet = KCommDbBearerCSD; |
|
64 aSettings.iIAPId = 1; |
|
65 aSettings.iServiceId = 1; |
|
66 aSettings.iServiceType.Copy(TPtrC(DIAL_OUT_ISP)); |
|
67 aSettings.iBearerId = 1; |
|
68 aSettings.iLocationId = 1; |
|
69 aSettings.iChargeCardId = 0; |
|
70 } |
|
71 |
|
72 void CCommsDbAccess::SetCurrentSettingsL(const TConnectionSettings&) |
|
73 { |
|
74 } |
|
75 |
|
76 TBool CCommsDbAccess::IsTelNumLengthZeroForRasConnectionL(TConnectionSettings&) |
|
77 { |
|
78 |
|
79 return EFalse; //ETrue; |
|
80 } |
|
81 |
|
82 void CCommsDbAccess::GetServiceSettingsL(TConnectionSettings&) |
|
83 { |
|
84 } |
|
85 |
|
86 RMobilePhone::TMobilePhoneNetworkMode CCommsDbAccess::NetworkMode() const |
|
87 { |
|
88 return RMobilePhone::ENetworkModeUnknown; |
|
89 } |
|
90 |
|
91 void CCommsDbAccess::SetNetworkMode(RMobilePhone::TMobilePhoneNetworkMode) |
|
92 { |
|
93 } |
|
94 |
|
95 void CCommsDbAccess::GetDesL(const TDesC&, const TDesC& aField, TDes16& aValue) |
|
96 { |
|
97 |
|
98 if(aField == TPtrC(AGENT_NAME)) |
|
99 { |
|
100 _LIT(KAgentName, "StubbedAgent"); |
|
101 aValue = KAgentName(); |
|
102 } |
|
103 else |
|
104 { |
|
105 User::Invariant(); |
|
106 } |
|
107 } |
|
108 |
|
109 void CCommsDbAccess::GetIntL(const TDesC& aTable, const TDesC& aField, TUint32& aValue) |
|
110 { |
|
111 |
|
112 if (aTable == TPtrC(IAP) && aField == TPtrC(COMMDB_ID)) |
|
113 { |
|
114 aValue = 1; |
|
115 } |
|
116 else if(aTable == TPtrC(IAP) && aField == TPtrC(IAP_NETWORK)) |
|
117 { |
|
118 aValue = 1; |
|
119 } |
|
120 else if (aTable == TPtrC(MODEM_BEARER) && aField == TPtrC(MODEM_MIN_SIGNAL_LEVEL)) |
|
121 { |
|
122 aValue = 10500; |
|
123 } |
|
124 else |
|
125 { |
|
126 User::Invariant(); |
|
127 } |
|
128 } |
|
129 |
|
130 void CCommsDbAccess::SetOverridesL(CCommDbOverrideSettings*) |
|
131 { |
|
132 } |
|
133 |
|
134 void CCommsDbAccess::GetPreferedIapL(TUint32& aIapId, TCommDbConnectionDirection, TUint32) |
|
135 { |
|
136 aIapId = 1; |
|
137 } |
|
138 |
|
139 TBool CCommsDbAccess::DoesIapExistL(TUint32) |
|
140 { |
|
141 return ETrue; |
|
142 } |
|
143 |
|
144 void CCommsDbAccess::RequestNotificationOfServiceChangeL(MServiceChangeObserver*) |
|
145 { |
|
146 } |
|
147 |
|
148 void CCommsDbAccess::CancelRequestNotificationOfServiceChange(MServiceChangeObserver*) |
|
149 { |
|
150 } |
|
151 |