epoc32/include/mw/brctldownloadobserver.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/brctldownloadobserver.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/brctldownloadobserver.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,163 @@
     1.4 -brctldownloadobserver.h
     1.5 +/*
     1.6 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Eclipse Public License v1.0"
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Handle download events
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef BRCTLDOWNLOADOBSERVER_H
    1.24 +#define BRCTLDOWNLOADOBSERVER_H
    1.25 +
    1.26 +//  INCLUDES
    1.27 +#include <e32std.h>
    1.28 +#include <e32base.h>
    1.29 +#include <BrCtlDefs.h>
    1.30 +
    1.31 +// CONSTANTS
    1.32 +
    1.33 +// MACROS
    1.34 +
    1.35 +/**
    1.36 +* Defines the download events sent to the host application by the Download Manager.
    1.37 +* @attention For more information on aValue, see the HandleDownloadEventL function.
    1.38 +*/
    1.39 +enum TBrCtlDownloadEvent
    1.40 +    {
    1.41 +    /**
    1.42 +    * A download has started. The aValue associated with this 
    1.43 +    * event is the total size of the file to be downloaded. 
    1.44 +    * @see For more information on aValue, see HandleDownloadEventL.
    1.45 +    */
    1.46 +    EDownloadEventStarted,      
    1.47 +    /**
    1.48 +    * A download has completed. The aValue associated with this event 
    1.49 +    * is the total size of the file that was downloaded.
    1.50 +    */
    1.51 +    EDownloadEventCompleted,    
    1.52 +    /**
    1.53 +    * A download is in progress. The aValue associated with this event 
    1.54 +    * is the size of the file that was downloaded so far.
    1.55 +    */
    1.56 +    EDownloadEventProgress,     
    1.57 +    /** 
    1.58 +    * A download was canceled by the HandleDownloadCommandL function.
    1.59 +    */
    1.60 +    EDownloadEventCanceled,     
    1.61 +    /**
    1.62 +    * An error occurred in the Download Manager during a download operation.
    1.63 +    */
    1.64 +    EDownloadEventError,         
    1.65 +    /**
    1.66 +    * A download was paused. The aValue associated with this event 
    1.67 +    * is the size of the file that was downloaded before the pause occurred.
    1.68 +    */
    1.69 +    EDownloadEventPaused,   
    1.70 +    /**
    1.71 +    * A paused download was resumed. The aValue associated with this event 
    1.72 +    * is the size of the file that was downloaded so far.
    1.73 +    */
    1.74 +  EDownloadEventResumed,  
    1.75 +    /**
    1.76 +    * Notifies the host application as to whether or not a particular 
    1.77 +    * download can be paused. The aValue associated with this event is one of the following:
    1.78 +    * ETrue if the download can be paused
    1.79 +    * EFalse if the download cannot be paused
    1.80 +    */
    1.81 +  EDownloadEventPausable  
    1.82 +    };
    1.83 +
    1.84 +// FORWARD DECLARATIONS
    1.85 +class CBrCtlInterface;
    1.86 +
    1.87 +/**
    1.88 +* The MBrCtlDownloadObserver class handles download events.
    1.89 +*
    1.90 +* Usage:
    1.91 +*
    1.92 +* @code
    1.93 +*  #include <BrCtlDownloadObserver.h>
    1.94 +*
    1.95 +*  
    1.96 +* @see S60 Platform: Browser Control API Developer's Guide Version 2.0
    1.97 +* @lib BrowserEngine.lib
    1.98 +* @file BrCtlDownloadObserver.h
    1.99 +* @endcode     *
   1.100 +*/
   1.101 +class MBrCtlDownloadObserver
   1.102 +    {
   1.103 +    public: // New functions
   1.104 +        /**
   1.105 +        * Inform the host application that a new download has started using the Download Manager
   1.106 +        * @since 3.0
   1.107 +        * @param aTransactionID The ID of the transaction, it is unique as long as the transaction is on-going
   1.108 +        * @param aFileName Name of the file in which the downloaded content is stored
   1.109 +        * @param aContentType Type of content to be downloaded. For example:
   1.110 +        * Markup, Image, Cascading Style Sheet (CSS), Javascript, Netscape plug-in, Sound
   1.111 +        * @param aUrl The Url of the request to be done in the new window
   1.112 +        * @return ETrue if the file can be displayed or played while it is 
   1.113 +        * downloading (progressive download)
   1.114 +        * EFalse if the file cannot be displayed or played while it is downloading
   1.115 +        */
   1.116 +        virtual TBool NewDownloadL(TUint aTransactionID,
   1.117 +                                   const TDesC& aFileName,
   1.118 +                                   const TDesC& aContentType,
   1.119 +                                   const TDesC& aUrl) = 0;
   1.120 +                                   
   1.121 +        /**
   1.122 +        * Tells the host application to resume an incomplete download. 
   1.123 +        * After the host application restarts, this method is called 
   1.124 +        * for each file whose download was interrupted when the host application closed.
   1.125 +        * @since 3.0
   1.126 +        * @param aTransactionID ID of the transaction
   1.127 +        * This ID must be unique while the transaction is in progress.
   1.128 +        * @param aLength Length of the content previously downloaded
   1.129 +        * @param aFileName Name of the file in which the downloaded content is stored
   1.130 +        * @param aContentType Type of content downloaded. For example:
   1.131 +        * Markup, Image, Cascading Style Sheet (CSS), Javascript, Netscape plug-in, Sound 
   1.132 +        * @param aUrl URL of the source of the content to be done in the new window
   1.133 +        * @return None
   1.134 +        */
   1.135 +        virtual void ResumeDownloadL(TUint aTransactionID,
   1.136 +                                   TUint aLength,
   1.137 +                                   const TDesC& aFileName,
   1.138 +                                   const TDesC& aContentType,
   1.139 +                                   const TDesC& aUrl) = 0;
   1.140 +
   1.141 +
   1.142 +
   1.143 +        /**
   1.144 +        * Informs the host application that one of the following download events is in progress:
   1.145 +        * NOTE: All events have the prefix EDownload:
   1.146 +        * EventStarted, EventCompleted, EventProgress, EventCanceled, EventError 
   1.147 +        * EventPaused, EventResumed, EventPausable
   1.148 +        * @since 3.0
   1.149 +        * @param aTransactionID The ID of the transaction, it is unique as long 
   1.150 +        * as the transaction is on-going
   1.151 +        * @param aDownloadEvent Event to be handled Examples:
   1.152 +        * EventStarted, EventCompleted, EventProgress, EventCanceled, EventError 
   1.153 +        * EventPaused, EventResumed, EventPausable
   1.154 +        * @param aValue Value associated with the event. Examples:
   1.155 +        * Total size of the downloaded file
   1.156 +        * Size of that was downloaded so far
   1.157 +        * @return void
   1.158 +        */
   1.159 +        virtual void HandleDownloadEventL(TUint aTransactionID, 
   1.160 +                                          TBrCtlDownloadEvent aDownloadEvent,
   1.161 +                                          TUint aValue) = 0;             
   1.162 +
   1.163 +    };
   1.164 +
   1.165 +#endif      // BRCTLDOWNLOADOBSERVER_H
   1.166 +            
   1.167 +// End of File