18 #include "sisxsifpluginuihandlersilent.h" // CSisxSifPluginUiHandlerSilent |
18 #include "sisxsifpluginuihandlersilent.h" // CSisxSifPluginUiHandlerSilent |
19 #include "sisxsifplugininstallparams.h" // CSisxSifPluginInstallParams |
19 #include "sisxsifplugininstallparams.h" // CSisxSifPluginInstallParams |
20 #include "sisxsifpluginerrorhandler.h" // CSisxSifPluginErrorHandler |
20 #include "sisxsifpluginerrorhandler.h" // CSisxSifPluginErrorHandler |
21 #include "sisxsifplugin.pan" // Panic codes |
21 #include "sisxsifplugin.pan" // Panic codes |
22 #include "sisxsifcleanuputils.h" // CleanupResetAndDestroyPushL |
22 #include "sisxsifcleanuputils.h" // CleanupResetAndDestroyPushL |
|
23 #include "sisxsifpluginerrors.h" // Error codes |
23 |
24 |
24 using namespace Usif; |
25 using namespace Usif; |
25 |
26 |
26 |
27 |
27 // ======== MEMBER FUNCTIONS ======== |
28 // ======== MEMBER FUNCTIONS ======== |
52 // --------------------------------------------------------------------------- |
53 // --------------------------------------------------------------------------- |
53 // CSisxSifPluginUiHandlerSilent::DisplayTextL() |
54 // CSisxSifPluginUiHandlerSilent::DisplayTextL() |
54 // --------------------------------------------------------------------------- |
55 // --------------------------------------------------------------------------- |
55 // |
56 // |
56 TBool CSisxSifPluginUiHandlerSilent::DisplayTextL( const Swi::CAppInfo& /*aAppInfo*/, |
57 TBool CSisxSifPluginUiHandlerSilent::DisplayTextL( const Swi::CAppInfo& /*aAppInfo*/, |
57 Swi::TFileTextOption /*aOption*/, const TDesC& /*aText*/ ) |
58 Swi::TFileTextOption aOption, const TDesC& aText ) |
58 { |
59 { |
59 TBool okToContinue = EFalse; |
60 TBool okToContinue = EFalse; |
|
61 |
60 if( iInstallParams ) |
62 if( iInstallParams ) |
61 { |
63 { |
62 switch( iInstallParams->PackageInfo() ) |
64 switch( iInstallParams->PackageInfo() ) |
63 { |
65 { |
64 case EAllowed: |
66 case EAllowed: |
65 okToContinue = ETrue; |
67 okToContinue = ETrue; |
66 break; |
68 break; |
67 case EUserConfirm: |
69 case EUserConfirm: |
68 // TODO: EPolicyUserConfirm |
70 switch( aOption ) |
|
71 { |
|
72 case Swi::EInstFileTextOptionContinue: |
|
73 ShowQuestionWithContinueL( aText ); |
|
74 okToContinue = ETrue; |
|
75 break; |
|
76 case Swi::EInstFileTextOptionSkipOneIfNo: |
|
77 okToContinue = ShowQuestionL( aText ); |
|
78 break; |
|
79 case Swi::EInstFileTextOptionAbortIfNo: |
|
80 case Swi::EInstFileTextOptionExitIfNo: |
|
81 okToContinue = ShowQuestionL( aText ); |
|
82 break; |
|
83 case Swi::EInstFileTextOptionForceAbort: |
|
84 ShowQuestionWithContinueL( aText ); |
|
85 break; |
|
86 default: |
|
87 break; |
|
88 } |
69 break; |
89 break; |
70 case ENotAllowed: |
90 case ENotAllowed: |
71 default: |
91 default: |
72 break; |
92 SetErrorL( KErrPermissionDenied, ESifUiNeedsPackageInfoParameter, aText ); |
73 } |
93 break; |
74 } |
94 } |
|
95 } |
|
96 |
75 return okToContinue; |
97 return okToContinue; |
76 } |
98 } |
77 |
99 |
78 // --------------------------------------------------------------------------- |
100 // --------------------------------------------------------------------------- |
79 // CSisxSifPluginUiHandlerSilent::DisplayErrorL() |
101 // CSisxSifPluginUiHandlerSilent::DisplayErrorL() |
80 // --------------------------------------------------------------------------- |
102 // --------------------------------------------------------------------------- |
81 // |
103 // |
82 void CSisxSifPluginUiHandlerSilent::DisplayErrorL( const Swi::CAppInfo& /*aAppInfo*/, |
104 void CSisxSifPluginUiHandlerSilent::DisplayErrorL( const Swi::CAppInfo& /*aAppInfo*/, |
83 Swi::TErrorDialog aType, const TDesC& aParam ) |
105 Swi::TErrorDialog aType, const TDesC& aParam ) |
84 { |
106 { |
85 SetDisplayErrorL( aType, aParam ); |
107 SetErrorSwiErrorL( aType, aParam ); |
86 } |
108 } |
87 |
109 |
88 // --------------------------------------------------------------------------- |
110 // --------------------------------------------------------------------------- |
89 // CSisxSifPluginUiHandlerSilent::DisplayDependencyBreakL() |
111 // CSisxSifPluginUiHandlerSilent::DisplayDependencyBreakL() |
90 // --------------------------------------------------------------------------- |
112 // --------------------------------------------------------------------------- |
91 // |
113 // |
92 TBool CSisxSifPluginUiHandlerSilent::DisplayDependencyBreakL( const Swi::CAppInfo& /*aAppInfo*/, |
114 TBool CSisxSifPluginUiHandlerSilent::DisplayDependencyBreakL( const Swi::CAppInfo& /*aAppInfo*/, |
93 const RPointerArray<TDesC>& /*aComponents*/ ) |
115 const RPointerArray<TDesC>& /*aComponents*/ ) |
94 { |
116 { |
95 TBool okToContinue = EFalse; |
117 TBool okToContinue = EFalse; |
|
118 |
96 if( iInstallParams ) |
119 if( iInstallParams ) |
97 { |
120 { |
98 switch( iInstallParams->AllowAppBreakDependency() ) |
121 switch( iInstallParams->AllowAppBreakDependency() ) |
99 { |
122 { |
100 case EAllowed: |
123 case EAllowed: |
101 okToContinue = ETrue; |
124 okToContinue = ETrue; |
102 break; |
125 break; |
103 case EUserConfirm: |
126 case EUserConfirm: |
104 case ENotAllowed: |
127 case ENotAllowed: |
105 default: |
128 default: |
106 break; |
129 SetErrorL( KErrPermissionDenied, ESifUiNeedsAllowAppBreakDependencyParameter ); |
107 } |
130 break; |
108 } |
131 } |
|
132 } |
|
133 |
109 return okToContinue; |
134 return okToContinue; |
110 } |
135 } |
111 |
136 |
112 // --------------------------------------------------------------------------- |
137 // --------------------------------------------------------------------------- |
113 // CSisxSifPluginUiHandlerSilent::DisplayApplicationsInUseL() |
138 // CSisxSifPluginUiHandlerSilent::DisplayApplicationsInUseL() |
115 // |
140 // |
116 TBool CSisxSifPluginUiHandlerSilent::DisplayApplicationsInUseL( const Swi::CAppInfo& /*aAppInfo*/, |
141 TBool CSisxSifPluginUiHandlerSilent::DisplayApplicationsInUseL( const Swi::CAppInfo& /*aAppInfo*/, |
117 const RPointerArray<TDesC>& /*aAppNames*/ ) |
142 const RPointerArray<TDesC>& /*aAppNames*/ ) |
118 { |
143 { |
119 TBool okToContinue = EFalse; |
144 TBool okToContinue = EFalse; |
|
145 |
120 if( iInstallParams ) |
146 if( iInstallParams ) |
121 { |
147 { |
122 switch( iInstallParams->AllowAppShutdown() ) |
148 switch( iInstallParams->AllowAppShutdown() ) |
123 { |
149 { |
124 case EAllowed: |
150 case EAllowed: |
125 okToContinue = ETrue; |
151 okToContinue = ETrue; |
126 break; |
152 break; |
127 case EUserConfirm: |
153 case EUserConfirm: |
128 case ENotAllowed: |
154 case ENotAllowed: |
129 default: |
155 default: |
130 break; |
156 SetErrorL( KErrPermissionDenied, ESifUiNeedsAllowAppShutdownParameter ); |
131 } |
157 break; |
132 } |
158 } |
|
159 } |
|
160 |
133 return okToContinue; |
161 return okToContinue; |
134 } |
162 } |
135 |
163 |
136 // --------------------------------------------------------------------------- |
164 // --------------------------------------------------------------------------- |
137 // CSisxSifPluginUiHandlerSilent::DisplayQuestionL() |
165 // CSisxSifPluginUiHandlerSilent::DisplayQuestionL() |
138 // --------------------------------------------------------------------------- |
166 // --------------------------------------------------------------------------- |
139 // |
167 // |
140 TBool CSisxSifPluginUiHandlerSilent::DisplayQuestionL( const Swi::CAppInfo& /*aAppInfo*/, |
168 TBool CSisxSifPluginUiHandlerSilent::DisplayQuestionL( const Swi::CAppInfo& /*aAppInfo*/, |
141 Swi::TQuestionDialog aQuestion, const TDesC& /*aDes*/ ) |
169 Swi::TQuestionDialog aQuestion, const TDesC& aDes ) |
142 { |
170 { |
143 TBool okToContinue = EFalse; |
171 TBool okToContinue = EFalse; |
|
172 |
144 switch( aQuestion ) |
173 switch( aQuestion ) |
145 { |
174 { |
146 case Swi::EQuestionIncompatible: |
175 case Swi::EQuestionIncompatible: |
147 if( iInstallParams ) |
176 if( iInstallParams ) |
148 { |
177 { |
199 // |
238 // |
200 TBool CSisxSifPluginUiHandlerSilent::DisplayGrantCapabilitiesL( const Swi::CAppInfo& /*aAppInfo*/, |
239 TBool CSisxSifPluginUiHandlerSilent::DisplayGrantCapabilitiesL( const Swi::CAppInfo& /*aAppInfo*/, |
201 const TCapabilitySet& /*aCapabilitySet*/ ) |
240 const TCapabilitySet& /*aCapabilitySet*/ ) |
202 { |
241 { |
203 TBool okToContinue = EFalse; |
242 TBool okToContinue = EFalse; |
|
243 |
204 if( iInstallParams ) |
244 if( iInstallParams ) |
205 { |
245 { |
206 switch( iInstallParams->GrantCapabilities() ) |
246 switch( iInstallParams->GrantCapabilities() ) |
207 { |
247 { |
208 case EAllowed: |
248 case EAllowed: |
209 okToContinue = ETrue; |
249 okToContinue = ETrue; |
210 break; |
250 break; |
211 case EUserConfirm: |
251 case EUserConfirm: |
212 case ENotAllowed: |
252 case ENotAllowed: |
213 default: |
253 default: |
214 break; |
254 SetErrorL( KErrPermissionDenied, ESifUiNeedsGrantCapabilitiesParameter ); |
215 } |
255 break; |
216 } |
256 } |
|
257 } |
|
258 |
217 return okToContinue; |
259 return okToContinue; |
218 } |
260 } |
219 |
261 |
220 // --------------------------------------------------------------------------- |
262 // --------------------------------------------------------------------------- |
221 // CSisxSifPluginUiHandlerSilent::DisplayLanguageL() |
263 // CSisxSifPluginUiHandlerSilent::DisplayLanguageL() |
476 // --------------------------------------------------------------------------- |
518 // --------------------------------------------------------------------------- |
477 // CSisxSifPluginUiHandlerSilent::DisplayCannotOverwriteFileL() |
519 // CSisxSifPluginUiHandlerSilent::DisplayCannotOverwriteFileL() |
478 // --------------------------------------------------------------------------- |
520 // --------------------------------------------------------------------------- |
479 // |
521 // |
480 void CSisxSifPluginUiHandlerSilent::DisplayCannotOverwriteFileL( const Swi::CAppInfo& /*aAppInfo*/, |
522 void CSisxSifPluginUiHandlerSilent::DisplayCannotOverwriteFileL( const Swi::CAppInfo& /*aAppInfo*/, |
481 const Swi::CAppInfo& /*aInstalledAppInfo*/, const TDesC& /*aFileName*/ ) |
523 const Swi::CAppInfo& /*aInstalledAppInfo*/, const TDesC& aFileName ) |
482 { |
524 { |
483 // TODO: error handling |
525 // TODO: localized UI string needed: "The package tries to overwrite file '%1' it does not own." |
|
526 TName detailsString; |
|
527 detailsString.Format( _L("The package tries to overwrite file '%S' it does not own."), &aFileName ); |
|
528 SetErrorL( KErrPermissionDenied, ESifUiCannotOverwriteFile, detailsString ); |
484 } |
529 } |
485 |
530 |
486 // --------------------------------------------------------------------------- |
531 // --------------------------------------------------------------------------- |
487 // CSisxSifPluginUiHandlerSilent::DisplayMissingDependencyL() |
532 // CSisxSifPluginUiHandlerSilent::DisplayMissingDependencyL() |
488 // --------------------------------------------------------------------------- |
533 // --------------------------------------------------------------------------- |
490 TBool CSisxSifPluginUiHandlerSilent::DisplayMissingDependencyL( const Swi::CAppInfo& /*aAppInfo*/, |
535 TBool CSisxSifPluginUiHandlerSilent::DisplayMissingDependencyL( const Swi::CAppInfo& /*aAppInfo*/, |
491 const TDesC& /*aDependencyName*/, TVersion /*aWantedVersionFrom*/, |
536 const TDesC& /*aDependencyName*/, TVersion /*aWantedVersionFrom*/, |
492 TVersion /*aWantedVersionTo*/, TVersion /*aInstalledVersion*/ ) |
537 TVersion /*aWantedVersionTo*/, TVersion /*aInstalledVersion*/ ) |
493 { |
538 { |
494 TBool okToContinue = EFalse; |
539 TBool okToContinue = EFalse; |
|
540 |
495 if( iInstallParams ) |
541 if( iInstallParams ) |
496 { |
542 { |
497 switch( iInstallParams->AllowAppBreakDependency() ) |
543 switch( iInstallParams->AllowAppBreakDependency() ) |
498 { |
544 { |
499 case EAllowed: |
545 case EAllowed: |