omadrm/drmplugins/drmrohandler/inc/rohandlerdmgrwrapper.h
branchRCL_3
changeset 72 1481bf457703
parent 71 1221b68b8a5f
equal deleted inserted replaced
71:1221b68b8a5f 72:1481bf457703
    17 
    17 
    18 
    18 
    19 #ifndef ROHANDLERDMGRWRAPPER_H
    19 #ifndef ROHANDLERDMGRWRAPPER_H
    20 #define ROHANDLERDMGRWRAPPER_H
    20 #define ROHANDLERDMGRWRAPPER_H
    21 
    21 
    22 #include <e32base.h>
    22 namespace Roap
    23 #include <f32file.h>
    23     {
    24 
    24     class MRoapObserver;
    25 #include <RoapObserver.h>
    25     }
    26 #include <RoapEng.h>
       
    27 
       
    28 #include <qobject.h>
       
    29 #include <downloadmanager.h>
       
    30 #include <download.h>
       
    31 
    26 
    32 class CDRMRights;
    27 class CDRMRights;
    33 class QRoHandlerDMgrEventHandler;
    28 
       
    29 class MHttpDownloadMgrObserver;
    34 
    30 
    35 class MRoHandlerDMgrWrapper
    31 class MRoHandlerDMgrWrapper
    36     {
    32     {
       
    33 
    37 public:
    34 public:
    38     virtual void HandleRoapTriggerL( const TDesC8& aTrigger ) = 0;
    35     virtual void HandleRoapTriggerL( const TDesC8& aTrigger ) = 0;
       
    36 
       
    37     virtual void DownloadAndHandleRoapTriggerL( const HBufC8* aUrl ) = 0;
       
    38 
       
    39     virtual void DownloadAndHandleRoapTriggerFromPrUrlL( const HBufC8* aUrl ) = 0;
       
    40 
    39     };
    41     };
    40 
    42 
    41 /**
    43 /**
    42 *  Class for downloading ROAP triggers
    44 *  Class for downloading ROAP triggers
    43 *
    45 *
    44 */
    46 */
    45 class CRoHandlerDMgrWrapper:
    47 class CRoHandlerDMgrWrapper:
    46     public CActive, // Now active
    48     public CActive, // Now active
       
    49     public MHttpDownloadMgrObserver,
    47     public Roap::MRoapObserver,
    50     public Roap::MRoapObserver,
    48     public MRoHandlerDMgrWrapper
    51     public MRoHandlerDMgrWrapper
    49     {
    52     {
    50 private:
    53 private:
    51     enum TMeterState
    54     enum TMeterState
    73     * @since S60 3.2
    76     * @since S60 3.2
    74     * @param aUrl  URL of ROAP trigger
    77     * @param aUrl  URL of ROAP trigger
    75     */
    78     */
    76     void HandleRoapTriggerL( const TDesC8& aTrigger );
    79     void HandleRoapTriggerL( const TDesC8& aTrigger );
    77 
    80 
       
    81     void DownloadAndHandleRoapTriggerL( const HBufC8* aUrl );
       
    82 
       
    83     void DownloadAndHandleRoapTriggerFromPrUrlL( const HBufC8* aUrl );
       
    84 
       
    85 
       
    86 // from base class MHttpDownloadMgrObserver
       
    87 
       
    88     /**
       
    89     * From MHttpDownloadMgrObserver.
       
    90     * Handle download manager events
       
    91     *
       
    92     * @since S60 3.2
       
    93     * @param aDownload the download
       
    94     * @param aEvent the event
       
    95     */
       
    96     void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
       
    97 
    78 // From Roap::MRoapObserver
    98 // From Roap::MRoapObserver
    79     /**
    99     /**
    80     * ConnectionConfL
   100     * ConnectionConfL
    81     * @return ETrue: the network can be establish
   101     * @return ETrue: the network can be establish
    82     *         EFalse: the ROAP transaction is canceled
   102     *         EFalse: the ROAP transaction is canceled
   199     *
   219     *
   200     *
   220     *
   201     * @leave  System wide error code */
   221     * @leave  System wide error code */
   202     void PostResponseUrlL( const TDesC8& aPostResponseUrl );
   222     void PostResponseUrlL( const TDesC8& aPostResponseUrl );
   203 
   223 
   204     /**
       
   205 	* Handle download manager events
       
   206 	*
       
   207 	* @param aEvent the event
       
   208 	*/
       
   209 	void HandleDownloadEventL( WRT::DownloadEvent* aEvent );
       
   210 
       
   211 protected:
   224 protected:
   212     //from Cactive
   225     //from Cactive
   213     virtual void DoCancel();
   226     virtual void DoCancel();
   214 
   227 
   215     virtual void RunL();
   228     virtual void RunL();
   241 private: // data
   254 private: // data
   242 
   255 
   243     /**
   256     /**
   244     * Download manager session
   257     * Download manager session
   245     */
   258     */
   246     WRT::DownloadManager* iDlMgr;
   259     RHttpDownloadMgr iDlMgr;
   247 
   260 
   248     WRT::Download* iDownload;
       
   249     /**
   261     /**
   250     * Used to make downloads synchronous
   262     * Used to make downloads synchronous
   251     */
   263     */
   252     CActiveSchedulerWait iWait;
   264     CActiveSchedulerWait iWait;
   253 
   265 
   273     Roap::CRoapEng* iRoapEng;
   285     Roap::CRoapEng* iRoapEng;
   274 
   286 
   275     RFs iFs;
   287     RFs iFs;
   276 
   288 
   277     HBufC* iFileName;
   289     HBufC* iFileName;
   278     
       
   279     QRoHandlerDMgrEventHandler* iRoHandlerDMgrEventHandler;
       
   280     
       
   281     };
   290     };
   282 
   291 
   283 #endif // ROHANDLERDMGRWRAPPER_H
   292 #endif // ROHANDLERDMGRWRAPPER_H