13 * |
13 * |
14 * Description: This file contains the header file of the CIAUpdateManager class |
14 * Description: This file contains the header file of the CIAUpdateManager class |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
|
19 |
|
20 #ifndef IA_UPDATE_MANAGER_H |
18 #ifndef IA_UPDATE_MANAGER_H |
21 #define IA_UPDATE_MANAGER_H |
19 #define IA_UPDATE_MANAGER_H |
22 |
20 |
23 |
21 |
24 //INCLUDES |
22 //INCLUDES |
25 #include <e32base.h> |
23 #include <e32base.h> |
26 #include <e32std.h> |
24 #include <e32std.h> |
27 #include <coemain.h> |
25 #include <coemain.h> |
28 |
26 |
29 #include "iaupdateclient.h" |
|
30 |
|
31 //FORWARD DECLARATIONS |
27 //FORWARD DECLARATIONS |
|
28 class IAUpdateClient; |
32 class CIAUpdateParameters; |
29 class CIAUpdateParameters; |
33 class MIAUpdateObserver; |
30 class MIAUpdateObserver; |
34 class CEikonEnv; |
31 class CEikonEnv; |
35 |
32 |
36 |
33 |
47 * @see CIAUpdateParameters |
44 * @see CIAUpdateParameters |
48 * @see CIAUpdate |
45 * @see CIAUpdate |
49 * |
46 * |
50 * @since S60 v3.2 |
47 * @since S60 v3.2 |
51 */ |
48 */ |
52 NONSHARABLE_CLASS( CIAUpdateManager ) : public CActive, public MCoeForegroundObserver |
49 NONSHARABLE_CLASS( CIAUpdateManager ) : public CBase, public MCoeForegroundObserver |
53 { |
50 { |
54 |
51 |
55 public: |
52 public: |
56 |
53 |
57 /** |
|
58 * These values inform what operation has been requested. |
|
59 * |
|
60 * @since S60 v3.2 |
|
61 */ |
|
62 enum TIAUpdateType |
|
63 { |
|
64 /** |
|
65 * No operation is going on. |
|
66 */ |
|
67 EIAUpdateIdle, |
|
68 /** |
|
69 * SWUpdate app start requested. |
|
70 */ |
|
71 |
|
72 EIAUpdateStartServer, |
|
73 |
|
74 /** |
|
75 * Update check has been requested. |
|
76 */ |
|
77 EIAUpdateCheck, |
|
78 |
|
79 /** |
|
80 * Update operation has been requested. |
|
81 */ |
|
82 EIAUpdateUpdate, |
|
83 |
|
84 /** |
|
85 * Update query has been requested. |
|
86 */ |
|
87 EIAUpdateQuery |
|
88 }; |
|
89 |
|
90 |
|
91 /** |
|
92 * @param aObserver Callback functions of the observer are called |
|
93 * when operations progress. |
|
94 * @return CIAUpdateManager* Pointer to the created CIAUpdateManager |
|
95 * object that can be used for update actions. |
|
96 * |
|
97 * @since S60 v3.2 |
|
98 */ |
|
99 static CIAUpdateManager* NewL( MIAUpdateObserver& aObserver ); |
54 static CIAUpdateManager* NewL( MIAUpdateObserver& aObserver ); |
100 |
55 |
101 /** |
|
102 * @see NewL |
|
103 * |
|
104 * @since S60 v3.2 |
|
105 */ |
|
106 static CIAUpdateManager* NewLC( MIAUpdateObserver& aObserver ); |
56 static CIAUpdateManager* NewLC( MIAUpdateObserver& aObserver ); |
107 |
57 |
108 |
58 |
109 /** |
59 |
110 * Destructor |
60 ~CIAUpdateManager(); |
111 * |
61 |
112 * @since S60 v3.2 |
62 void CheckUpdates( const CIAUpdateParameters& aUpdateParameters ); |
113 */ |
63 |
114 virtual ~CIAUpdateManager(); |
64 void ShowUpdates( const CIAUpdateParameters& aUpdateParameters ); |
|
65 |
|
66 void UpdateQuery(); |
115 |
67 |
116 |
|
117 /** |
|
118 * @see CIAUpdate::CheckUpdates |
|
119 * |
|
120 * @since S60 v3.2 |
|
121 */ |
|
122 void CheckUpdates( const CIAUpdateParameters& aUpdateParameters ); |
|
123 |
|
124 |
|
125 /** |
|
126 * @see CIAUpdate::ShowUpdates |
|
127 * |
|
128 * @since S60 v3.2 |
|
129 */ |
|
130 void ShowUpdates( const CIAUpdateParameters& aUpdateParameters ); |
|
131 |
|
132 |
|
133 /** |
|
134 * @see CIAUpdate::Update |
|
135 * |
|
136 * @since S60 v3.2 |
|
137 */ |
|
138 void Update( const CIAUpdateParameters& aUpdateParameters ); |
68 void Update( const CIAUpdateParameters& aUpdateParameters ); |
139 |
|
140 /** |
|
141 * @see CIAUpdate::UpdateQuery |
|
142 * |
|
143 * @since S60 v3.2 |
|
144 */ |
|
145 void UpdateQuery(); |
|
146 |
|
147 |
|
148 protected: // CActive |
|
149 |
|
150 /** |
|
151 * @see CActive::DoCancel |
|
152 * |
|
153 * @since S60 v3.2 |
|
154 */ |
|
155 virtual void DoCancel(); |
|
156 |
|
157 /** |
|
158 * When the server side has finished operation, the CActive object will |
|
159 * be informed about it, and as a result RunL will be called. This function |
|
160 * well inform the observer that the operation has been completed. |
|
161 * @see CActive::RunL |
|
162 * |
|
163 * @since S60 v3.2 |
|
164 */ |
|
165 virtual void RunL(); |
|
166 |
|
167 |
|
168 protected: |
|
169 |
|
170 /** |
|
171 * @see NewL |
|
172 * |
|
173 * @since S60 v3.2 |
|
174 */ |
|
175 CIAUpdateManager( MIAUpdateObserver& aObserver ); |
|
176 |
|
177 /** |
|
178 * @see NewL |
|
179 * |
|
180 * @since S60 v3.2 |
|
181 */ |
|
182 virtual void ConstructL(); |
|
183 |
|
184 |
|
185 /** |
|
186 * Resets all the result variables to their default values. |
|
187 * |
|
188 * @since S60 v3.2 |
|
189 */ |
|
190 virtual void ResetResults(); |
|
191 |
|
192 |
|
193 /** |
|
194 * @return ETrue if an operation is going on. Else EFalse. |
|
195 * |
|
196 * @since S60 v3.2 |
|
197 */ |
|
198 TBool BusyCheck() const; |
|
199 |
|
200 |
|
201 /** |
|
202 * @return RIAUpdateClient& Handles the client server communication. |
|
203 * |
|
204 * @since S60 v3.2 |
|
205 */ |
|
206 RIAUpdateClient& UpdateClient(); |
|
207 |
|
208 |
|
209 /** |
|
210 * @return MUpdateObserver& Observer who will be informed about the |
|
211 * completion of the operations. |
|
212 * |
|
213 * @since S60 v3.2 |
|
214 */ |
|
215 MIAUpdateObserver& Observer() const; |
|
216 |
|
217 |
|
218 /** |
|
219 * @return TIAUpdateType Informs what kind of operation is going on. |
|
220 * |
|
221 * @since S60 v3.2 |
|
222 */ |
|
223 TIAUpdateType UpdateType() const; |
|
224 |
|
225 /** |
|
226 * @param aUpdateType Informs what kind of operation is going on. |
|
227 * |
|
228 * @since S60 v3.2 |
|
229 */ |
|
230 void SetUpdateType( TIAUpdateType aUpdateType ); |
|
231 |
69 |
232 |
70 |
233 private: |
71 private: |
|
72 |
|
73 CIAUpdateManager(); |
|
74 |
|
75 void ConstructL( MIAUpdateObserver& aObserver ); |
234 |
76 |
235 // Prevent these if not implemented |
77 // Prevent these if not implemented |
236 CIAUpdateManager( const CIAUpdateManager& aObject ); |
78 CIAUpdateManager( const CIAUpdateManager& aObject ); |
237 CIAUpdateManager& operator =( const CIAUpdateManager& aObject ); |
79 CIAUpdateManager& operator =( const CIAUpdateManager& aObject ); |
238 |
80 |
245 |
87 |
246 /** |
88 /** |
247 * Handles the application going into the background. |
89 * Handles the application going into the background. |
248 */ |
90 */ |
249 void HandleLosingForeground(); |
91 void HandleLosingForeground(); |
250 |
92 |
251 private:// new functions |
|
252 |
|
253 void CheckUpdatesContinue(); |
|
254 |
|
255 void CopyUpdateParamsL( const CIAUpdateParameters& aUpdateParameters ); |
|
256 |
93 |
257 private: // data |
94 private: // data |
|
95 |
|
96 // Handles the client server communication. |
|
97 IAUpdateClient* iUpdateClient; |
258 |
98 |
259 CIAUpdateParameters* iUpdateParameters; |
|
260 |
|
261 // Observer who will be informed about the completion of the operations. |
|
262 MIAUpdateObserver& iObserver; |
|
263 |
|
264 // Handles the client server communication. |
|
265 RIAUpdateClient iUpdateClient; |
|
266 |
|
267 // Informs what kind of operation is going on. |
|
268 TIAUpdateType iUpdateType; |
|
269 |
|
270 // This is used to storage the success count values for update operations. |
|
271 TInt iSuccessCount; |
|
272 |
|
273 // This is used to storage the fail count values for update operations. |
|
274 TInt iFailCount; |
|
275 |
|
276 // This is used to storage the cancel count values for update operations. |
|
277 TInt iCancelCount; |
|
278 |
|
279 TBool iUpdateNow; |
|
280 |
|
281 CEikonEnv* iEikEnv; //not owned |
99 CEikonEnv* iEikEnv; //not owned |
282 |
|
283 }; |
100 }; |
284 |
101 |
285 #endif // IA_UPDATE_IMPL_H |
102 #endif // IA_UPDATE_IMPL_H |