branch | RCL_3 |
changeset 14 | 9fdee5e1da30 |
parent 0 | 5e5d6b214f4f |
13:796276a1bdcc | 14:9fdee5e1da30 |
---|---|
24 |
24 |
25 #include "cvimpstenginecchhandler.h" |
25 #include "cvimpstenginecchhandler.h" |
26 #include "tvimpstconsts.h" |
26 #include "tvimpstconsts.h" |
27 |
27 |
28 #include "f32file.h" |
28 #include "f32file.h" |
29 #include "vimpstdebugtrace.h" |
29 #include "uiservicetabtracer.h" |
30 |
30 |
31 // CONSTANTS |
31 // CONSTANTS |
32 |
32 |
33 // ================= MEMBER FUNCTIONS ======================= |
33 // ================= MEMBER FUNCTIONS ======================= |
34 |
34 |
45 // CVIMPSTEngineCchHandler::ConstructL |
45 // CVIMPSTEngineCchHandler::ConstructL |
46 // --------------------------------------------------------------------------- |
46 // --------------------------------------------------------------------------- |
47 // |
47 // |
48 void CVIMPSTEngineCchHandler::ConstructL( ) |
48 void CVIMPSTEngineCchHandler::ConstructL( ) |
49 { |
49 { |
50 TRACE( T_LIT("CVIMPSTEngineCchHandler::ConstructL")); |
50 TRACER_AUTO; |
51 |
51 |
52 // Create service selection here |
52 // Create service selection here |
53 iCchClient = CCch::NewL(); |
53 iCchClient = CCch::NewL(); |
54 |
54 TRACE("CCch::NewL"); |
55 iSettingsStore = CVIMPSTSettingsStore::NewL(); |
55 iSettingsStore = CVIMPSTSettingsStore::NewL(); |
56 TRACE("CVIMPSTSettingsStore::NewL"); |
|
56 |
57 |
57 if (iCchClient) |
58 if (iCchClient) |
58 { |
59 { |
59 CCchService* service = iCchClient->GetService( iServiceId ); |
60 CCchService* service = iCchClient->GetService( iServiceId ); |
61 TRACE("CCch::GetService"); |
|
60 |
62 |
61 if( service ) |
63 if( service ) |
62 { |
64 { |
63 service->SetObserver( *this ); |
65 service->SetObserver( *this ); |
66 TRACE("CCchService::SetObserver"); |
|
64 } |
67 } |
65 } |
68 } |
66 |
69 |
67 //Configure CCHUI notes |
70 //Configure CCHUI notes |
68 MCchUi& cchUiApi = iCchClient->CchUiApi(); |
71 MCchUi& cchUiApi = iCchClient->CchUiApi(); |
72 TRACE("CCch::CchUiApi"); |
|
69 |
73 |
70 // Set observer to listen cchui events for change connection. |
74 // Set observer to listen cchui events for change connection. |
71 cchUiApi.AddObserverL( *this ); // parameter is MCchUiObserver |
75 cchUiApi.AddObserverL( *this ); // parameter is MCchUiObserver |
76 TRACE("MCchUi::CchUiApi"); |
|
72 |
77 |
73 // Configure CCHUI API to show all notes/dialogs except connecting note. |
78 // Configure CCHUI API to show all notes/dialogs except connecting note. |
74 // Also configure that only VoIP and IM subservices are allowed (notes are |
79 // Also configure that only VoIP and IM subservices are allowed (notes are |
75 // shown only for those). |
80 // shown only for those). |
76 RArray<MCchUiObserver::TCchUiDialogType> allowedNotes; |
81 RArray<MCchUiObserver::TCchUiDialogType> allowedNotes; |
82 TRACE("MCchUiObserver::TCchUiDialogType"); |
|
77 RArray<TCCHSubserviceType> allowedSubServices; |
83 RArray<TCCHSubserviceType> allowedSubServices; |
84 TRACE("TCCHSubserviceType"); |
|
78 CleanupClosePushL( allowedNotes ); |
85 CleanupClosePushL( allowedNotes ); |
86 TRACE("allowedNotes"); |
|
79 CleanupClosePushL( allowedSubServices ); |
87 CleanupClosePushL( allowedSubServices ); |
88 TRACE("allowedSubServices"); |
|
80 |
89 |
81 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeUsernamePasswordFailed ); |
90 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeUsernamePasswordFailed ); |
91 TRACE("ECchUiDialogTypeUsernamePasswordFailed"); |
|
82 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeAuthenticationFailed ); |
92 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeAuthenticationFailed ); |
93 TRACE("ECchUiDialogTypeAuthenticationFailed"); |
|
83 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionDefined ); |
94 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionDefined ); |
95 TRACE("ECchUiDialogTypeNoConnectionDefined"); |
|
84 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable ); |
96 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable ); |
97 TRACE("ECchUiDialogTypeNoConnectionAvailable"); |
|
85 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeConfirmChangeConnection ); |
98 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeConfirmChangeConnection ); |
99 TRACE("ECchUiDialogTypeConfirmChangeConnection"); |
|
86 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeChangeConnection ); |
100 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeChangeConnection ); |
101 TRACE("ECchUiDialogTypeChangeConnection"); |
|
87 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeDefectiveSettings ); |
102 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeDefectiveSettings ); |
88 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeErrorInConnection ); |
103 TRACE("ECchUiDialogTypeDefectiveSettings"); |
104 allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeErrorInConnection ); |
|
105 TRACE("ECchUiDialogTypeErrorInConnection"); |
|
89 |
106 |
90 allowedSubServices.AppendL( ECCHUnknown ); |
107 allowedSubServices.AppendL( ECCHUnknown ); |
108 TRACE("ECCHUnknown"); |
|
91 allowedSubServices.AppendL( ECCHVoIPSub ); |
109 allowedSubServices.AppendL( ECCHVoIPSub ); |
110 TRACE("ECCHVoIPSub"); |
|
92 allowedSubServices.AppendL( ECCHIMSub ); |
111 allowedSubServices.AppendL( ECCHIMSub ); |
112 TRACE("ECCHIMSub"); |
|
93 allowedSubServices.AppendL( ECCHPresenceSub ); |
113 allowedSubServices.AppendL( ECCHPresenceSub ); |
114 TRACE("ECCHPresenceSub"); |
|
94 |
115 |
95 cchUiApi.ConfigureVisualizationL( |
116 cchUiApi.ConfigureVisualizationL( |
96 allowedNotes, allowedSubServices ); |
117 allowedNotes, allowedSubServices ); |
118 TRACE("ConfigureVisualizationL"); |
|
97 |
119 |
98 CleanupStack::PopAndDestroy( &allowedSubServices ); |
120 CleanupStack::PopAndDestroy( &allowedSubServices ); |
121 TRACE("allowedSubServices::pop"); |
|
99 CleanupStack::PopAndDestroy( &allowedNotes ); |
122 CleanupStack::PopAndDestroy( &allowedNotes ); |
123 TRACE("allowedNotes::pop"); |
|
100 |
124 |
101 TRACE( T_LIT("CVIMPSTEngineCchHandler::ConstructL")); |
|
102 } |
125 } |
103 |
126 |
104 // --------------------------------------------------------------------------- |
127 // --------------------------------------------------------------------------- |
105 // CVIMPSTEngineCchHandler::NewL |
128 // CVIMPSTEngineCchHandler::NewL |
106 // --------------------------------------------------------------------------- |
129 // --------------------------------------------------------------------------- |
107 // |
130 // |
108 CVIMPSTEngineCchHandler* CVIMPSTEngineCchHandler::NewL(TUint aServiceId, |
131 CVIMPSTEngineCchHandler* CVIMPSTEngineCchHandler::NewL(TUint aServiceId, |
109 MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver ) |
132 MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver ) |
110 { |
133 { |
111 TRACE( T_LIT("CVIMPSTEngineCchHandler::NewL start")); |
134 TRACER_AUTO; |
112 TRACE( T_LIT("ServiceId: %d"), aServiceId ); |
135 TRACE("ServiceId: %d", aServiceId ); |
113 |
136 |
114 CVIMPSTEngineCchHandler* self = NewLC(aServiceId, aCchUiEventObserver ); |
137 CVIMPSTEngineCchHandler* self = NewLC(aServiceId, aCchUiEventObserver ); |
115 CleanupStack::Pop(self); |
138 CleanupStack::Pop(self); |
116 TRACE( T_LIT("CVIMPSTEngineCchHandler::NewL end")); |
|
117 return self; |
139 return self; |
118 } |
140 } |
119 |
141 |
120 // --------------------------------------------------------------------------- |
142 // --------------------------------------------------------------------------- |
121 // CVIMPSTEngineCchHandler::NewLC |
143 // CVIMPSTEngineCchHandler::NewLC |
122 // --------------------------------------------------------------------------- |
144 // --------------------------------------------------------------------------- |
123 // |
145 // |
124 CVIMPSTEngineCchHandler* CVIMPSTEngineCchHandler::NewLC(TUint aServiceId ,MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver) |
146 CVIMPSTEngineCchHandler* CVIMPSTEngineCchHandler::NewLC(TUint aServiceId ,MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver) |
125 { |
147 { |
148 TRACER_AUTO; |
|
126 CVIMPSTEngineCchHandler* self = |
149 CVIMPSTEngineCchHandler* self = |
127 new (ELeave) CVIMPSTEngineCchHandler(aServiceId, aCchUiEventObserver); |
150 new (ELeave) CVIMPSTEngineCchHandler(aServiceId, aCchUiEventObserver); |
128 |
151 |
129 TRACE( T_LIT("CVIMPSTEngineCchHandler::NewLC start")); |
152 TRACE("ServiceId: %d", aServiceId ); |
130 TRACE( T_LIT("ServiceId: %d"), aServiceId ); |
|
131 |
|
132 CleanupStack::PushL(self); |
153 CleanupStack::PushL(self); |
133 self->ConstructL( ); |
154 self->ConstructL( ); |
134 TRACE( T_LIT("CVIMPSTEngineCchHandler::NewLC end")); |
|
135 return self; |
155 return self; |
136 } |
156 } |
137 |
157 |
138 // --------------------------------------------------------------------------- |
158 // --------------------------------------------------------------------------- |
139 // CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler |
159 // CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler |
140 // --------------------------------------------------------------------------- |
160 // --------------------------------------------------------------------------- |
141 // |
161 // |
142 CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler() |
162 CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler() |
143 { |
163 { |
144 TRACE( T_LIT("CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler start") ); |
164 TRACER_AUTO; |
145 |
165 TRACE( "ServiceId: %d", iServiceId ); |
146 TRACE( T_LIT("ServiceId: %d"), iServiceId ); |
|
147 if(iCchClient) |
166 if(iCchClient) |
148 { |
167 { |
149 CCchService* service = iCchClient->GetService( iServiceId ); |
168 CCchService* service = iCchClient->GetService( iServiceId ); |
150 if( service ) |
169 if( service ) |
151 { |
170 { |
154 } |
173 } |
155 delete iCchClient; |
174 delete iCchClient; |
156 delete iSettingsStore; |
175 delete iSettingsStore; |
157 iObserverStructure.Reset(); |
176 iObserverStructure.Reset(); |
158 iObserverStructure.Close(); |
177 iObserverStructure.Close(); |
159 TRACE( T_LIT("CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler end")); |
|
160 } |
178 } |
161 |
179 |
162 // --------------------------------------------------------------------------- |
180 // --------------------------------------------------------------------------- |
163 // CVIMPSTEngineCchHandler::ShutdownCch |
181 // CVIMPSTEngineCchHandler::ShutdownCch |
164 // --------------------------------------------------------------------------- |
182 // --------------------------------------------------------------------------- |
165 // |
183 // |
166 //TODO: not used any where.. need to be removed. |
184 //TODO: not used any where.. need to be removed. |
167 void CVIMPSTEngineCchHandler::ShutdownCch() |
185 void CVIMPSTEngineCchHandler::ShutdownCch() |
168 { |
186 { |
169 TRACE( T_LIT("CVIMPSTEngineCchHandler::ShutdownCch start")); |
187 TRACER_AUTO; |
170 TRACE( T_LIT("ServiceId: %d"), iServiceId ); |
188 TRACE("ServiceId: %d", iServiceId ); |
171 |
|
172 if ( iCchClient ) |
189 if ( iCchClient ) |
173 { |
190 { |
174 delete iCchClient; |
191 delete iCchClient; |
175 iCchClient = NULL; |
192 iCchClient = NULL; |
176 } |
193 } |
177 |
194 |
178 TRACE( T_LIT("CVIMPSTEngineCchHandler::ShutdownCch end")); |
|
179 } |
195 } |
180 |
196 |
181 |
197 |
182 // --------------------------------------------------------------------------- |
198 // --------------------------------------------------------------------------- |
183 // CVIMPSTEngineCchHandler::GetServiceState |
199 // CVIMPSTEngineCchHandler::GetServiceState |
186 TInt CVIMPSTEngineCchHandler::GetServiceState(TUint aServiceId, |
202 TInt CVIMPSTEngineCchHandler::GetServiceState(TUint aServiceId, |
187 TInt aSubServiceType, |
203 TInt aSubServiceType, |
188 TCCHSubserviceState& aCCHState |
204 TCCHSubserviceState& aCCHState |
189 ) |
205 ) |
190 { |
206 { |
191 TRACE( T_LIT("CVIMPSTEngineCchHandler::GetServiceState")); |
207 TRACER_AUTO; |
192 |
208 |
193 TRACE( T_LIT("GetServiceState ServiceId: %d, SubServiceType:%d"), |
209 TRACE( "ServiceId: %d, SubServiceType:%d", aServiceId, aSubServiceType ); |
194 aServiceId, aSubServiceType ); |
|
195 |
|
196 TInt err = KErrNotFound; |
210 TInt err = KErrNotFound; |
197 if ( iCchClient ) |
211 if ( iCchClient ) |
198 { |
212 { |
199 CCchService* service = iCchClient->GetService( aServiceId ); |
213 CCchService* service = iCchClient->GetService( aServiceId ); |
200 TCchServiceStatus status; |
214 TCchServiceStatus status; |
208 { |
222 { |
209 aCCHState = status.State(); |
223 aCCHState = status.State(); |
210 } |
224 } |
211 } |
225 } |
212 } |
226 } |
213 TRACE( T_LIT("GetServiceState - aCCHState: (%d)"), aCCHState ); |
227 TRACE( "aCCHState: (%d)", aCCHState ); |
214 |
|
215 TRACE( T_LIT("CVIMPSTEngineCchHandler::GetServiceState")); |
|
216 |
228 |
217 return err; |
229 return err; |
218 } |
230 } |
219 |
231 |
220 |
232 |
222 // CVIMPSTEngineCchHandler::EnableService |
234 // CVIMPSTEngineCchHandler::EnableService |
223 // --------------------------------------------------------------------------- |
235 // --------------------------------------------------------------------------- |
224 // |
236 // |
225 TInt CVIMPSTEngineCchHandler::EnableService() |
237 TInt CVIMPSTEngineCchHandler::EnableService() |
226 { |
238 { |
227 TRACE( T_LIT("CVIMPSTEngineCchHandler::EnableService start")); |
239 TRACER_AUTO; |
228 TRACE( T_LIT("ServiceId: %d"), iServiceId ); |
240 TRACE( "ServiceId: %d", iServiceId ); |
229 |
|
230 TInt error = KErrNotFound; |
241 TInt error = KErrNotFound; |
231 if ( iCchClient ) |
242 if ( iCchClient ) |
232 { |
243 { |
233 iCchClient->SetConnectivityDialogsAllowed( ETrue ); |
244 iCchClient->SetConnectivityDialogsAllowed( ETrue ); |
234 |
245 |
235 CCchService* service = iCchClient->GetService( iServiceId ); |
246 CCchService* service = iCchClient->GetService( iServiceId ); |
236 if( service ) |
247 if( service ) |
237 { |
248 { |
238 TRACE( T_LIT("EnableService - CCHClient->Enable") ); |
249 TRACE( "CCHClient->Enable" ); |
239 error = service->Enable( ECCHUnknown ); |
250 error = service->Enable( ECCHUnknown ); |
240 } |
251 } |
241 } |
252 } |
242 |
253 |
243 TRACE( T_LIT("EnableService - stat: (%d)"), error ); |
254 TRACE( " stat: (%d)", error ); |
244 |
255 |
245 TRACE( T_LIT("CVIMPSTEngineCchHandler::EnableService")); |
|
246 |
256 |
247 return error; |
257 return error; |
248 |
258 |
249 } |
259 } |
250 |
260 |
252 // CVIMPSTEngineCchHandler::DisableService |
262 // CVIMPSTEngineCchHandler::DisableService |
253 // --------------------------------------------------------------------------- |
263 // --------------------------------------------------------------------------- |
254 // |
264 // |
255 TInt CVIMPSTEngineCchHandler::DisableService() |
265 TInt CVIMPSTEngineCchHandler::DisableService() |
256 { |
266 { |
257 TRACE( T_LIT( |
267 TRACER_AUTO; |
258 "CVIMPSTEngineCchHandler::DisableService start")); |
268 TRACE( "ServiceId: %d", iServiceId ); |
259 TRACE( T_LIT("ServiceId: %d"), iServiceId ); |
|
260 |
|
261 TInt error = KErrNotFound; |
269 TInt error = KErrNotFound; |
262 |
270 |
263 if(iCchClient) |
271 if(iCchClient) |
264 { |
272 { |
265 CCchService* service = iCchClient->GetService( iServiceId ); |
273 CCchService* service = iCchClient->GetService( iServiceId ); |
266 if( service ) |
274 if( service ) |
267 { |
275 { |
268 TRACE( T_LIT("DisableService - CCHClient->Disable") ); |
276 TRACE( "CCHClient->Disable" ); |
269 error = service->Disable( ECCHUnknown ); |
277 error = service->Disable( ECCHUnknown ); |
270 } |
278 } |
271 } |
279 } |
272 |
280 |
273 TRACE( T_LIT("DisableService - stat: (%d)"), error ); |
281 TRACE( "stat: (%d)", error ); |
274 |
282 |
275 TRACE( T_LIT("CVIMPSTEngineCchHandler::DisableService end")); |
|
276 |
283 |
277 return error; |
284 return error; |
278 |
285 |
279 } |
286 } |
280 |
287 |
286 void CVIMPSTEngineCchHandler::ServiceStatusChanged( |
293 void CVIMPSTEngineCchHandler::ServiceStatusChanged( |
287 TInt aServiceId, |
294 TInt aServiceId, |
288 const TCCHSubserviceType aType, |
295 const TCCHSubserviceType aType, |
289 const TCchServiceStatus& aServiceStatus ) |
296 const TCchServiceStatus& aServiceStatus ) |
290 { |
297 { |
291 |
298 TRACER_AUTO; |
292 TRACE( T_LIT("CVIMPSTEngineCchHandler::ServiceStatusChanged start")); |
299 |
293 // Disable the service only if the login to one of the subservices fails |
300 // Disable the service only if the login to one of the subservices fails |
294 // 1.ECCHVoIPSub |
301 // 1.ECCHVoIPSub |
295 // 2.ECCHPresenceSub |
302 // 2.ECCHPresenceSub |
296 // 3.ECCHIMSub |
303 // 3.ECCHIMSub |
297 if( aServiceStatus.Error() == KCCHErrorLoginFailed && |
304 if( aServiceStatus.Error() == KCCHErrorLoginFailed && |
317 aServiceStatus.State(), |
324 aServiceStatus.State(), |
318 aServiceStatus.Error() )); |
325 aServiceStatus.Error() )); |
319 } |
326 } |
320 } |
327 } |
321 |
328 |
322 TRACE( T_LIT("CVIMPSTEngineCchHandler::ServiceStatusChanged end")); |
|
323 } |
329 } |
324 |
330 |
325 // --------------------------------------------------------------------------- |
331 // --------------------------------------------------------------------------- |
326 // CVIMPSTEngineCchHandler::RegisterCchObserverL |
332 // CVIMPSTEngineCchHandler::RegisterCchObserverL |
327 // --------------------------------------------------------------------------- |
333 // --------------------------------------------------------------------------- |
328 // |
334 // |
329 void CVIMPSTEngineCchHandler::RegisterCchObserverL(MVIMPSTEngineCchHandlerObserver* aObserver, |
335 void CVIMPSTEngineCchHandler::RegisterCchObserverL(MVIMPSTEngineCchHandlerObserver* aObserver, |
330 TCCHSubserviceType aSubServiceType ) |
336 TCCHSubserviceType aSubServiceType ) |
331 { |
337 { |
332 TRACE( T_LIT("CVIMPSTEngineCchHandler::RegisterCchObserverL start" )); |
338 TRACER_AUTO; |
333 if(aObserver) |
339 if(aObserver) |
334 { |
340 { |
335 TObserverStructure obsstruct; |
341 TObserverStructure obsstruct; |
336 obsstruct.iObserver = aObserver; |
342 obsstruct.iObserver = aObserver; |
337 obsstruct.iSubserviceType = aSubServiceType; |
343 obsstruct.iSubserviceType = aSubServiceType; |
338 iObserverStructure.Append(obsstruct); |
344 iObserverStructure.Append(obsstruct); |
339 } |
345 } |
340 |
346 |
341 TRACE( T_LIT("CVIMPSTEngineCchHandler::RegisterCchObserverL end")); |
|
342 } |
347 } |
343 // --------------------------------------------------------------------------- |
348 // --------------------------------------------------------------------------- |
344 // CVIMPSTEngineCchHandler::UnRegisterCchObserver |
349 // CVIMPSTEngineCchHandler::UnRegisterCchObserver |
345 // --------------------------------------------------------------------------- |
350 // --------------------------------------------------------------------------- |
346 // |
351 // |
347 void CVIMPSTEngineCchHandler::UnRegisterCchObserver(TCCHSubserviceType aSubServiceType ) |
352 void CVIMPSTEngineCchHandler::UnRegisterCchObserver(TCCHSubserviceType aSubServiceType ) |
348 { |
353 { |
349 TRACE( T_LIT("CVIMPSTEngineCchHandler::UnRegisterCchObserver start" )); |
354 TRACER_AUTO; |
350 TInt count = iObserverStructure.Count(); |
355 TInt count = iObserverStructure.Count(); |
351 for(TInt i = 0; i < count; i++) |
356 for(TInt i = 0; i < count; i++) |
352 { |
357 { |
353 if(aSubServiceType == iObserverStructure[i].iSubserviceType) |
358 if(aSubServiceType == iObserverStructure[i].iSubserviceType) |
354 { |
359 { |
356 iObserverStructure.Remove(i); |
361 iObserverStructure.Remove(i); |
357 iObserverStructure.Compress(); |
362 iObserverStructure.Compress(); |
358 break; |
363 break; |
359 } |
364 } |
360 } |
365 } |
361 TRACE( T_LIT("CVIMPSTEngineCchHandler::UnRegisterCchObserver end")); |
|
362 } |
366 } |
363 |
367 |
364 // --------------------------------------------------------------------------- |
368 // --------------------------------------------------------------------------- |
365 // CVIMPSTEngineCchHandler::GetConParametersL |
369 // CVIMPSTEngineCchHandler::GetConParametersL |
366 // --------------------------------------------------------------------------- |
370 // --------------------------------------------------------------------------- |
367 // |
371 // |
368 HBufC* CVIMPSTEngineCchHandler::GetConParametersL( |
372 HBufC* CVIMPSTEngineCchHandler::GetConParametersL( |
369 TCchConnectionParameter aConnParam ) |
373 TCchConnectionParameter aConnParam ) |
370 { |
374 { |
371 TRACE( T_LIT("CVIMPSTEngineCchHandler::GetConParametersL start")); |
375 TRACER_AUTO; |
372 TRACE( T_LIT("ServiceId: %d"), iServiceId ); |
376 TRACE( "ServiceId: %d", iServiceId ); |
373 TRACE( T_LIT("GetConParametersL - TCchConnectionParameter aConnParam: (%d)"), aConnParam ); |
377 TRACE( "TCchConnectionParameter aConnParam: (%d)", aConnParam ); |
374 |
|
375 HBufC* temp = NULL; |
378 HBufC* temp = NULL; |
376 TInt error = KErrNotFound; |
379 TInt error = KErrNotFound; |
377 if(iCchClient) |
380 if(iCchClient) |
378 { |
381 { |
379 CCchService* service = iCchClient->GetService( iServiceId ); |
382 CCchService* service = iCchClient->GetService( iServiceId ); |
381 { |
384 { |
382 RBuf buffer; |
385 RBuf buffer; |
383 CleanupClosePushL( buffer ); |
386 CleanupClosePushL( buffer ); |
384 buffer.CreateL(KVIMPSTUISPSMaxPropertyLength); |
387 buffer.CreateL(KVIMPSTUISPSMaxPropertyLength); |
385 |
388 |
386 TRACE( T_LIT("GetConParametersL - CCHClient->GetConnectionParameter") ); |
389 TRACE( "CCHClient->GetConnectionParameter" ); |
387 error = service->GetConnectionParameter(ECCHUnknown,aConnParam,buffer); |
390 error = service->GetConnectionParameter(ECCHUnknown,aConnParam,buffer); |
388 User::LeaveIfError( error); |
391 User::LeaveIfError( error); |
389 |
392 |
390 //extract only the user id in case |
393 //extract only the user id in case |
391 // Check for prefix and remove if found |
394 // Check for prefix and remove if found |
392 TInt prefixLocation = buffer.Locate( ':' ); |
395 TInt prefixLocation = buffer.Locate( ':' ); |
393 if ( KErrNotFound != prefixLocation && ECchUsername == aConnParam ) |
396 if ( KErrNotFound != prefixLocation && ECchUsername == aConnParam ) |
394 { |
397 { |
395 TRACE( T_LIT("[CVIMPSTStorageContact::GetServiceFieldsL] -> Prefix found -> remove")); |
398 TRACE( "Prefix found -> remove"); |
396 temp = buffer.Mid(prefixLocation+1 ).AllocL(); // ownership transferred |
399 temp = buffer.Mid(prefixLocation+1 ).AllocL(); // ownership transferred |
397 } |
400 } |
398 else |
401 else |
399 { |
402 { |
400 TRACE( T_LIT("[CVIMPSTStorageContact::GetServiceFieldsL] -> No Prefix found")); |
403 TRACE("No Prefix found"); |
401 temp = buffer.AllocL(); // ownership transferred |
404 temp = buffer.AllocL(); // ownership transferred |
402 } |
405 } |
403 TRACE( T_LIT("GetConParametersL - Return Value: Error: %d "), error ); |
406 TRACE( "Return Value: Error: %d ", error ); |
404 CleanupStack::PopAndDestroy( &buffer ); |
407 CleanupStack::PopAndDestroy( &buffer ); |
405 } |
408 } |
406 } |
409 } |
407 TRACE( T_LIT("CVIMPSTEngineCchHandler::GetConParametersL")); |
|
408 return temp; |
410 return temp; |
409 } |
411 } |
410 |
412 |
411 |
413 |
412 // --------------------------------------------------------------------------- |
414 // --------------------------------------------------------------------------- |
415 // |
417 // |
416 TInt CVIMPSTEngineCchHandler::SetConnectionParameter( |
418 TInt CVIMPSTEngineCchHandler::SetConnectionParameter( |
417 TCchConnectionParameter aConnParam, |
419 TCchConnectionParameter aConnParam, |
418 const TDesC& aConnParamValue ) |
420 const TDesC& aConnParamValue ) |
419 { |
421 { |
420 TRACE( T_LIT("CVIMPSTEngineCchHandler::SetConnectionParameter start")); |
422 TRACER_AUTO; |
421 TRACE( T_LIT("ServiceId: %d"), iServiceId ); |
423 TRACE( "ServiceId: %d", iServiceId ); |
422 TRACE( T_LIT("SetConnectionParameter - TCchConnectionParameter aConnParam: (%d)"), aConnParam ); |
424 TRACE( "TCchConnectionParameter aConnParam: (%d)", aConnParam ); |
423 |
|
424 TInt error = KErrNotFound; |
425 TInt error = KErrNotFound; |
425 if(iCchClient) |
426 if(iCchClient) |
426 { |
427 { |
427 CCchService* service = iCchClient->GetService( iServiceId ); |
428 CCchService* service = iCchClient->GetService( iServiceId ); |
428 TRACE( T_LIT("SetConnectionParameter - CCHClient->SetConnectionParameter") ); |
429 TRACE( "CCHClient->SetConnectionParameter"); |
429 |
|
430 if (service) |
430 if (service) |
431 { |
431 { |
432 error = service->SetConnectionParameter( |
432 error = service->SetConnectionParameter( |
433 ECCHUnknown, aConnParam, aConnParamValue ); |
433 ECCHUnknown, aConnParam, aConnParamValue ); |
434 } |
434 } |
435 } |
435 } |
436 TRACE( T_LIT("SetConnectionParameter - error: %d"), error ); |
436 TRACE( "error: %d", error ); |
437 TRACE( T_LIT("CVIMPSTEngineCchHandler::SetConnectionParameter end")); |
|
438 return error; |
437 return error; |
439 } |
438 } |
440 |
439 |
441 |
440 |
442 |
441 |
445 // CVIMPSTEngineCchHandler::ChangeConnectionL |
444 // CVIMPSTEngineCchHandler::ChangeConnectionL |
446 // --------------------------------------------------------------------------- |
445 // --------------------------------------------------------------------------- |
447 // |
446 // |
448 TInt CVIMPSTEngineCchHandler::ChangeConnectionL() |
447 TInt CVIMPSTEngineCchHandler::ChangeConnectionL() |
449 { |
448 { |
450 TRACE( T_LIT("CVIMPSTEngineCchHandler::ChangeConnection start") ); |
449 TRACER_AUTO; |
451 TRACE( T_LIT("ServiceId: %d"), iServiceId ); |
450 TRACE( "ServiceId: %d", iServiceId ); |
452 |
451 |
453 TInt err = KErrNone; |
452 TInt err = KErrNone; |
454 if (iCchClient) |
453 if (iCchClient) |
455 { |
454 { |
456 MCchUi& cchUiApi = iCchClient->CchUiApi(); |
455 MCchUi& cchUiApi = iCchClient->CchUiApi(); |
457 TRAP(err, cchUiApi.ShowDialogL(iServiceId, |
456 TRAP(err, cchUiApi.ShowDialogL(iServiceId, |
458 MCchUiObserver::ECchUiDialogTypeChangeConnection);); |
457 MCchUiObserver::ECchUiDialogTypeChangeConnection);); |
459 } |
458 } |
460 TRACE( T_LIT("CVIMPSTEngineCchHandler::ChangeConnection end ")); |
|
461 |
459 |
462 return err; |
460 return err; |
463 } |
461 } |
464 |
462 |
465 |
463 |
478 // Returns true if password is present in the settings else returns false |
476 // Returns true if password is present in the settings else returns false |
479 // --------------------------------------------------------------------------- |
477 // --------------------------------------------------------------------------- |
480 // |
478 // |
481 TBool CVIMPSTEngineCchHandler::IsPasswordAvailable(TCchConnectionParameter aConnParam ) |
479 TBool CVIMPSTEngineCchHandler::IsPasswordAvailable(TCchConnectionParameter aConnParam ) |
482 { |
480 { |
483 TRACE( T_LIT("CVIMPSTEngineCchHandler::IsPasswordAvailableL start")); |
481 TRACER_AUTO; |
484 TRACE( T_LIT("IsPasswordAvailableL - TCchConnectionParameter aConnParam: (%d)"), aConnParam ); |
482 TRACE( "TCchConnectionParameter aConnParam: (%d)", aConnParam ); |
485 TInt passwordSet = EFalse; |
483 TInt passwordSet = EFalse; |
486 if(iCchClient) |
484 if(iCchClient) |
487 { |
485 { |
488 CCchService* service = iCchClient->GetService( iServiceId ); |
486 CCchService* service = iCchClient->GetService( iServiceId ); |
489 if( service ) |
487 if( service ) |
490 { |
488 { |
491 TRACE( T_LIT("GetConParametersL - CCHClient->GetConnectionParameter") ); |
489 TRACE( "CCHClient->GetConnectionParameter"); |
492 service->GetConnectionParameter( ECCHUnknown,aConnParam,passwordSet ); |
490 service->GetConnectionParameter( ECCHUnknown,aConnParam,passwordSet ); |
493 } |
491 } |
494 } |
492 } |
495 TRACE( T_LIT("CVIMPSTEngineCchHandler::IsPasswordAvailableL end")); |
|
496 return passwordSet; |
493 return passwordSet; |
497 } |
494 } |
498 |
495 |
499 // --------------------------------------------------------------------------- |
496 // --------------------------------------------------------------------------- |
500 // CVIMPSTEngineCchHandler::ConnectivityDialogsCompletedL |
497 // CVIMPSTEngineCchHandler::ConnectivityDialogsCompletedL |
502 // |
499 // |
503 |
500 |
504 void CVIMPSTEngineCchHandler::ConnectivityDialogsCompletedL( |
501 void CVIMPSTEngineCchHandler::ConnectivityDialogsCompletedL( |
505 TInt aServiceId, MCchUiObserver::TCchUiOperationResult aOperationResult ) |
502 TInt aServiceId, MCchUiObserver::TCchUiOperationResult aOperationResult ) |
506 { |
503 { |
504 TRACER_AUTO; |
|
507 if((iServiceId == aServiceId)&&(aOperationResult == ECchUiClientOperationResultConnectionChanged)) |
505 if((iServiceId == aServiceId)&&(aOperationResult == ECchUiClientOperationResultConnectionChanged)) |
508 { |
506 { |
509 iCchUiEventObserver.HandleChangeConnectionEventL(); |
507 iCchUiEventObserver.HandleChangeConnectionEventL(); |
510 } |
508 } |
511 } |
509 } |