20 #define DIALOGWRAPPER_H |
20 #define DIALOGWRAPPER_H |
21 |
21 |
22 // INCLUDES |
22 // INCLUDES |
23 #include <e32base.h> |
23 #include <e32base.h> |
24 #include <f32file.h> |
24 #include <f32file.h> |
25 #include <barsc.h> |
|
26 #include "dialogwatcher.h" |
25 #include "dialogwatcher.h" |
|
26 |
|
27 class CHbDeviceProgressDialogSymbian; |
|
28 class CHbDeviceNotificationDialogSymbian; |
|
29 class CHbIndicatorSymbian; |
27 |
30 |
28 namespace Swi |
31 namespace Swi |
29 { |
32 { |
30 |
33 // Define uninstaller mode for universal indicator. |
|
34 const TInt KSWIDaemonUninstallerMode = -1; |
|
35 // Define installer mode for universal indicator. |
|
36 const TInt KSWIDaemonInstallerMode = 0; |
|
37 |
|
38 class CDialogTimer; |
31 /** |
39 /** |
32 * This class wraps functions for showing some global dialogs. |
40 * This class wraps functions for showing some global dialogs. |
33 * |
41 * |
34 * @since 3.0 |
42 * @since 3.0 |
35 */ |
43 */ |
82 /** |
90 /** |
83 * Show global waiting note (during uninstalling). |
91 * Show global waiting note (during uninstalling). |
84 * @since 3.2 |
92 * @since 3.2 |
85 */ |
93 */ |
86 void ShowWaitingNoteForUninstallerL(); |
94 void ShowWaitingNoteForUninstallerL(); |
|
95 |
|
96 /** |
|
97 * Cancel global waiting note (after installing). |
|
98 * @since 10.1 |
|
99 */ |
|
100 void CancelWaitingNoteForUninstaller(); |
|
101 |
|
102 /** |
|
103 * Show universal indicator for install or uninstall process. |
|
104 * @since 10.1 |
|
105 */ |
|
106 void ActivateIndicatorL( TReal aProcessValue ); |
|
107 |
|
108 /** |
|
109 * Set mode for universal indicator plugin. |
|
110 * @since 10.1 |
|
111 * @parm aMode Flag for switchig to uninstaller mode. By default |
|
112 * plugin works as installer mode. |
|
113 */ |
|
114 void SetModeToIndicatorL( TInt aMode ); |
|
115 |
|
116 /** |
|
117 * Close universal indicator for install or uninstall process. |
|
118 * @since 10.1 |
|
119 */ |
|
120 void CancelIndicatorL(); |
|
121 |
|
122 //TODO: remove, it seems that this is no needed after wk18. |
|
123 /** |
|
124 * Check system state. This is needed to know, can Daemon show UI |
|
125 * dialogs. |
|
126 * @since 10.1 |
|
127 */ |
|
128 //void CheckSystemState(); |
87 |
129 |
88 private: |
130 private: |
89 |
131 |
90 /** |
132 /** |
91 * Constructor. |
133 * Constructor. |
104 * @return Read resource buffer. |
146 * @return Read resource buffer. |
105 */ |
147 */ |
106 HBufC* ReadResourceLC( TInt aResourceId ); |
148 HBufC* ReadResourceLC( TInt aResourceId ); |
107 |
149 |
108 private: // Data |
150 private: // Data |
109 |
151 |
110 RResourceFile iResourceFile; |
|
111 RFs& iFs; |
152 RFs& iFs; |
112 TInt iNoteId; |
153 TInt iNoteId; |
113 TInt iDisableAllNotes; |
154 TInt iDisableAllNotes; |
114 CDialogWatcher* iWatcher; |
155 CDialogWatcher* iWatcher; |
|
156 |
|
157 TBool iIsProgressDialog; // Defines that dialog is constructed. |
|
158 CHbDeviceProgressDialogSymbian* iHbProgressDialog; |
|
159 TBool iIsUninstallerProgressDialog; // Defines that dialog is constructed. |
|
160 CHbDeviceProgressDialogSymbian* iHbProgressDialogForUninstaller; |
|
161 TBool iIsIndicator; // Defines that indicator is constructed. |
|
162 CHbIndicatorSymbian* iHbIndicator; // Univeral indicator. |
|
163 CDialogTimer* iTimer; // Timer for closing procress dialog. |
|
164 // Defines that dialog has used the time interval and can not be shown. |
|
165 TBool iTimeOffDisableProgress; |
|
166 }; |
|
167 |
|
168 /** |
|
169 * Helper class for closing the progress dialogs shown by |
|
170 * the DialogWrapper class. |
|
171 * |
|
172 * @since 10.1 |
|
173 */ |
|
174 class CDialogTimer : public CActive |
|
175 { |
|
176 public: |
|
177 |
|
178 /** |
|
179 * Destructor. |
|
180 */ |
|
181 virtual ~CDialogTimer(); |
|
182 |
|
183 /** |
|
184 * Two-phased constructor. |
|
185 */ |
|
186 static CDialogTimer* NewL( CDialogWrapper* aDialog ); |
|
187 |
|
188 /** |
|
189 * Function sets time interva for progress dialog. |
|
190 * After this time interval the progress dialog is closed. |
|
191 * @param aRefresTime Time in microseconds. |
|
192 */ |
|
193 void StartDialogTimer( TUint32 aRefreshTime ); |
|
194 |
|
195 private: |
|
196 |
|
197 /** |
|
198 * C++ default constructor. |
|
199 */ |
|
200 CDialogTimer(); |
|
201 |
|
202 /** |
|
203 * 2nd phase constructor. |
|
204 * @param |
|
205 */ |
|
206 void ConstructL( CDialogWrapper* aDialog ); |
|
207 |
|
208 /** |
|
209 * Function sets time. |
|
210 * @param aRefresTime Time in microseconds. |
|
211 */ |
|
212 void TimerSet( TUint32 aRefreshTime ); |
|
213 |
|
214 /** |
|
215 * |
|
216 */ |
|
217 void RunL(); |
|
218 |
|
219 /** |
|
220 * Cancel timer. |
|
221 */ |
|
222 void DoCancel(); |
|
223 |
|
224 /** |
|
225 * Handles a leave occurring in the request completion |
|
226 * event handler RunL. |
|
227 */ |
|
228 TInt RunError( TInt aError ); |
|
229 |
|
230 private: |
|
231 |
|
232 RTimer iRTimer; // Timer. |
|
233 CDialogWrapper* iDialog; // Dialog class. |
115 }; |
234 }; |
116 } |
235 } |
117 |
236 |
118 #endif // DIALOGWRAPPER_H |
237 #endif // DIALOGWRAPPER_H |
119 |
238 |