equal
deleted
inserted
replaced
22 #include <DownloadMgrClient.h> |
22 #include <DownloadMgrClient.h> |
23 |
23 |
24 #include "catalogstransportoperationid.h" |
24 #include "catalogstransportoperationid.h" |
25 #include "catalogshttpsession.h" // RCatalogsHttpOperationArray |
25 #include "catalogshttpsession.h" // RCatalogsHttpOperationArray |
26 #include "catalogshttpsessionmanager.h" |
26 #include "catalogshttpsessionmanager.h" |
|
27 |
27 #include "catalogsconnectionmethod.h" |
28 #include "catalogsconnectionmethod.h" |
28 #include "catalogsaccesspointobserver.h" |
29 #include "catalogsaccesspointobserver.h" |
29 |
30 #include <download.h> |
|
31 #include <downloadmanager.h> |
|
32 #include <QObject> |
30 class MCatalogsHttpConfig; |
33 class MCatalogsHttpConfig; |
31 class CCatalogsHttpConfig; |
34 class CCatalogsHttpConfig; |
32 class CCatalogsHttpDownload; |
35 class CCatalogsHttpDownload; |
33 class MCatalogsHttpOperation; |
36 class MCatalogsHttpOperation; |
34 class MCatalogsHttpObserver; |
37 class MCatalogsHttpObserver; |
36 class MCatalogsHttpTransactionManager; |
39 class MCatalogsHttpTransactionManager; |
37 class CCatalogsHttpConnectionManager; |
40 class CCatalogsHttpConnectionManager; |
38 class CCatalogsHttpSession; |
41 class CCatalogsHttpSession; |
39 class CCatalogsConnection; |
42 class CCatalogsConnection; |
40 class CCatalogsNetworkManager; |
43 class CCatalogsNetworkManager; |
|
44 class CCatalogsHttpQTDownloadManager; |
|
45 using namespace WRT; |
|
46 |
|
47 const TInt KNCDEngineAppID = 0X2002E685; |
|
48 |
41 |
49 |
42 /** |
50 /** |
43 * HTTP file download manager |
51 * HTTP file download manager |
44 * |
52 * |
45 */ |
53 */ |
46 class CCatalogsHttpDownloadManager : |
54 class CCatalogsHttpDownloadManager : |
|
55 |
47 public CActive, |
56 public CActive, |
48 public MHttpDownloadMgrObserver, |
|
49 public MCatalogsAccessPointObserver |
57 public MCatalogsAccessPointObserver |
50 { |
58 { |
|
59 |
51 public: // Constructors and destructor |
60 public: // Constructors and destructor |
52 |
61 |
53 /** |
62 /** |
54 * Creator |
63 * Creator |
55 * |
64 * |
67 |
76 |
68 /** |
77 /** |
69 * Destructor |
78 * Destructor |
70 */ |
79 */ |
71 virtual ~CCatalogsHttpDownloadManager(); |
80 virtual ~CCatalogsHttpDownloadManager(); |
72 |
81 |
73 public: // New methods |
82 public: // New methods |
74 |
83 |
75 /** |
84 /** |
76 * Creates a new download operation |
85 * Creates a new download operation |
77 * |
86 * |
157 |
166 |
158 public: |
167 public: |
159 |
168 |
160 void AddRef(); |
169 void AddRef(); |
161 |
170 |
162 |
171 DownloadManager* GetDownloadManager(); |
163 TInt Release(); |
172 TInt Release(); |
164 |
173 |
165 void SetConnectionMethodL( |
174 void SetConnectionMethodL( |
166 const TCatalogsConnectionMethod& aMethod ); |
175 const TCatalogsConnectionMethod& aMethod ); |
167 |
176 |
200 |
209 |
201 CDocumentHandler& DocumentHandler(); |
210 CDocumentHandler& DocumentHandler(); |
202 |
211 |
203 TInt NewDownloadId(); |
212 TInt NewDownloadId(); |
204 |
213 |
205 RHttpDownload& CreatePlatformDownloadL( const TDesC8& aUrl ); |
214 WRT::Download& CreatePlatformDownloadL( const TDesC8& aUrl ); |
206 |
215 void downloadMgrEventRecieved(WRT::DownloadEvent* dlmEvent); |
207 public: // From MHttpDownloadMngrObserver |
216 |
208 |
|
209 /** |
|
210 * Handles events from Download manager |
|
211 */ |
|
212 virtual void HandleDMgrEventL( RHttpDownload& aDownload, |
|
213 THttpDownloadEvent aEvent ); |
|
214 |
217 |
215 |
218 |
216 public: // from MCatalogsAccessPointObserver |
219 public: // from MCatalogsAccessPointObserver |
217 |
220 |
218 virtual void HandleAccessPointEventL( |
221 virtual void HandleAccessPointEventL( |
314 |
317 |
315 /** |
318 /** |
316 * Deletes downloads that have not been paused by the user |
319 * Deletes downloads that have not been paused by the user |
317 */ |
320 */ |
318 void DeleteHangingDownloads(); |
321 void DeleteHangingDownloads(); |
319 |
322 |
320 |
|
321 private: |
323 private: |
322 |
324 |
323 MCatalogsHttpSessionManager& iManager; |
325 MCatalogsHttpSessionManager& iManager; |
324 CCatalogsHttpSession& iSession; |
326 CCatalogsHttpSession& iSession; |
325 MCatalogsHttpTransactionManager& iTrManager; |
327 MCatalogsHttpTransactionManager& iTrManager; |
326 CCatalogsHttpConnectionManager& iConnectionManager; |
328 CCatalogsHttpConnectionManager& iConnectionManager; |
327 CCatalogsNetworkManager* iNetworkManager; // Not owned |
329 CCatalogsNetworkManager* iNetworkManager; // Not owned |
328 TInt32 iSessionId; |
330 TInt32 iSessionId; |
329 RHttpDownloadMgr iDmgr; |
331 DownloadManager *iDmgr; |
330 |
332 CCatalogsHttpQTDownloadManager* iQTmgr; |
|
333 WRT::Download* iDownload; // Platform download |
331 // All downloads except those that are in Restored |
334 // All downloads except those that are in Restored |
332 RCatalogsHttpOperationArray iDownloads; |
335 RCatalogsHttpOperationArray iDownloads; |
333 RCatalogsHttpOperationArray iRestoredDownloads; |
336 RCatalogsHttpOperationArray iRestoredDownloads; |
334 |
337 |
335 CCatalogsHttpConfig* iDefaultConfig; // owned |
338 CCatalogsHttpConfig* iDefaultConfig; // owned |
342 |
345 |
343 RArray<TDownloadEvent> iEventQueue; |
346 RArray<TDownloadEvent> iEventQueue; |
344 TInt iCurrentDlId; // id of the last created download |
347 TInt iCurrentDlId; // id of the last created download |
345 }; |
348 }; |
346 |
349 |
347 #endif // C_CATALOGSHTTPDOWNLOADMANAGER_H |
350 |
|
351 |
|
352 class CCatalogsHttpQTDownloadManager: public QObject |
|
353 { |
|
354 Q_OBJECT |
|
355 public: |
|
356 CCatalogsHttpQTDownloadManager(CCatalogsHttpDownloadManager* aDownloadManager,DownloadManager* aDmgr); |
|
357 public slots: |
|
358 void downloadMgrEventRecieved(WRT::DownloadEvent*); |
|
359 public: |
|
360 CCatalogsHttpDownloadManager* iDownloadManager; |
|
361 DownloadManager* iDmgr ; |
|
362 }; |
|
363 |
|
364 #endif // C_CATALOGSHTTPDOWNLOADMANAGER_H |