76 // --------------------------------------------------------------------------- |
77 // --------------------------------------------------------------------------- |
77 // CSisxSifPluginUiHandler::DisplayTextL() |
78 // CSisxSifPluginUiHandler::DisplayTextL() |
78 // --------------------------------------------------------------------------- |
79 // --------------------------------------------------------------------------- |
79 // |
80 // |
80 TBool CSisxSifPluginUiHandler::DisplayTextL( const Swi::CAppInfo& /*aAppInfo*/, |
81 TBool CSisxSifPluginUiHandler::DisplayTextL( const Swi::CAppInfo& /*aAppInfo*/, |
81 Swi::TFileTextOption /*aOption*/, const TDesC& /*aText*/ ) |
82 Swi::TFileTextOption aOption, const TDesC& aText ) |
82 { |
83 { |
83 FLOG( _L("CSisxSifPluginUiHandler::DisplayTextL") ); |
84 FLOG( _L("CSisxSifPluginUiHandler::DisplayTextL") ); |
84 |
85 TBool okToContinue = EFalse; |
85 return ETrue; |
86 |
|
87 switch( aOption ) |
|
88 { |
|
89 case Swi::EInstFileTextOptionContinue: |
|
90 ShowQuestionWithContinueL( aText ); |
|
91 okToContinue = ETrue; |
|
92 break; |
|
93 case Swi::EInstFileTextOptionSkipOneIfNo: |
|
94 okToContinue = ShowQuestionL( aText ); |
|
95 break; |
|
96 case Swi::EInstFileTextOptionAbortIfNo: |
|
97 case Swi::EInstFileTextOptionExitIfNo: |
|
98 okToContinue = ShowQuestionL( aText ); |
|
99 break; |
|
100 case Swi::EInstFileTextOptionForceAbort: |
|
101 ShowQuestionWithContinueL( aText ); |
|
102 break; |
|
103 default: |
|
104 break; |
|
105 } |
|
106 |
|
107 return okToContinue; |
86 } |
108 } |
87 |
109 |
88 // --------------------------------------------------------------------------- |
110 // --------------------------------------------------------------------------- |
89 // CSisxSifPluginUiHandler::DisplayErrorL() |
111 // CSisxSifPluginUiHandler::DisplayErrorL() |
90 // --------------------------------------------------------------------------- |
112 // --------------------------------------------------------------------------- |
91 // |
113 // |
92 void CSisxSifPluginUiHandler::DisplayErrorL( const Swi::CAppInfo& /*aAppInfo*/, |
114 void CSisxSifPluginUiHandler::DisplayErrorL( const Swi::CAppInfo& /*aAppInfo*/, |
93 Swi::TErrorDialog aType, const TDesC& aParam ) |
115 Swi::TErrorDialog aType, const TDesC& aParam ) |
94 { |
116 { |
95 FLOG( _L("CSisxSifPluginUiHandler::DisplayErrorL") ); |
117 FLOG( _L("CSisxSifPluginUiHandler::DisplayErrorL") ); |
96 SetDisplayErrorL( aType, aParam ); |
118 SetErrorSwiErrorL( aType, aParam ); |
97 } |
119 } |
98 |
120 |
99 // --------------------------------------------------------------------------- |
121 // --------------------------------------------------------------------------- |
100 // CSisxSifPluginUiHandler:: |
122 // CSisxSifPluginUiHandler::DisplayDependencyBreakL() |
101 // --------------------------------------------------------------------------- |
123 // --------------------------------------------------------------------------- |
102 // |
124 // |
103 TBool CSisxSifPluginUiHandler::DisplayDependencyBreakL( const Swi::CAppInfo& /*aAppInfo*/, |
125 TBool CSisxSifPluginUiHandler::DisplayDependencyBreakL( const Swi::CAppInfo& /*aAppInfo*/, |
104 const RPointerArray<TDesC>& /*aComponents*/ ) |
126 const RPointerArray<TDesC>& /*aComponents*/ ) |
105 { |
127 { |
106 FLOG( _L("CSisxSifPluginUiHandler::DisplayDependencyBreakL") ); |
128 FLOG( _L("CSisxSifPluginUiHandler::DisplayDependencyBreakL") ); |
107 |
129 TBool okToContinue = EFalse; |
108 return ETrue; |
130 |
|
131 // TODO: localized UI string needed |
|
132 _LIT( KText, "Removal may stop other applications working. Continue?" ); |
|
133 okToContinue = ShowQuestionL( KText ); |
|
134 |
|
135 return okToContinue; |
109 } |
136 } |
110 |
137 |
111 // --------------------------------------------------------------------------- |
138 // --------------------------------------------------------------------------- |
112 // CSisxSifPluginUiHandler::DisplayApplicationsInUseL() |
139 // CSisxSifPluginUiHandler::DisplayApplicationsInUseL() |
113 // --------------------------------------------------------------------------- |
140 // --------------------------------------------------------------------------- |
114 // |
141 // |
115 TBool CSisxSifPluginUiHandler::DisplayApplicationsInUseL( const Swi::CAppInfo& /*aAppInfo*/, |
142 TBool CSisxSifPluginUiHandler::DisplayApplicationsInUseL( const Swi::CAppInfo& /*aAppInfo*/, |
116 const RPointerArray<TDesC>& /*aAppNames*/ ) |
143 const RPointerArray<TDesC>& /*aAppNames*/ ) |
117 { |
144 { |
118 FLOG( _L("CSisxSifPluginUiHandler::DisplayApplicationsInUseL") ); |
145 FLOG( _L("CSisxSifPluginUiHandler::DisplayApplicationsInUseL") ); |
119 |
146 return ETrue; // silently accepted |
120 return ETrue; |
|
121 } |
147 } |
122 |
148 |
123 // --------------------------------------------------------------------------- |
149 // --------------------------------------------------------------------------- |
124 // CSisxSifPluginUiHandler::DisplayQuestionL() |
150 // CSisxSifPluginUiHandler::DisplayQuestionL() |
125 // --------------------------------------------------------------------------- |
151 // --------------------------------------------------------------------------- |
126 // |
152 // |
127 TBool CSisxSifPluginUiHandler::DisplayQuestionL( const Swi::CAppInfo& /*aAppInfo*/, |
153 TBool CSisxSifPluginUiHandler::DisplayQuestionL( const Swi::CAppInfo& /*aAppInfo*/, |
128 Swi::TQuestionDialog aQuestion, const TDesC& /*aDes*/ ) |
154 Swi::TQuestionDialog aQuestion, const TDesC& /*aDes*/ ) |
129 { |
155 { |
130 FLOG( _L("CSisxSifPluginUiHandler::DisplayQuestionL") ); |
156 FLOG( _L("CSisxSifPluginUiHandler::DisplayQuestionL") ); |
131 |
157 TBool okToContinue = EFalse; |
132 TBool result = ETrue; |
158 |
133 switch( aQuestion ) |
159 switch( aQuestion ) |
134 { |
160 { |
135 case Swi::EQuestionIncompatible: |
161 case Swi::EQuestionIncompatible: |
136 if( !iQuestionIncompatibleDisplayed ) |
162 if( !iQuestionIncompatibleDisplayed ) |
137 { |
163 { |
138 // TODO: show dialog |
164 _LIT( KText, "Application not compatible with phone. Continue anyway?" ); |
|
165 okToContinue = ShowQuestionL( KText ); |
139 iQuestionIncompatibleDisplayed = ETrue; |
166 iQuestionIncompatibleDisplayed = ETrue; |
140 } |
167 } |
141 break; |
168 else |
|
169 { |
|
170 okToContinue = ETrue; // already accepted once |
|
171 } |
|
172 break; |
|
173 |
142 case Swi::EQuestionOverwriteFile: |
174 case Swi::EQuestionOverwriteFile: |
143 default: |
175 default: |
144 // silently accepted |
176 okToContinue = ETrue; // silently accepted |
145 break; |
177 break; |
146 } |
178 } |
147 return result; |
179 |
|
180 return okToContinue; |
148 } |
181 } |
149 |
182 |
150 // --------------------------------------------------------------------------- |
183 // --------------------------------------------------------------------------- |
151 // CSisxSifPluginUiHandler::DisplayInstallL() |
184 // CSisxSifPluginUiHandler::DisplayInstallL() |
152 // --------------------------------------------------------------------------- |
185 // --------------------------------------------------------------------------- |
155 const CApaMaskedBitmap* /*aLogo*/, |
188 const CApaMaskedBitmap* /*aLogo*/, |
156 const RPointerArray<Swi::CCertificateInfo>& /*aCertificates*/ ) |
189 const RPointerArray<Swi::CCertificateInfo>& /*aCertificates*/ ) |
157 { |
190 { |
158 FLOG( _L("CSisxSifPluginUiHandler::DisplayInstallL") ); |
191 FLOG( _L("CSisxSifPluginUiHandler::DisplayInstallL") ); |
159 |
192 |
160 iMode = EModeInstall; |
193 iOperationPhase = EInstalling; |
161 return ETrue; |
194 return ETrue; |
162 } |
195 } |
163 |
196 |
164 // --------------------------------------------------------------------------- |
197 // --------------------------------------------------------------------------- |
165 // CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL() |
198 // CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL() |
166 // --------------------------------------------------------------------------- |
199 // --------------------------------------------------------------------------- |
167 // |
200 // |
168 TBool CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL( const Swi::CAppInfo& /*aAppInfo*/, |
201 TBool CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL( const Swi::CAppInfo& /*aAppInfo*/, |
169 const TCapabilitySet& /*aCapabilitySet*/ ) |
202 const TCapabilitySet& aCapabilitySet ) |
170 { |
203 { |
171 FLOG( _L("CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL") ); |
204 FLOG( _L("CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL") ); |
172 |
205 TBool okToContinue = EFalse; |
173 return ETrue; |
206 |
|
207 okToContinue = iSifUi->ShowGrantCapabilitiesL( aCapabilitySet ); |
|
208 |
|
209 return okToContinue; |
174 } |
210 } |
175 |
211 |
176 // --------------------------------------------------------------------------- |
212 // --------------------------------------------------------------------------- |
177 // CSisxSifPluginUiHandler::DisplayLanguageL() |
213 // CSisxSifPluginUiHandler::DisplayLanguageL() |
178 // --------------------------------------------------------------------------- |
214 // --------------------------------------------------------------------------- |
257 if( iSifUi->IsCancelled() ) |
293 if( iSifUi->IsCancelled() ) |
258 { |
294 { |
259 return EFalse; |
295 return EFalse; |
260 } |
296 } |
261 |
297 |
262 TSifOperationPhase phase = ( iMode == EModeInstall ? EInstalling : EUninstalling ); |
|
263 switch( aEvent ) |
298 switch( aEvent ) |
264 { |
299 { |
265 case Swi::EEventSetProgressBarFinalValue: |
300 case Swi::EEventSetProgressBarFinalValue: |
266 iProgressBarFinalValue = aValue; |
301 iProgressBarFinalValue = aValue; |
267 if( iMode == EModeInstall ) |
302 if( iOperationPhase == EInstalling ) |
268 { |
303 { |
269 CSifUiAppInfo *appInfo = GetAppInfoLC( aAppInfo ); |
304 ShowProgressL( aAppInfo, iProgressBarFinalValue, CSifUi::EInstalling ); |
270 iSifUi->ShowProgressL( *appInfo, aValue ); |
|
271 CleanupStack::PopAndDestroy( appInfo ); |
|
272 } |
305 } |
273 break; |
306 break; |
274 |
307 |
275 case Swi::EEventUpdateProgressBar: |
308 case Swi::EEventUpdateProgressBar: |
276 if( iMode == EModeInstall ) |
309 if( iOperationPhase == EInstalling ) |
277 { |
310 { |
278 iSifUi->IncreaseProgressBarValueL( aValue ); |
311 iSifUi->IncreaseProgressBarValueL( aValue ); |
279 } |
312 } |
280 PublishProgressL( phase, EFileOperation, aValue, iProgressBarFinalValue ); |
313 iProgressBarCurrentValue += aValue; |
281 break; |
314 PublishProgressL( EFileOperation ); |
282 |
|
283 case Swi::EEventOcspCheckEnd: |
|
284 // TODO: do something |
|
285 break; |
315 break; |
286 |
316 |
287 case Swi::EEventDevCert: |
317 case Swi::EEventDevCert: |
288 // TODO: show "developer certificate" warning note |
318 // TODO: show "developer certificate" warning note |
289 break; |
319 break; |
290 |
320 |
|
321 case Swi::EEventOcspCheckEnd: |
291 case Swi::EEventAbortedInstall: |
322 case Swi::EEventAbortedInstall: |
292 case Swi::EEventAbortedUnInstall: |
323 case Swi::EEventAbortedUnInstall: |
293 case Swi::EEventCompletedInstall: |
324 case Swi::EEventCompletedInstall: |
294 case Swi::EEventCompletedUnInstall: |
325 case Swi::EEventCompletedUnInstall: |
295 case Swi::EEventCompletedNoMessage: |
326 case Swi::EEventCompletedNoMessage: |
303 |
334 |
304 // --------------------------------------------------------------------------- |
335 // --------------------------------------------------------------------------- |
305 // CSisxSifPluginUiHandler::HandleCancellableInstallEventL() |
336 // CSisxSifPluginUiHandler::HandleCancellableInstallEventL() |
306 // --------------------------------------------------------------------------- |
337 // --------------------------------------------------------------------------- |
307 // |
338 // |
308 void CSisxSifPluginUiHandler::HandleCancellableInstallEventL( const Swi::CAppInfo& /*aAppInfo*/, |
339 void CSisxSifPluginUiHandler::HandleCancellableInstallEventL( const Swi::CAppInfo& aAppInfo, |
309 Swi::TInstallCancellableEvent /*aEvent*/, Swi::MCancelHandler& /*aCancelHandler*/, |
340 Swi::TInstallCancellableEvent aEvent, Swi::MCancelHandler& aCancelHandler, |
310 TInt /*aValue*/,const TDesC& /*aDes*/ ) |
341 TInt aValue, const TDesC& /*aDes*/ ) |
311 { |
342 { |
312 FLOG( _L("CSisxSifPluginUiHandler::HandleCancellableInstallEventL") ); |
343 FLOG_2( _L("CSisxSifPluginUiHandler::HandleCancellableInstallEventL: aEvent %d, aValue %d"), aEvent, aValue ); |
313 |
344 |
314 // TODO: Swi::EEventOcspCheckStart |
345 if( iSifUi->IsCancelled() ) |
|
346 { |
|
347 aCancelHandler.HandleCancel(); |
|
348 } |
|
349 else |
|
350 { |
|
351 switch( aEvent ) |
|
352 { |
|
353 case Swi::EEventOcspCheckStart: |
|
354 ShowProgressL( aAppInfo, aValue, CSifUi::ECheckingCerts ); |
|
355 iProgressBarCurrentValue += aValue; |
|
356 PublishProgressL( EOCSPCheck ); |
|
357 break; |
|
358 |
|
359 case Swi::EEventRemovingFiles: |
|
360 case Swi::EEventCopyingFiles: |
|
361 case Swi::EEventShuttingDownApps: |
|
362 default: |
|
363 break; |
|
364 } |
|
365 } |
315 } |
366 } |
316 |
367 |
317 // --------------------------------------------------------------------------- |
368 // --------------------------------------------------------------------------- |
318 // CSisxSifPluginUiHandler::DisplaySecurityWarningL() |
369 // CSisxSifPluginUiHandler::DisplaySecurityWarningL() |
319 // --------------------------------------------------------------------------- |
370 // --------------------------------------------------------------------------- |
369 // --------------------------------------------------------------------------- |
414 // --------------------------------------------------------------------------- |
370 // CSisxSifPluginUiHandler::DisplayOcspResultL() |
415 // CSisxSifPluginUiHandler::DisplayOcspResultL() |
371 // --------------------------------------------------------------------------- |
416 // --------------------------------------------------------------------------- |
372 // |
417 // |
373 TBool CSisxSifPluginUiHandler::DisplayOcspResultL( const Swi::CAppInfo& /*aAppInfo*/, |
418 TBool CSisxSifPluginUiHandler::DisplayOcspResultL( const Swi::CAppInfo& /*aAppInfo*/, |
374 Swi::TRevocationDialogMessage /*aMessage*/, RPointerArray<TOCSPOutcome>& /*aOutcomes*/, |
419 Swi::TRevocationDialogMessage aMessage, RPointerArray<TOCSPOutcome>& /*aOutcomes*/, |
375 RPointerArray<Swi::CCertificateInfo>& /*aCertificates*/, TBool /*aWarningOnly*/ ) |
420 RPointerArray<Swi::CCertificateInfo>& /*aCertificates*/, TBool aWarningOnly ) |
376 { |
421 { |
377 FLOG( _L("CSisxSifPluginUiHandler::DisplayOcspResultL") ); |
422 FLOG( _L("CSisxSifPluginUiHandler::DisplayOcspResultL") ); |
378 |
423 TBool okToContinue = EFalse; |
379 return ETrue; |
424 |
|
425 if( aWarningOnly && !IsOcspMandatoryL() ) |
|
426 { |
|
427 // TODO: localised UI string needed, see R_SISXUI_OCSP_SECURITY_WARNING |
|
428 _LIT( KText, "Installation security warning. Unable to verify supplier. Continue anyway?" ); |
|
429 if( ShowQuestionL( KText ) ) |
|
430 { |
|
431 okToContinue = ETrue; |
|
432 } |
|
433 } |
|
434 |
|
435 if( !okToContinue ) |
|
436 { |
|
437 SetOcspErrorL( aMessage ); |
|
438 } |
|
439 |
|
440 return okToContinue; |
380 } |
441 } |
381 |
442 |
382 // --------------------------------------------------------------------------- |
443 // --------------------------------------------------------------------------- |
383 // CSisxSifPluginUiHandler::DisplayCannotOverwriteFileL() |
444 // CSisxSifPluginUiHandler::DisplayCannotOverwriteFileL() |
384 // --------------------------------------------------------------------------- |
445 // --------------------------------------------------------------------------- |
432 void CSisxSifPluginUiHandler::DisplayCompleteL() |
493 void CSisxSifPluginUiHandler::DisplayCompleteL() |
433 { |
494 { |
434 FLOG( _L("CSisxSifPluginUiHandler::DisplayCompleteL") ); |
495 FLOG( _L("CSisxSifPluginUiHandler::DisplayCompleteL") ); |
435 |
496 |
436 iSifUi->ShowCompleteL(); |
497 iSifUi->ShowCompleteL(); |
437 iMode = EModeUndefined; |
|
438 } |
498 } |
439 |
499 |
440 // --------------------------------------------------------------------------- |
500 // --------------------------------------------------------------------------- |
441 // CSisxSifPluginUiHandler::DisplayFailedL() |
501 // CSisxSifPluginUiHandler::DisplayFailedL() |
442 // --------------------------------------------------------------------------- |
502 // --------------------------------------------------------------------------- |
443 // |
503 // |
444 void CSisxSifPluginUiHandler::DisplayFailedL( const CSisxSifPluginErrorHandler& aError ) |
504 void CSisxSifPluginUiHandler::DisplayFailedL( const CSisxSifPluginErrorHandler& aError ) |
445 { |
505 { |
446 FLOG_1( _L("CSisxSifPluginUiHandler::DisplayFailedL, error code %d"), aError.ErrorCode() ); |
506 FLOG_1( _L("CSisxSifPluginUiHandler::DisplayFailedL, error code %d"), aError.ErrorCode() ); |
447 |
507 |
448 // TODO: add error details |
508 CSifUiErrorInfo* errorInfo = CSifUiErrorInfo::NewLC( aError.ErrorCategory(), |
449 iSifUi->ShowFailedL( aError.ErrorCode(), aError.ErrorMessage() ); |
509 aError.ErrorCode(), aError.ExtendedErrorCode(), aError.ErrorMessage(), |
|
510 aError.ErrorMessageDetails() ); |
|
511 iSifUi->ShowFailedL( *errorInfo ); |
|
512 CleanupStack::PopAndDestroy( errorInfo ); |
450 } |
513 } |
451 |
514 |
452 // --------------------------------------------------------------------------- |
515 // --------------------------------------------------------------------------- |
453 // CSisxSifPluginUiHandler::CSisxSifPluginUiHandler() |
516 // CSisxSifPluginUiHandler::CSisxSifPluginUiHandler() |
454 // --------------------------------------------------------------------------- |
517 // --------------------------------------------------------------------------- |
540 CSifUiAppInfo *appInfo = CSifUiAppInfo::NewLC( aAppInfo.AppName(), aAppInfo.AppVendor(), |
603 CSifUiAppInfo *appInfo = CSifUiAppInfo::NewLC( aAppInfo.AppName(), aAppInfo.AppVendor(), |
541 aAppInfo.AppVersion(), iMaxInstalledSize, iLogo ); |
604 aAppInfo.AppVersion(), iMaxInstalledSize, iLogo ); |
542 return appInfo; |
605 return appInfo; |
543 } |
606 } |
544 |
607 |
|
608 // --------------------------------------------------------------------------- |
|
609 // CSisxSifPluginUiHandler::ShowProgressL() |
|
610 // --------------------------------------------------------------------------- |
|
611 // |
|
612 void CSisxSifPluginUiHandler::ShowProgressL( const Swi::CAppInfo& aAppInfo, |
|
613 TInt aProgressBarFinalValue, CSifUi::TInstallingPhase aPhase ) |
|
614 { |
|
615 CSifUiAppInfo *appInfo = GetAppInfoLC( aAppInfo ); |
|
616 iSifUi->ShowProgressL( *appInfo, aProgressBarFinalValue, aPhase ); |
|
617 CleanupStack::PopAndDestroy( appInfo ); |
|
618 } |
|
619 |
|
620 // --------------------------------------------------------------------------- |
|
621 // CSisxSifPluginUiHandler::ShowConfirmationL() |
|
622 // --------------------------------------------------------------------------- |
|
623 // |
|
624 TBool CSisxSifPluginUiHandler::ShowConfirmationL( const Swi::CAppInfo& aAppInfo ) |
|
625 { |
|
626 CSifUiAppInfo *appInfo = GetAppInfoLC( aAppInfo ); |
|
627 TBool result = iSifUi->ShowConfirmationL( *appInfo ); |
|
628 CleanupStack::PopAndDestroy( appInfo ); |
|
629 return result; |
|
630 } |