inc/DrmUtilityDmgrWrapper.h
changeset 49 69d8e75812b7
parent 29 3bdc3b853094
equal deleted inserted replaced
48:c68061d56109 49:69d8e75812b7
    18 
    18 
    19 #ifndef CDRMUTILITYDMGRWRAPPER_H
    19 #ifndef CDRMUTILITYDMGRWRAPPER_H
    20 #define CDRMUTILITYDMGRWRAPPER_H
    20 #define CDRMUTILITYDMGRWRAPPER_H
    21 
    21 
    22 #include <f32file.h> // RFs
    22 #include <f32file.h> // RFs
    23 #include <DownloadMgrClient.h>
       
    24 #include <RoapObserver.h> // Roap::MRoapObserver
    23 #include <RoapObserver.h> // Roap::MRoapObserver
    25 #include <AknProgressDialog.h> // MAknProgressDialogCallback CAknProgressDialog
    24 #include <AknProgressDialog.h> // MAknProgressDialogCallback CAknProgressDialog
    26 
    25 
       
    26 // download apis
       
    27 #include <downloadmanager.h>
       
    28 #include <download.h>
       
    29 #include <downloadevent.h>
    27 
    30 
    28 namespace Roap
    31 namespace Roap
    29     {
    32     {
    30     class CRoapEng;
    33     class CRoapEng;
    31     }
    34     }
    34     {
    37     {
    35     class CDrmUtilityConnection;
    38     class CDrmUtilityConnection;
    36     }
    39     }
    37 class CDRMRights;
    40 class CDRMRights;
    38 class CEikProgressInfo;
    41 class CEikProgressInfo;
    39 
    42 class DrmUtilityEventHandler;
       
    43 class QDrmUtilityDmgrEventHandler;
    40 
    44 
    41 /**
    45 /**
    42 * Environment gate function
    46 * Environment gate function
    43 *
    47 *
    44 * @since S60 v5.0
    48 * @since S60 v5.0
    65 *  @lib DrmUtilityDmgrWrapper
    69 *  @lib DrmUtilityDmgrWrapper
    66 *  @since S60 v5.0
    70 *  @since S60 v5.0
    67 */
    71 */
    68 class CDrmUtilityDmgrWrapper :
    72 class CDrmUtilityDmgrWrapper :
    69     public CActive,
    73     public CActive,
    70     public MHttpDownloadMgrObserver,
       
    71     public Roap::MRoapObserver,
    74     public Roap::MRoapObserver,
    72     public MDrmUtilityDmgrWrapper,
    75     public MDrmUtilityDmgrWrapper,
    73     public MProgressDialogCallback
    76     public MProgressDialogCallback
    74     {
    77     {
    75 private:
    78 private:
   103     void DownloadAndHandleRoapTriggerL( const HBufC8* aUrl,
   106     void DownloadAndHandleRoapTriggerL( const HBufC8* aUrl,
   104         CCoeEnv& aCoeEnv );
   107         CCoeEnv& aCoeEnv );
   105 
   108 
   106     HBufC8* GetErrorUrlL();
   109     HBufC8* GetErrorUrlL();
   107 
   110 
   108 
       
   109     // from base class MHttpDownloadMgrObserver
       
   110 
       
   111     /**
       
   112     * From MHttpDownloadMgrObserver.
       
   113     * Handle download manager events
       
   114     *
       
   115     * @param aDownload the download
       
   116     * @param aEvent the event
       
   117     */
       
   118     void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
       
   119 
       
   120 // From Roap::MRoapObserver
   111 // From Roap::MRoapObserver
   121     /**
   112     /**
   122     * ConnectionConfL
   113     * ConnectionConfL
   123     * @return ETrue: the network can be establish
   114     * @return ETrue: the network can be establish
   124     *         EFalse: the ROAP transaction is canceled
   115     *         EFalse: the ROAP transaction is canceled
   250     * Get's called when a dialog is dismissed.
   241     * Get's called when a dialog is dismissed.
   251     *
   242     *
   252     * @param aButtonId ID of the button pressed
   243     * @param aButtonId ID of the button pressed
   253     */
   244     */
   254     void DialogDismissedL( TInt aButtonId );
   245     void DialogDismissedL( TInt aButtonId );
       
   246     
       
   247     /**
       
   248 	* Handle download manager events
       
   249 	*
       
   250 	* @param aEvent the event
       
   251 	*/
       
   252             
       
   253     void HandleDownloadEventL( WRT::DownloadEvent* aEvent );
   255 
   254 
   256 protected:
   255 protected:
   257     //from Cactive
   256     //from Cactive
   258     virtual void DoCancel();
   257     virtual void DoCancel();
   259 
   258 
   285     void DoSaveRoapTriggerL( TDownloadState aNextState );
   284     void DoSaveRoapTriggerL( TDownloadState aNextState );
   286 
   285 
   287     void DoHandleRoapTriggerL( TDownloadState aNextState );
   286     void DoHandleRoapTriggerL( TDownloadState aNextState );
   288 
   287 
   289     void CompleteToState( TDownloadState aNextState, TInt aError );
   288     void CompleteToState( TDownloadState aNextState, TInt aError );
       
   289     
       
   290     void ProcessDownloadEventL( WRT::Download& aDownload, WRT::DownloadEvent& aEvent );
   290 
   291 
   291 private: // data
   292 private: // data
   292 
   293 
   293     /**
   294     /**
   294     * Download manager session
   295     * Download manager session
   295     */
   296     */
   296     RHttpDownloadMgr iDlMgr;
   297     WRT::DownloadManager* iDlMgr;
   297 
   298 
       
   299     /**
       
   300      * Download instance needs to be stored for handling signal slot mechanism
       
   301      */
       
   302     WRT::Download* iDownload;
       
   303     
   298     /**
   304     /**
   299     * Used to make downloads synchronous
   305     * Used to make downloads synchronous
   300     */
   306     */
   301     CActiveSchedulerWait iWait;
   307     CActiveSchedulerWait iWait;
   302 
   308 
   358     RFs iFs;
   364     RFs iFs;
   359 
   365 
   360     HBufC* iFileName;
   366     HBufC* iFileName;
   361 
   367 
   362     DRM::CDrmUtilityConnection* iConnection;
   368     DRM::CDrmUtilityConnection* iConnection;
       
   369     
       
   370     QDrmUtilityDmgrEventHandler* iDrmUtilityDmgrEventHandler; 
   363     };
   371     };
   364 
   372 
   365 #endif // CDRMUTILITYDMGRWRAPPER_H
   373 #endif // CDRMUTILITYDMGRWRAPPER_H