14 * Description: CSifUi API can be used to implement UI dialogs for |
14 * Description: CSifUi API can be used to implement UI dialogs for |
15 * SIF (Software Install Framework) plugins. |
15 * SIF (Software Install Framework) plugins. |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 /******************************************************** |
19 /************************************************************** |
20 * * |
20 * * |
21 * WARNING - WORK-IN-PROGRESS - THIS API MAY CHANGE * |
21 * WARNING - WORK-IN-PROGRESS - THIS API MAY STILL CHANGE * |
22 * * |
22 * * |
23 ********************************************************/ |
23 **************************************************************/ |
24 |
24 |
25 #ifndef C_SIFUI_H |
25 #ifndef C_SIFUI_H |
26 #define C_SIFUI_H |
26 #define C_SIFUI_H |
27 |
27 |
28 #include <e32base.h> // CBase |
28 #include <e32base.h> // CBase |
|
29 #include <bamdesca.h> // MDesCArray |
29 |
30 |
30 class CSifUiPrivate; |
31 class CSifUiPrivate; |
31 class CApaMaskedBitmap; |
32 class CApaMaskedBitmap; |
32 class CSifUiCertificateInfo; |
33 class CSifUiCertificateInfo; |
33 class CSifUiAppInfo; |
34 class CSifUiAppInfo; |
|
35 class CSifUiErrorInfo; |
34 |
36 |
35 namespace Swi { |
37 namespace Swi { |
36 class CAppInfo; |
38 class CAppInfo; |
37 class CCertificateInfo; |
39 class CCertificateInfo; |
38 } |
40 } |
65 * Destructor. |
67 * Destructor. |
66 */ |
68 */ |
67 ~CSifUi(); |
69 ~CSifUi(); |
68 |
70 |
69 public: // new functions |
71 public: // new functions |
70 /** |
72 |
71 * Displays main installation confirmation query and waits for user response. |
73 //================================================= |
72 * Returns ETrue if user accepted the query. The next ShowProgressL() call |
74 // Preparing note method |
73 * changes the dialog to installation progress note. And finally, ShowFailedL() |
75 //================================================= |
74 * or ShowCompleteL() changes the dialog to the final error or complete note. |
76 |
|
77 /** |
|
78 * Displays installation dialog with "Preparing" text and indefinite progress bar. |
|
79 * No buttons are available. Use ShowConfirmationL() method to update the dialog |
|
80 * content to the installation confirmation query. |
|
81 */ |
|
82 IMPORT_C void ShowPreparingL(); |
|
83 |
|
84 |
|
85 //================================================= |
|
86 // Install confirmation query methods |
|
87 //================================================= |
|
88 |
|
89 /** |
|
90 * Defines memory selection alternatives for the ShowConfirmationL() installation |
|
91 * confirmation query. Use SelectedDrive() method to get the selected drive number |
|
92 * after ShowConfirmationL() call. |
|
93 * @param aDriveNumbers - options for memory selection |
|
94 */ |
|
95 IMPORT_C void SetMemorySelectionL( const RArray<TInt>& aDriveNumbers ); |
|
96 |
|
97 /** |
|
98 * Defines certificate details for the ShowConfirmationL() installation |
|
99 * confirmation query. If certificates are not set, then application is |
|
100 * untrusted. |
|
101 * @param aCertificates - certificate details |
|
102 */ |
|
103 IMPORT_C void SetCertificateInfoL( |
|
104 const RPointerArray<CSifUiCertificateInfo>& aCertificates ); |
|
105 |
|
106 /** |
|
107 * Displays installation confirmation query and waits for user response. |
|
108 * Returns ETrue if the user accepted the query. The next ShowProgressL() call |
|
109 * changes the dialog content to installation progress note. And finally, |
|
110 * ShowCompleteL() or ShowFailedL() call changes the dialog content to the |
|
111 * complete or error note. |
|
112 * If preparing installation note needs to be displayed before confirmation query, |
|
113 * then call ShowPreparingL() before any other functions. |
75 * If the installation confirmation query should contain memory selection option, |
114 * If the installation confirmation query should contain memory selection option, |
76 * then set the selectable drives with SetMemorySelectionL() first. User selected |
115 * then set the selectable drives with SetMemorySelectionL() first. User selected |
77 * drive can be retrieved with SelectedDrive(). |
116 * drive can be retrieved with SelectedDrive() after ShowConfirmationL() returns. |
|
117 * If the installation confirmation query should contain certificate details, then |
|
118 * set the certificate details using SetCertificateInfoL() first. |
78 * @param aAppInfo - application information (name, size, version, vendor, icon) |
119 * @param aAppInfo - application information (name, size, version, vendor, icon) |
79 * @return TBools - ETrue if user accepted the query, EFalse otherwise |
120 * @return TBools - ETrue if the user accepted the query, EFalse otherwise |
80 */ |
121 */ |
81 IMPORT_C TBool ShowConfirmationL( const CSifUiAppInfo& aAppInfo ); |
122 IMPORT_C TBool ShowConfirmationL( const CSifUiAppInfo& aAppInfo ); |
82 |
|
83 /** |
|
84 * Defines memory selection alternatives for the main installation |
|
85 * confirmation query displayed with ShowConfirmationL() function. |
|
86 * @param aDriveNumbers - options for memory selection |
|
87 */ |
|
88 IMPORT_C void SetMemorySelectionL( const RArray<TInt>& aDriveNumbers ); |
|
89 |
123 |
90 /** |
124 /** |
91 * Gets the selected drive where new component should be installed. |
125 * Gets the selected drive where new component should be installed. |
92 * Use RFs::DriveToChar() to convert the drive number to drive letter. |
126 * Use RFs::DriveToChar() to convert the drive number to drive letter. |
93 * @param aDriveNumber - selected drive number |
127 * @param aDriveNumber - selected drive number |
94 * @return TInt - KErrNone if successful, otherwise Symbian error code |
128 * @return TInt - KErrNone if successful, otherwise Symbian error code |
95 */ |
129 */ |
96 IMPORT_C TInt SelectedDrive( TInt& aDriveNumber ); |
130 IMPORT_C TInt SelectedDrive( TInt& aDriveNumber ); |
97 |
131 |
98 /** |
132 |
99 * Defines certificate details for the main installation confirmation |
133 //================================================= |
100 * query displayed with ShowConfirmationL() function. |
134 // Progress note methods |
101 * @param aCertificates - certificate details |
135 //================================================= |
102 */ |
|
103 IMPORT_C void SetCertificateInfoL( |
|
104 const RPointerArray<CSifUiCertificateInfo>& aCertificates ); |
|
105 |
136 |
106 /** |
137 /** |
107 * Installing phases in progress notes. Indicated in progress note title text. |
138 * Installing phases in progress notes. Indicated in progress note title text. |
108 */ |
139 */ |
109 enum TInstallingPhase { |
140 enum TInstallingPhase { |
111 EDownloading, |
142 EDownloading, |
112 ECheckingCerts |
143 ECheckingCerts |
113 }; |
144 }; |
114 |
145 |
115 /** |
146 /** |
116 * Displays main installation progress note. If the progress note or main |
147 * Displays installation progress note. Changes confirmation query content |
117 * confirmation query is already displayed, then updates the dialog content. |
148 * to progress note. If the progress note is already displayed, then updates |
118 * Use IncreaseProgressBarValueL() to increase the progress bar value. |
149 * the dialog content. Use IncreaseProgressBarValueL() method to increase the |
|
150 * progress bar value. |
119 * Dialog remains on the screen after progress bar shows full 100% value. |
151 * Dialog remains on the screen after progress bar shows full 100% value. |
120 * Use ShowFailedL() or ShowCompleteL() to replace the dialog content |
152 * Use ShowCompleteL() or ShowFailedL() methods to show the result. |
121 * with the final error or complete note. |
|
122 * @param aAppInfo - application information (name, size, version, vendor, icon) |
153 * @param aAppInfo - application information (name, size, version, vendor, icon) |
123 * @param aProgressBarFinalValue - final value of the progress bar |
154 * @param aProgressBarFinalValue - final value of the progress bar |
124 * @param aPhase - defines new title text for the progress note dialog |
155 * @param aPhase - defines new title text for the progress note dialog |
125 */ |
156 */ |
126 IMPORT_C void ShowProgressL( const CSifUiAppInfo& aAppInfo, TInt aProgressBarFinalValue, |
157 IMPORT_C void ShowProgressL( const CSifUiAppInfo& aAppInfo, TInt aProgressBarFinalValue, |
140 * Returns ETrue if the user has cancelled the progress dialog. |
171 * Returns ETrue if the user has cancelled the progress dialog. |
141 * @return TBool - ETrue if the progress dialog has been cancelled |
172 * @return TBool - ETrue if the progress dialog has been cancelled |
142 */ |
173 */ |
143 IMPORT_C TBool IsCancelled(); |
174 IMPORT_C TBool IsCancelled(); |
144 |
175 |
|
176 |
|
177 //================================================= |
|
178 // Final complete and error notes |
|
179 //================================================= |
|
180 |
|
181 /** |
|
182 * Displays installation complete note and waits for the user to close it. |
|
183 * Installation complete note contains "Show" button to show installed |
|
184 * applications in application library. Use SetButtonVisible() method to |
|
185 * hide the "Show" button when necessary. |
|
186 */ |
|
187 IMPORT_C void ShowCompleteL(); |
|
188 |
|
189 /** |
|
190 * Displays installation error note and waits for user to close it. |
|
191 * Installation error note contains "Details" button to show the detailed |
|
192 * error message (when available). Also SetButtonVisible() method can be |
|
193 * used to hide the "Details" button if necessary. |
|
194 * @param aErrorCategory - error category |
|
195 * @param aErrorMessage - localized error message to be displayed |
|
196 * @param aErrorDetails - localized error message details (if any) |
|
197 * @param aErrorCode - error code |
|
198 * @param aErrorCode - error code |
|
199 */ |
|
200 IMPORT_C void ShowFailedL( const CSifUiErrorInfo& aErrorInfo ); |
|
201 |
|
202 |
|
203 //================================================= |
|
204 // Buttons in progress/complete/error notes |
|
205 //================================================= |
|
206 |
145 /** |
207 /** |
146 * Toolbar buttons in progress and complete notes that can be disabled/hidden. |
208 * Toolbar buttons in progress and complete notes that can be disabled/hidden. |
147 */ |
209 */ |
148 enum TOptionalButton |
210 enum TOptionalButton |
149 { |
211 { |
150 EHideProgressButton, |
212 EHideProgressButton, // "Hide" button in progress note |
151 ECancelProgressButton, |
213 ECancelProgressButton, // "Cancel" button in progress note |
152 EShowInAppLibButton, |
214 EShowInAppLibButton, // "Show" button in complete note |
153 EErrorDetailsButton |
215 EErrorDetailsButton // "Details" button in error note |
154 }; |
216 }; |
155 |
217 |
156 /** |
218 /** |
157 * Hides or shows optional toolbar buttons from installation progress note |
219 * Hides or shows optional toolbar buttons from installation progress note |
158 * or installation complete note. All optional buttos are visible by default. |
220 * or installation complete note. All optional buttos are visible by default. |
161 * @param aButton - button which visibility is changed |
223 * @param aButton - button which visibility is changed |
162 * @param aIsVisible - EFalse if button needs to be hidden |
224 * @param aIsVisible - EFalse if button needs to be hidden |
163 */ |
225 */ |
164 IMPORT_C void SetButtonVisible( TOptionalButton aButton, TBool aIsVisible ); |
226 IMPORT_C void SetButtonVisible( TOptionalButton aButton, TBool aIsVisible ); |
165 |
227 |
166 /** |
228 |
167 * Displays main installation complete note. Installation complete note contains |
229 //================================================= |
168 * button to launch the application libaray to show the recently installed apps. |
230 // Other query dialogs |
169 */ |
231 //================================================= |
170 IMPORT_C void ShowCompleteL(); |
232 |
171 |
233 /** |
172 /** |
234 * Displays dialog requesting capabilities for the application being installed |
173 * Displays main installation error note. Installation error note contains button |
235 * and waits for user response. Returns ETrue if the user granted the capabilities. |
174 * to see detailed error message when available. |
236 * Other dialogs (like progress note) are not affected. |
175 * @param aErrorCode - error code |
237 * @param aCapabilities - requested user capabilities |
176 * @param aErrorMessage - localized error message to be displayed |
238 * @return TBool - ETrue if the user granted the capabilities, EFalse otherwise |
177 * @param aErrorDetails - localized error message details (if any) |
239 */ |
178 */ |
240 IMPORT_C TBool ShowGrantCapabilitiesL( const TCapabilitySet& aCapabilities ); |
|
241 |
|
242 /** |
|
243 * Displays a selection dialog with radio-buttons in a pop-up window, |
|
244 * and waits for user response. Other displayed installation dialogs |
|
245 * (like progress note) are not affected. Returns boolean that indicates |
|
246 * if the user cancelled the query. Selected item index is returned in |
|
247 * aSelectedIndex parameter (KErrNotFound if cancelled). |
|
248 * @param aTitle - selection dialog title |
|
249 * @param aSelectableItems - array of selectable items |
|
250 * @param aSelectedIndex - returns selected item index |
|
251 * @return TBool - ETrue if the user accepted the query, EFalse otherwise |
|
252 */ |
|
253 IMPORT_C TBool ShowSingleSelectionL( const TDesC& aTitle, |
|
254 const MDesCArray& aSelectableItems, TInt& aSelectedIndex ); |
|
255 |
|
256 /** |
|
257 * Displays a multi-selection dialog with checkboxes in a pop-up window, |
|
258 * and waits for user response. Other displayed installation dialogs |
|
259 * (like progress note) are not affected. Returns user selected indices, |
|
260 * in aSelectedIndexes array (empty if cancelled). |
|
261 * @param aTitle - multi-selection dialog title |
|
262 * @param aSelectableItems - array of selectable items |
|
263 * @param aSelectedIndexes - returns the selected item indices |
|
264 * @return TBool - ETrue if the user accepted the query, EFalse otherwise |
|
265 */ |
|
266 IMPORT_C TBool ShowMultiSelectionL( const TDesC& aTitle, |
|
267 const MDesCArray& aSelectableItems, RArray<TInt>& aSelectedIndexes ); |
|
268 |
|
269 |
|
270 //================================================= |
|
271 // DEPRECATED METHODS |
|
272 //================================================= |
|
273 |
|
274 // DEPRECATED, WILL BE REMOVED, DO NOT USE |
179 IMPORT_C void ShowFailedL( TInt aErrorCode, const TDesC& aErrorMessage, |
275 IMPORT_C void ShowFailedL( TInt aErrorCode, const TDesC& aErrorMessage, |
180 const TDesC& aErrorDetails = KNullDesC ); |
276 const TDesC& aErrorDetails = KNullDesC ); |
|
277 |
181 |
278 |
182 private: // new functions |
279 private: // new functions |
183 CSifUi(); |
280 CSifUi(); |
184 void ConstructL(); |
281 void ConstructL(); |
185 |
282 |