codhandler/codeng/inc/CodLoadObserver.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *      Declaration of class MCodLoadObserver.   
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef COD_LOAD_OBSERVER_H
       
    22 #define COD_LOAD_OBSERVER_H
       
    23 
       
    24 // FORWARD DECLARATION
       
    25 
       
    26 class CRoapData;
       
    27 
       
    28 // INCLUDES
       
    29 
       
    30 #include <e32std.h>
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * Mixin class to observe COD handling (progress, result etc.)
       
    36 */
       
    37 class MCodLoadObserver
       
    38     {
       
    39     public:     // COD handling progress.
       
    40 
       
    41         /**
       
    42         * Get download root path.
       
    43         * Leave with KErrCancel if query is cancelled.
       
    44         * @param aRootPath Root path returned here.
       
    45         */
       
    46         virtual void GetRootPathL( TDes& aRootPath ) = 0;
       
    47 
       
    48         /**
       
    49         * Starting load (fetch content or error-notify).
       
    50         * @param aStatusCode HTTP status code.
       
    51         * - 900 (Success) indicates start of content load.
       
    52         * - Other values indicate start of error report.
       
    53         */
       
    54         virtual void StartLoadL( TInt aStatusCode ) = 0;
       
    55 
       
    56         /**
       
    57         * Cancelling content load started. Not called if cancelling error
       
    58         * report.
       
    59         */
       
    60         virtual void StartCancelL() = 0;
       
    61 
       
    62         /**
       
    63         * Load progress update.
       
    64         * @param aFinalValue Final progress value.
       
    65         * @param aCurrentValue Current progress value.
       
    66         */
       
    67         virtual void ProgressL( TInt aFinalValue, TInt aCurrentValue ) = 0;
       
    68 
       
    69         /**
       
    70         * Processing ended.
       
    71         * Note that if processing does not include loading, this method can be
       
    72         * called without a preceding StartLoadL call.
       
    73         * @param aStatusCode HTTP status code (aError mapped to HTTP status
       
    74         * code).
       
    75         * @param aError Error code of result. (The Set(), Accept() or Reject()
       
    76         * request to CodEng will also complete with this value.)
       
    77         */
       
    78         virtual void Done( TInt aStatusCode, TInt aError ) = 0;
       
    79 
       
    80         /**
       
    81         * Set Connection Error
       
    82         * @param aError Connection Error .
       
    83         */
       
    84 		virtual void SetConnError( TInt aError) = 0;
       
    85 
       
    86         /**
       
    87         * Connection Error
       
    88         * return: Connection Error .
       
    89         */
       
    90 		virtual TInt ConnError() = 0;
       
    91 
       
    92         /**
       
    93         * Progresive download is available
       
    94 		*/
       
    95 		virtual void PdPlayAvailable() = 0;
       
    96 		
       
    97 		
       
    98         /**
       
    99         * Set ActiveDownload is available
       
   100 		*/
       
   101 		virtual void SetActiveDownload( ) = 0;
       
   102 
       
   103 
       
   104     public:     // HTTP & OTA related progress.
       
   105 
       
   106         /**
       
   107         * Get confirmation for creating network connection.
       
   108         * @return ETrue if connection can be created.
       
   109         */
       
   110         virtual TBool ConfirmConnectL() = 0;
       
   111 
       
   112         /**
       
   113         * Opening a connection.
       
   114         * @param aIap AP to be used for creating the connection.
       
   115         */
       
   116         virtual void StartConnect( TUint32 aIap ) = 0;
       
   117 
       
   118         /**
       
   119         * Connected.
       
   120         */
       
   121         virtual void EndConnect() = 0;
       
   122 
       
   123         /**
       
   124         * Authenticate user.
       
   125         * @param aHost Host.
       
   126         * @param aRealm Realm.
       
   127         * @param aProxyAuth ETrue if this is a proxy authentication.
       
   128         * @param aUsername Return username here.
       
   129         * @param aPassword Return password here.
       
   130         * @return ETrue if auth is OK, EFalse if cancelled.
       
   131         */
       
   132         virtual TBool UserAuthL
       
   133             (
       
   134             const TDesC& aHost,
       
   135             const TDesC& aRealm,
       
   136             TBool aProxyAuth,
       
   137             TDes& aUsername,
       
   138             TDes& aPassword
       
   139             ) = 0;
       
   140 
       
   141         /**
       
   142         * Displays Info message "Waiting for license" 
       
   143         */
       
   144         virtual void WaitForLicenseL() = 0;
       
   145             
       
   146     public:     // ROAP related.
       
   147             
       
   148         /**
       
   149         * ROAP Trigger parsed (success or error).
       
   150         * @param aData ROAP Trigger data.
       
   151         */
       
   152         virtual void RoapTriggerParsedL( const CRoapData& aData ) = 0;
       
   153         
       
   154     public:
       
   155             
       
   156         /**
       
   157         * To indicate the download is paused
       
   158         */
       
   159         virtual void DownloadPaused() = 0;
       
   160         
       
   161         /**
       
   162         * To indicate the download is resumed and ready for PD
       
   163         */
       
   164         virtual void DownloadResumedPdAvailable() = 0;
       
   165         
       
   166         /**
       
   167         * To update the server about whether or not download is pausable
       
   168         */
       
   169         virtual void UpdatePausable( TBool aPausable ) = 0;
       
   170         
       
   171         /**
       
   172         * To update the server about updated media info
       
   173         */
       
   174         virtual void UpdateMediaInfoL() = 0;
       
   175         
       
   176         /**
       
   177         * To update the server about updated track
       
   178         */
       
   179         virtual void UpdateTrackInfoL() = 0;
       
   180         
       
   181         /**
       
   182         * 
       
   183         * To handle PostResponseUrlL as part of metering response
       
   184         * @param aPrUrl: The PostResponseURL
       
   185         * @return void
       
   186         *  
       
   187         */
       
   188         virtual void HandleRoapPostResponseUrlL( const TDesC8& aPrUrl ) = 0;
       
   189  
       
   190         /**
       
   191         * To update the server about next media object being downloaded.
       
   192         */        
       
   193         virtual void MediaObjectNameChanged() = 0;
       
   194         
       
   195         /**
       
   196         * To update the server about content type.
       
   197         */        
       
   198         virtual void ContentTypeChanged() = 0;
       
   199     };
       
   200 
       
   201 #endif /* def COD_LOAD_OBSERVER_H */