18 #ifndef CAPROGRESSNOTIFIER_H |
18 #ifndef CAPROGRESSNOTIFIER_H |
19 #define CAPROGRESSNOTIFIER_H |
19 #define CAPROGRESSNOTIFIER_H |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <usif/sif/sifnotification.h> |
22 #include <usif/sif/sifnotification.h> |
|
23 #include <usif/usifcommon.h> |
|
24 |
23 #include "castorage_global.h" |
25 #include "castorage_global.h" |
24 using namespace Usif; |
26 using namespace Usif; |
25 |
27 |
26 class CCaStorageProxy; |
28 class CCaStorageProxy; |
27 |
29 class CCaInnerEntry; |
28 // needed for fake notifier |
|
29 #include "cainstallnotifier.h" |
|
30 |
|
31 /** |
|
32 * Interface for updating after installer events. |
|
33 */ |
|
34 class MCaFakeProgressListener |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Pure virtual method. |
|
39 * @param aEvent event type. |
|
40 */ |
|
41 virtual void HandleFakeProgressNotifyL(TInt aCurrentProgress) = 0; |
|
42 }; |
|
43 |
|
44 /** |
|
45 * Fake Install notifier. |
|
46 * |
|
47 * @since S60 v5.0 |
|
48 */ |
|
49 NONSHARABLE_CLASS( CCaFakeProgressNotifier ) : public CActive |
|
50 { |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Creates an instance of CCaFakeProgressNotifier. |
|
55 * @param aListener Reference to notifier interface. |
|
56 */ |
|
57 IMPORT_C static CCaFakeProgressNotifier* NewL( MCaFakeProgressListener& aListener); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CCaFakeProgressNotifier(); |
|
63 |
|
64 /** |
|
65 * Starts fake progress notifications. |
|
66 */ |
|
67 void StartNotifying(); |
|
68 |
|
69 private: |
|
70 |
|
71 /** |
|
72 * Constructor. |
|
73 * @param aListener Reference to notifier interface. |
|
74 */ |
|
75 CCaFakeProgressNotifier( MCaFakeProgressListener& aListener ); |
|
76 |
|
77 /** |
|
78 * Symbian 2nd phase constructor. |
|
79 */ |
|
80 void ConstructL( ); |
|
81 |
|
82 /** |
|
83 * From CActive. |
|
84 */ |
|
85 void DoCancel(); |
|
86 |
|
87 /** |
|
88 * From CActive. |
|
89 */ |
|
90 void RunL(); |
|
91 |
|
92 /** |
|
93 * From CActive. |
|
94 */ |
|
95 TInt RunError( TInt aError ); |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * Interface for fake notifications |
|
101 * Not Own. |
|
102 */ |
|
103 MCaFakeProgressListener& iListener; |
|
104 |
|
105 /** |
|
106 * Timer |
|
107 */ |
|
108 RTimer iTimer; |
|
109 |
|
110 /** |
|
111 * Counter for fake notifications |
|
112 */ |
|
113 TInt iCount; |
|
114 |
|
115 }; |
|
116 |
|
117 |
30 |
118 /** |
31 /** |
119 * Uninstall Progress notifier. |
32 * Uninstall Progress notifier. |
120 * |
33 * |
121 * @since S60 v5.0 |
34 * @since S60 v5.0 |
122 */ |
35 */ |
123 NONSHARABLE_CLASS( CCaProgressNotifier ) : public CBase, |
36 NONSHARABLE_CLASS( CCaProgressNotifier ) : public CBase, |
124 //public MSifOperationsHandler, // USIF not working yet |
37 public MSifOperationsHandler |
125 public MCaInstallListener, //needed for fake |
|
126 public MCaFakeProgressListener //needed for fake |
|
127 { |
38 { |
128 |
39 |
129 public: |
40 public: |
130 /** |
41 /** |
131 * Creates an instance of CCaProgressNotifier. |
42 * Creates an instance of CCaProgressNotifier. |
141 private: |
52 private: |
142 |
53 |
143 /** |
54 /** |
144 * Constructor. |
55 * Constructor. |
145 */ |
56 */ |
146 CCaProgressNotifier( ); |
57 CCaProgressNotifier( CCaStorageProxy& aCaStorageProxy ); |
147 |
58 |
148 /** |
59 /** |
149 * Symbian 2nd phase constructor. |
60 * Symbian 2nd phase constructor. |
150 * @param aCaStorageProxy Reference to storage. |
61 * @param aCaStorageProxy Reference to storage. |
151 */ |
62 */ |
152 void ConstructL( CCaStorageProxy& aCaStorageProxy ); |
63 void ConstructL( ); |
|
64 |
|
65 void UpdateProgressL( const CSifOperationProgressData& aProgressData ); |
|
66 void EndOperationL(TInt aError); |
|
67 TComponentId ComponentIdL(const TDesC& aGlobalComponentId, const TDesC& aSwType); |
|
68 void MarkEntrysForUnistallL(TUint aKey, TComponentId aComponentId); |
153 |
69 |
154 public: |
70 public: |
155 /** |
71 /** |
156 * From MSifOperationsHandler |
72 * From MSifOperationsHandler |
157 */ |
73 */ |
165 /** |
81 /** |
166 * From MSifOperationsHandler |
82 * From MSifOperationsHandler |
167 */ |
83 */ |
168 void ProgressOperationHandler(const CSifOperationProgressData& aProgressData); |
84 void ProgressOperationHandler(const CSifOperationProgressData& aProgressData); |
169 |
85 |
170 public: |
|
171 |
|
172 /** |
|
173 * From MCaInstallListener, needed for fake |
|
174 */ |
|
175 void HandleInstallNotifyL( TInt aUid ); |
|
176 |
|
177 /** |
|
178 * From MCaFakeProgressListener, needed for fake |
|
179 */ |
|
180 void HandleFakeProgressNotifyL(TInt aCurrentProgress); |
|
181 |
|
182 private: |
86 private: |
183 |
87 |
184 /** |
88 /** |
185 * USIF notifier |
89 * USIF notifier |
186 * Own. |
90 * Own. |
187 * |
91 * |
188 * Commented out since USIF notifications do not |
92 * Commented out since USIF notifications do not |
189 * work on MCL wk20 |
93 * work on MCL wk20 |
190 */ |
94 */ |
191 //CSifOperationsNotifier* iNotifier; |
95 CSifOperationsNotifier* iNotifier; |
192 |
96 |
193 /** |
97 /** |
194 * Not Own. |
98 * Not Own. |
195 * Reference to the Storage Proxy. |
99 * Reference to the Storage Proxy. |
196 */ |
100 */ |
197 CCaStorageProxy* iStorageProxy; |
101 CCaStorageProxy& iStorageProxy; |
198 |
|
199 /** |
|
200 * Uninstall notifier. Own. Needed for fake |
|
201 */ |
|
202 CCaInstallNotifier *iUsifUninstallNotifier; |
|
203 |
|
204 /** |
|
205 * Install and uninstall notifier. Own. Needed for fake |
|
206 */ |
|
207 CCaInstallNotifier *iJavaInstallNotifier; |
|
208 |
102 |
209 /** |
103 RPointerArray<CCaInnerEntry> iResultArrayItems; |
210 * Fake uninstall progress notifier. Own. Needed for fake |
104 |
211 */ |
105 TUint iKey; |
212 CCaFakeProgressNotifier *iFakeProgressNotifier; |
|
213 |
106 |
214 }; |
107 }; |
215 |
108 |
216 |
109 |
217 #endif /* CAPROGRESSNOTIFIER_H */ |
110 #endif /* CAPROGRESSNOTIFIER_H */ |