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