199 // if we have status name then we parse it |
190 // if we have status name then we parse it |
200 if ( leftBoundary != rightBoundary && |
191 if ( leftBoundary != rightBoundary && |
201 leftBoundary != KErrNotFound && |
192 leftBoundary != KErrNotFound && |
202 rightBoundary != KErrNotFound ) |
193 rightBoundary != KErrNotFound ) |
203 { |
194 { |
|
195 LOG_WRITE( "status name exists" ); |
204 TPtrC begin = fullText.Mid( leftBoundary, |
196 TPtrC begin = fullText.Mid( leftBoundary, |
205 rightBoundary - leftBoundary + 1 ); |
197 rightBoundary - leftBoundary + 1 ); |
206 localCurrentStatusText = begin.AllocLC(); |
198 localCurrentStatusText = begin.AllocLC(); |
207 localCurrentNetworkName = begin.AllocLC(); |
199 localCurrentNetworkName = begin.AllocLC(); |
208 |
200 |
209 TPtrC end = fullText.Mid( rightBoundary + 1 ); |
201 TPtrC end = fullText.Mid( rightBoundary + 1 ); |
210 localCurrentTypeText = end.AllocLC(); |
|
211 } |
202 } |
212 else |
203 else |
213 { |
204 { |
|
205 LOG_WRITE( "status name does not exist" ); |
214 localCurrentStatusText = fullText.AllocLC(); |
206 localCurrentStatusText = fullText.AllocLC(); |
215 delete localCurrentTypeText; |
|
216 localCurrentTypeText = NULL; |
|
217 } |
207 } |
218 |
208 |
219 //Connected |
209 //Connected |
220 if ( localCurrentNetworkName ) |
210 if ( localCurrentNetworkName ) |
221 { |
211 { |
222 if ( iAiModel->Connected() ) |
212 if ( iAiModel->Connected() ) |
223 { |
213 { |
|
214 LOG_WRITE( "ai model is connected" ); |
224 if ( !iConnectedTo ) |
215 if ( !iConnectedTo ) |
225 { |
216 { |
226 iConnectedTo = StringLoader::LoadL( |
217 iConnectedTo = StringLoader::LoadL( |
227 R_QTN_SNIFFER_PLUG_IN_CONNECTED_TO ); |
218 R_QTN_SNIFFER_PLUG_IN_CONNECTED_TO ); |
228 } |
219 } |
250 |
243 |
251 for ( iCurrentObserverIndex = 0; |
244 for ( iCurrentObserverIndex = 0; |
252 iCurrentObserverIndex < iObservers.Count(); |
245 iCurrentObserverIndex < iObservers.Count(); |
253 ++iCurrentObserverIndex ) |
246 ++iCurrentObserverIndex ) |
254 { |
247 { |
|
248 LOG_WRITEF( "Start publish - index = %d", iCurrentObserverIndex ); |
|
249 |
255 MAiContentObserver* observer = iObservers[iCurrentObserverIndex]; |
250 MAiContentObserver* observer = iObservers[iCurrentObserverIndex]; |
256 observer->StartTransaction( reinterpret_cast<TInt32>( this ) ); |
251 observer->StartTransaction( reinterpret_cast<TInt32>( this ) ); |
257 // make sure we cancel the tracsaction if leaves |
252 // make sure we cancel the tracsaction if leaves |
258 CleanupStack::PushL( TCleanupItem( PublishCleanup, this ) ); |
253 CleanupStack::PushL( TCleanupItem( PublishCleanup, this ) ); |
259 |
254 |
260 // Publish Full Text if Classic or Navigation Bar Classic used |
|
261 if ( localFullText ) |
|
262 { |
|
263 published = PublishText( observer, |
|
264 EAiWizardContentFullText, |
|
265 *localFullText ) || published; |
|
266 } |
|
267 |
|
268 // Publish Navigation Bar Icon: EAiWizardContentNaviBarIcon |
|
269 published = PublishIconL( observer, |
|
270 EAiWizardContentNaviBarIcon, |
|
271 KNaviBarIcon ) || published; |
|
272 |
|
273 // Publish Application Title: EAiWizardContentTitleText |
|
274 if ( !iWlanTitle ) |
|
275 { |
|
276 iWlanTitle = StringLoader::LoadL( R_QTN_AI_WIZARD_TITLE ); |
|
277 } |
|
278 if ( iWlanTitle ) |
|
279 { |
|
280 published = PublishText( observer, |
|
281 EAiWizardContentTitleText, |
|
282 *iWlanTitle ) || published; |
|
283 } |
|
284 |
|
285 if ( localCurrentStatusText ) |
255 if ( localCurrentStatusText ) |
286 { |
256 { |
|
257 LOG_WRITE( "Publish -> status icon" ); |
287 // Publish Status icon: EAiWizardContentStatusIcon |
258 // Publish Status icon: EAiWizardContentStatusIcon |
288 iconId = aPublishIconArray->At( 0 ); |
259 iconId = aPublishIconArray->At( 0 ); |
289 published = PublishIconL( observer, |
260 published = PublishIconL( observer, |
290 EAiWizardContentStatusIcon, |
261 EAiWizardContentStatusIcon, |
291 iconId ) || published; |
262 iconId ) || published; |
292 |
263 } |
293 // Publish Status text: EAiWizardContentStatusText |
264 |
294 published = PublishText( observer, |
265 LOG_WRITE( "Publish -> Strength icon" ); |
295 EAiWizardContentStatusText, |
|
296 *localCurrentStatusText ) || published; |
|
297 } |
|
298 |
|
299 if ( localCurrentTypeText ) |
|
300 { |
|
301 // Publish Type icon: EAiWizardContentTypeIcon |
|
302 published = PublishIconL( observer, |
|
303 EAiWizardContentTypeIcon, |
|
304 KTransparentIcon ) || published; |
|
305 |
|
306 // Publish Type text: EAiWizardContentTypeText |
|
307 published = PublishText( observer, |
|
308 EAiWizardContentTypeText, |
|
309 *localCurrentTypeText ) || published; |
|
310 } |
|
311 |
|
312 // Publish Strength icon: EAiWizardContentStrengthIcon |
266 // Publish Strength icon: EAiWizardContentStrengthIcon |
313 iconId = aPublishIconArray->At( 2 ); |
267 iconId = aPublishIconArray->At( 2 ); |
314 published = PublishIconL( observer, |
268 published = PublishIconL( observer, |
315 EAiWizardContentStrengthIcon, |
269 EAiWizardContentStrengthIcon, |
316 iconId ) || published; |
270 iconId ) || published; |
317 |
271 |
318 // Publish Strength text: EAiWizardContentStrengthText |
272 LOG_WRITE( "Publish -> secure icon" ); |
319 if ( iCurrentSignalStrength && iScanState ) |
|
320 { |
|
321 published = PublishText( observer, |
|
322 EAiWizardContentStrengthText, |
|
323 *iCurrentSignalStrength ) || published; |
|
324 } |
|
325 |
|
326 // Publish Secure icon: EAiWizardContentSecureIcon |
273 // Publish Secure icon: EAiWizardContentSecureIcon |
327 iconId = aPublishIconArray->At( 1 ); |
274 iconId = aPublishIconArray->At( 1 ); |
328 published = PublishIconL( observer, |
275 published = PublishIconL( observer, |
329 EAiWizardContentSecureIcon, |
276 EAiWizardContentSecureIcon, |
330 iconId ) || published; |
277 iconId ) || published; |
331 |
|
332 // Publish Secure text: EAiWizardContentSecureText |
|
333 if ( iCurrentSecureInfo && iScanState ) |
|
334 { |
|
335 published = PublishText( observer, |
|
336 EAiWizardContentSecureText, |
|
337 *iCurrentSecureInfo ) || published; |
|
338 } |
|
339 |
278 |
340 if ( localCurrentNetworkName ) |
279 if ( localCurrentNetworkName ) |
341 { |
280 { |
|
281 LOG_WRITE( "Publish -> localCurrentNetworkName" ); |
342 // Publish NetworkName text: EAiWizardContentNetworkName |
282 // Publish NetworkName text: EAiWizardContentNetworkName |
343 published = PublishText( observer, |
283 published = PublishText( observer, |
344 EAiWizardContentNetworkName, |
284 EAiWizardContentNetworkName, |
345 *localCurrentNetworkName ) || published; |
285 *localCurrentNetworkName ) || published; |
346 } |
286 } |
347 |
287 |
348 if ( localCurrentNetworkStatus ) |
288 if ( localCurrentNetworkStatus ) |
349 { |
289 { |
|
290 LOG_WRITE( "Publish -> localCurrentNetworkStatus" ); |
350 // Publish NetworkName text: EAiWizardContentNetworkName |
291 // Publish NetworkName text: EAiWizardContentNetworkName |
351 published = PublishText( observer, |
292 published = PublishText( observer, |
352 EAiWizardContentNetworkStatus, |
293 EAiWizardContentNetworkStatus, |
353 *localCurrentNetworkStatus ) || published; |
294 *localCurrentNetworkStatus ) || published; |
354 } |
295 } |
355 |
296 |
356 // If we published something then commit, |
297 // If we published something then commit, |
357 // otherwise cancel transaction |
298 // otherwise cancel transaction |
358 if ( published ) |
299 if ( published ) |
359 { |
300 { |
|
301 LOG_WRITE( "Commit" ); |
360 observer->Commit( reinterpret_cast<TInt32>( this ) ); |
302 observer->Commit( reinterpret_cast<TInt32>( this ) ); |
361 published = EFalse; |
303 published = EFalse; |
362 } |
304 } |
363 else |
305 else |
364 { |
306 { |
|
307 LOG_WRITE( "Cancel transaction" ); |
365 observer->CancelTransaction( reinterpret_cast<TInt32>( this ) ); |
308 observer->CancelTransaction( reinterpret_cast<TInt32>( this ) ); |
366 } |
309 } |
367 CleanupStack::Pop( 1 ); // PublishCleanup() |
310 CleanupStack::Pop( 1 ); // PublishCleanup() |
368 } |
311 } |
369 |
312 |
370 if ( localCurrentTypeText ) |
313 LOG_WRITE( "Publishing ready" ); |
371 { |
|
372 CleanupStack::PopAndDestroy( localCurrentTypeText ); |
|
373 } |
|
374 |
314 |
375 if ( localCurrentNetworkName ) |
315 if ( localCurrentNetworkName ) |
376 { |
316 { |
377 CleanupStack::PopAndDestroy( localCurrentNetworkName ); |
317 CleanupStack::PopAndDestroy( localCurrentNetworkName ); |
378 } |
318 } |
568 { |
505 { |
569 MAiContentObserver* observer = iObservers[i]; |
506 MAiContentObserver* observer = iObservers[i]; |
570 |
507 |
571 observer->StartTransaction( reinterpret_cast<TInt32>( this ) ); |
508 observer->StartTransaction( reinterpret_cast<TInt32>( this ) ); |
572 |
509 |
573 observer->Clean( *this, EAiWizardContentNaviBarIcon, |
|
574 EAiWizardContentNaviBarIcon ); |
|
575 observer->Clean( *this, EAiWizardContentTitleText, |
|
576 EAiWizardContentTitleText ); |
|
577 observer->Clean( *this, EAiWizardContentStatusIcon, |
510 observer->Clean( *this, EAiWizardContentStatusIcon, |
578 EAiWizardContentStatusIcon ); |
511 EAiWizardContentStatusIcon ); |
579 observer->Clean( *this, EAiWizardContentStatusText, |
|
580 EAiWizardContentStatusText ); |
|
581 observer->Clean( *this, EAiWizardContentTypeIcon, |
|
582 EAiWizardContentTypeIcon ); |
|
583 observer->Clean( *this, EAiWizardContentTypeText, |
|
584 EAiWizardContentTypeText ); |
|
585 observer->Clean( *this, EAiWizardContentStrengthIcon, |
512 observer->Clean( *this, EAiWizardContentStrengthIcon, |
586 EAiWizardContentStrengthIcon ); |
513 EAiWizardContentStrengthIcon ); |
587 observer->Clean( *this, EAiWizardContentStrengthText, |
|
588 EAiWizardContentStrengthText ); |
|
589 observer->Clean( *this, EAiWizardContentSecureIcon, |
514 observer->Clean( *this, EAiWizardContentSecureIcon, |
590 EAiWizardContentSecureIcon ); |
515 EAiWizardContentSecureIcon ); |
591 observer->Clean( *this, EAiWizardContentSecureText, |
|
592 EAiWizardContentSecureText ); |
|
593 observer->Clean( *this, EAiWizardContentNetworkName, |
516 observer->Clean( *this, EAiWizardContentNetworkName, |
594 EAiWizardContentNetworkName ); |
517 EAiWizardContentNetworkName ); |
|
518 |
595 observer->Commit( reinterpret_cast<TInt32>( this ) ); |
519 observer->Commit( reinterpret_cast<TInt32>( this ) ); |
596 } |
|
597 } |
|
598 |
|
599 |
|
600 // -------------------------------------------------------------------------- |
|
601 // CWsfAiPlugin::SetStrengthAndSecure |
|
602 // -------------------------------------------------------------------------- |
|
603 // |
|
604 void CWsfAiPlugin::SetStrengthAndSecure( TDesC* aStrength, TDesC* aSecure ) |
|
605 { |
|
606 LOG_ENTERFN( "CWsfAiPlugin::SetStrengthAndSecure" ); |
|
607 delete iCurrentSignalStrength; |
|
608 iCurrentSignalStrength = NULL; |
|
609 if ( aStrength && aStrength->Length() > 0) |
|
610 { |
|
611 iCurrentSignalStrength = aStrength->Alloc(); |
|
612 } |
|
613 |
|
614 delete iCurrentSecureInfo; |
|
615 iCurrentSecureInfo = NULL; |
|
616 if ( aSecure && aSecure->Length() > 0) |
|
617 { |
|
618 // r_qtn_sniffer_plug_in_content_secure |
|
619 iCurrentSecureInfo = aSecure->Alloc(); |
|
620 } |
520 } |
621 } |
521 } |
622 |
522 |
623 |
523 |
624 // -------------------------------------------------------------------------- |
524 // -------------------------------------------------------------------------- |