ncdengine/engine/transport/inc/catalogshttpdownload.h
changeset 53 ae54820ef82c
parent 25 98b66e4fb0be
child 50 c6e8afe0ba85
equal deleted inserted replaced
52:92f864ef0288 53:ae54820ef82c
    18 
    18 
    19 #ifndef C_CATALOGSHTTPDOWNLOAD_H
    19 #ifndef C_CATALOGSHTTPDOWNLOAD_H
    20 #define C_CATALOGSHTTPDOWNLOAD_H
    20 #define C_CATALOGSHTTPDOWNLOAD_H
    21 
    21 
    22 #include <DownloadMgrClient.h>
    22 #include <DownloadMgrClient.h>
    23 
    23 #include <download.h>
       
    24 #include <downloadevent.h>
    24 #include <s32file.h>
    25 #include <s32file.h>
    25 
    26 
    26 #include "catalogshttpoperation.h"
    27 #include "catalogshttpoperation.h"
    27 #include "catalogstransportoperationid.h"
    28 #include "catalogstransportoperationid.h"
    28 #include "catalogshttpconfigobserver.h"
    29 #include "catalogshttpconfigobserver.h"
    31 class MCatalogsHttpConfig;
    32 class MCatalogsHttpConfig;
    32 class CCatalogsHttpConfig;
    33 class CCatalogsHttpConfig;
    33 class CCatalogsHttpHeaders;
    34 class CCatalogsHttpHeaders;
    34 class CCatalogsKeyValuePair;
    35 class CCatalogsKeyValuePair;
    35 class CCatalogsHttpDownloadManager;
    36 class CCatalogsHttpDownloadManager;
    36 
    37 class CCatalogsHttpQTDownload;
       
    38 using namespace WRT;
    37 /**
    39 /**
    38 * HTTP file download implementation
    40 * HTTP file download implementation
    39 *
    41 *
    40 * @note Due to insufficient access to HTTP response headers through the 
    42 * @note Due to insufficient access to HTTP response headers through the 
    41 * Download manager, Download uses CCatalogsHttpTransaction with HTTP HEAD
    43 * Download manager, Download uses CCatalogsHttpTransaction with HTTP HEAD
    75     * @param aConfig Configuration
    77     * @param aConfig Configuration
    76     * @return A new HTTP download
    78     * @return A new HTTP download
    77     */
    79     */
    78     static CCatalogsHttpDownload* NewLC( 
    80     static CCatalogsHttpDownload* NewLC( 
    79         CCatalogsHttpDownloadManager& aOwner, 
    81         CCatalogsHttpDownloadManager& aOwner, 
    80         RHttpDownload* aDownload,
    82         Download* aDownload,
    81         const CCatalogsHttpConfig& aConfig );
    83         const CCatalogsHttpConfig& aConfig );
    82 
    84 
    83 
    85 
    84     /**
    86     /**
    85     * Destructor
    87     * Destructor
   236      * Not supported
   238      * Not supported
   237      * @see MCatalogsHttpOperation::StatusCode()
   239      * @see MCatalogsHttpOperation::StatusCode()
   238      */
   240      */
   239     TInt StatusCode() const;        
   241     TInt StatusCode() const;        
   240     
   242     
   241     
   243     TDownloadDeleteState GetStatusState();
       
   244     Download* GetDownload();
   242     /**
   245     /**
   243      * Not supported
   246      * Not supported
   244      * @see MCatalogsHttpOperation::StatusText()
   247      * @see MCatalogsHttpOperation::StatusText()
   245      */
   248      */
   246     const TDesC8& StatusText() const;
   249     const TDesC8& StatusText() const;
   280     void HandleHttpEventL( MCatalogsHttpOperation& aOperation,
   283     void HandleHttpEventL( MCatalogsHttpOperation& aOperation,
   281         TCatalogsHttpEvent aEvent );
   284         TCatalogsHttpEvent aEvent );
   282         
   285         
   283     TBool HandleHttpError( MCatalogsHttpOperation& aOperation, 
   286     TBool HandleHttpError( MCatalogsHttpOperation& aOperation, 
   284         TCatalogsHttpError aError );
   287         TCatalogsHttpError aError );
   285             
   288 
       
   289      void HandledownloadEventL(DownloadEvent& aEvent);   
       
   290               
   286 public:     
   291 public:     
   287 
   292 
   288     /**
   293     /**
   289     * Handles events from Download Manager
   294     * Handles events from Download Manager
   290     *
   295     *
   319     /**
   324     /**
   320     * Constructor
   325     * Constructor
   321     */
   326     */
   322     CCatalogsHttpDownload( 
   327     CCatalogsHttpDownload( 
   323         CCatalogsHttpDownloadManager& aOwner, 
   328         CCatalogsHttpDownloadManager& aOwner, 
   324         RHttpDownload* aDownload );
   329         Download* aDownload );
   325     
   330     
   326     /**
   331     /**
   327     * 2nd phase constructor
   332     * 2nd phase constructor
   328     */
   333     */
   329     void ConstructL( const CCatalogsHttpConfig* aConfig );
   334     void ConstructL( const CCatalogsHttpConfig* aConfig );
   507     
   512     
   508 private:
   513 private:
   509 
   514 
   510     CCatalogsHttpDownloadManager& iOwner;
   515     CCatalogsHttpDownloadManager& iOwner;
   511     TCatalogsTransportOperationId iId;  // Operation id
   516     TCatalogsTransportOperationId iId;  // Operation id
   512     RHttpDownload* iDownload;           // Platform download
   517     Download* iDownload;           // Platform download
   513     CCatalogsHttpConfig* iConfig;       // Configuration
   518     CCatalogsHttpConfig* iConfig;       // Configuration
   514     MCatalogsHttpObserver* iObserver;   // Observer        
   519     MCatalogsHttpObserver* iObserver;   // Observer        
   515     TCatalogsHttpEvent iState;          // State of the download
   520     TCatalogsHttpEvent iState;          // State of the download
   516     HBufC8* iUri;                       // Current URI
   521     HBufC8* iUri;                       // Current URI
   517     HBufC8* iEncodedUri;                // Current URI as encoded
   522     HBufC8* iEncodedUri;                // Current URI as encoded
   518     CCatalogsHttpHeaders* iResponseHeaders; // Headers from HTTP response
   523     CCatalogsHttpHeaders* iResponseHeaders; // Headers from HTTP response
       
   524     CCatalogsHttpQTDownload* iQTDownload;
   519     
   525     
   520     // added request headers not supported by DL man
   526     // added request headers not supported by DL man
   521     HBufC8* iAddedRequestHeaders;       
   527     HBufC8* iAddedRequestHeaders;       
   522     TInt iRefCount;        
   528     TInt iRefCount;        
   523     TBool iNormalDelete;
   529     TBool iNormalDelete;
   553 #endif    
   559 #endif    
   554     
   560     
   555     // For managing async pause with dlmgr.
   561     // For managing async pause with dlmgr.
   556     TBool iPausePending;
   562     TBool iPausePending;
   557     TBool iQueuedResume;
   563     TBool iQueuedResume;
   558     
   564     TDownloadDeleteState iStatus;
   559 protected:
   565 protected:
   560 
   566 
   561     // Grant access to UpdateContentType
   567     // Grant access to UpdateContentType
   562     friend class CCatalogsHttpDownloadManager;
   568     friend class CCatalogsHttpDownloadManager;
   563     
   569     
   564     };
   570     };
   565 
   571 
       
   572 class  CCatalogsHttpQTDownload: public QObject
       
   573 	{
       
   574 		 Q_OBJECT
       
   575 		 	public:
       
   576 		 		CCatalogsHttpQTDownload(CCatalogsHttpDownload* aHttpDownload,Download* aDownload);
       
   577 	    public slots:
       
   578     	void downloadEvent(WRT::DownloadEvent*);
       
   579     	void downloadError(WRT::Error);
       
   580 	    public:
       
   581 	    	CCatalogsHttpDownload* iCatalogsHttpDownload;
       
   582 	    	Download* iDownload;           // Platform download
       
   583 	};
       
   584 	
       
   585 	
   566 #endif // C_CATALOGSHTTPDOWNLOAD_H
   586 #endif // C_CATALOGSHTTPDOWNLOAD_H