18 |
18 |
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <msvapi.h> |
22 #include <msvapi.h> |
23 #include <ApDataHandler.h> |
|
24 #include <ApAccessPointItem.h> |
|
25 #include <CWPCharacteristic.h> |
23 #include <CWPCharacteristic.h> |
26 #include <CWPParameter.h> |
24 #include <CWPParameter.h> |
27 #include <CWPAdapter.h> |
25 #include <CWPAdapter.h> |
28 #include <centralrepository.h> |
26 #include <centralrepository.h> |
29 #include <browseruisdkcrkeys.h> |
27 #include <browseruisdkcrkeys.h> |
48 const TDesC& aBookmarkTitle, |
46 const TDesC& aBookmarkTitle, |
49 const TDesC& aDefaultName, |
47 const TDesC& aDefaultName, |
50 const TDesC& aDefaultBookmarkName, |
48 const TDesC& aDefaultBookmarkName, |
51 CWPCharacteristic& aCharacteristic, |
49 CWPCharacteristic& aCharacteristic, |
52 CCommsDatabase*& aCommsDb, |
50 CCommsDatabase*& aCommsDb, |
53 CApDataHandler*& aAPHandler, |
51 RCmManagerExt*& aCmManager, |
54 RFavouritesDb aBookmarkDb |
52 RFavouritesDb aBookmarkDb |
55 ) |
53 ) |
56 : CWPWAPItemBase( aTitle, |
54 : CWPWAPItemBase( aTitle, |
57 aDefaultName, |
55 aDefaultName, |
58 aCharacteristic, |
56 aCharacteristic, |
59 aCommsDb, |
57 aCommsDb, |
60 aAPHandler ), |
58 aCmManager ), |
61 iDefaultBookmarkName( aDefaultBookmarkName ), |
59 iDefaultBookmarkName( aDefaultBookmarkName ), |
62 iBookmarkTitle( aBookmarkTitle ), |
60 iBookmarkTitle( aBookmarkTitle ), |
63 iDb( aBookmarkDb ), |
61 iDb( aBookmarkDb ), |
64 iFirst( aFirst ) |
62 iFirst( aFirst ) |
65 { |
63 { |
85 const TDesC& aBookmarkTitle, |
83 const TDesC& aBookmarkTitle, |
86 const TDesC& aDefaultName, |
84 const TDesC& aDefaultName, |
87 const TDesC& aDefaultBookmarkName, |
85 const TDesC& aDefaultBookmarkName, |
88 CWPCharacteristic& aCharacteristic, |
86 CWPCharacteristic& aCharacteristic, |
89 CCommsDatabase*& aCommsDb, |
87 CCommsDatabase*& aCommsDb, |
90 CApDataHandler*& aAPHandler, |
88 RCmManagerExt*& aCmManager, |
91 RFavouritesDb aBookmarkDb |
89 RFavouritesDb aBookmarkDb |
92 ) |
90 ) |
93 { |
91 { |
94 CWPWAPBrowserItem* self = new(ELeave) CWPWAPBrowserItem( aFirst, |
92 CWPWAPBrowserItem* self = new(ELeave) CWPWAPBrowserItem( aFirst, |
95 aTitle, |
93 aTitle, |
96 aBookmarkTitle, |
94 aBookmarkTitle, |
97 aDefaultName, |
95 aDefaultName, |
98 aDefaultBookmarkName, |
96 aDefaultBookmarkName, |
99 aCharacteristic, |
97 aCharacteristic, |
100 aCommsDb, |
98 aCommsDb, |
101 aAPHandler, |
99 aCmManager, |
102 aBookmarkDb ); |
100 aBookmarkDb ); |
103 CleanupStack::PushL(self); |
101 CleanupStack::PushL(self); |
104 self->ConstructL(); |
102 self->ConstructL(); |
105 CleanupStack::Pop(self); |
103 CleanupStack::Pop(self); |
106 return self; |
104 return self; |
128 // TUin32. |
126 // TUin32. |
129 if( iLink && iLink->Data().Length() == uid.MaxLength() ) |
127 if( iLink && iLink->Data().Length() == uid.MaxLength() ) |
130 { |
128 { |
131 uid.Copy( iLink->Data() ); |
129 uid.Copy( iLink->Data() ); |
132 } |
130 } |
133 |
131 RCmConnectionMethodExt cm; |
134 CApAccessPointItem* apItem = CApAccessPointItem::NewLC(); |
132 cm = iCmManager->ConnectionMethodL( iUID ); |
135 // will leave if AP does not exists |
133 CleanupClosePushL( cm ); |
136 iAPHandler->AccessPointDataL( iUID, *apItem ); |
|
137 if( iAddr ) |
134 if( iAddr ) |
138 { |
135 { |
139 // Update the access point startpage |
136 // Update the access point startpage |
140 WriteHomePageL( *apItem ); |
137 WriteHomePageL( cm ); |
141 } |
138 } |
142 CleanupStack::PopAndDestroy(); // apItem |
139 CleanupStack::PopAndDestroy(); // cm |
143 } |
140 } |
144 |
141 |
145 // ----------------------------------------------------------------------------- |
142 // ----------------------------------------------------------------------------- |
146 // CWPWAPBrowserItem::CanSetAsDefault |
143 // CWPWAPBrowserItem::CanSetAsDefault |
147 // ----------------------------------------------------------------------------- |
144 // ----------------------------------------------------------------------------- |
157 // |
154 // |
158 void CWPWAPBrowserItem::SetAsDefaultL() |
155 void CWPWAPBrowserItem::SetAsDefaultL() |
159 { |
156 { |
160 FLOG( _L( "[Provisioning] CWPWAPBrowserItem::SetAsDefaultL:" ) ); |
157 FLOG( _L( "[Provisioning] CWPWAPBrowserItem::SetAsDefaultL:" ) ); |
161 |
158 |
162 CreateDbL(); |
159 /* CreateDbL(); |
163 TRAPD( err, iAPHandler->SetAsDefaultL( (TInt)iUID, EIspTypeWAPOnly) ); |
160 TRAPD( err, iAPHandler->SetAsDefaultL( (TInt)iUID, EIspTypeWAPOnly) ); |
164 if( err == KErrLocked ) |
161 if( err == KErrLocked ) |
165 { |
162 { |
166 err = EWPCommsDBLocked; |
163 err = EWPCommsDBLocked; |
167 } |
164 } |
194 } |
191 } |
195 |
192 |
196 CleanupStack::PopAndDestroy(); // repository |
193 CleanupStack::PopAndDestroy(); // repository |
197 FLOG( _L( "[Provisioning] CWPWAPBrowserItem::SetAsDefaultL: Set Done" ) ); |
194 FLOG( _L( "[Provisioning] CWPWAPBrowserItem::SetAsDefaultL: Set Done" ) ); |
198 |
195 |
199 User::LeaveIfError( err ); |
196 User::LeaveIfError( err );*/ |
200 } |
197 } |
201 |
198 |
202 // ----------------------------------------------------------------------------- |
199 // ----------------------------------------------------------------------------- |
203 // CWPWAPBrowserItem::ValidateL |
200 // CWPWAPBrowserItem::ValidateL |
204 // ----------------------------------------------------------------------------- |
201 // ----------------------------------------------------------------------------- |