williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Handle download events williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef BRCTLDOWNLOADOBSERVER_H williamr@2: #define BRCTLDOWNLOADOBSERVER_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: // CONSTANTS williamr@2: williamr@2: // MACROS williamr@2: williamr@2: /** williamr@2: * Defines the download events sent to the host application by the Download Manager. williamr@2: * @attention For more information on aValue, see the HandleDownloadEventL function. williamr@2: */ williamr@2: enum TBrCtlDownloadEvent williamr@2: { williamr@2: /** williamr@2: * A download has started. The aValue associated with this williamr@2: * event is the total size of the file to be downloaded. williamr@2: * @see For more information on aValue, see HandleDownloadEventL. williamr@2: */ williamr@2: EDownloadEventStarted, williamr@2: /** williamr@2: * A download has completed. The aValue associated with this event williamr@2: * is the total size of the file that was downloaded. williamr@2: */ williamr@2: EDownloadEventCompleted, williamr@2: /** williamr@2: * A download is in progress. The aValue associated with this event williamr@2: * is the size of the file that was downloaded so far. williamr@2: */ williamr@2: EDownloadEventProgress, williamr@2: /** williamr@2: * A download was canceled by the HandleDownloadCommandL function. williamr@2: */ williamr@2: EDownloadEventCanceled, williamr@2: /** williamr@2: * An error occurred in the Download Manager during a download operation. williamr@2: */ williamr@2: EDownloadEventError, williamr@2: /** williamr@2: * A download was paused. The aValue associated with this event williamr@2: * is the size of the file that was downloaded before the pause occurred. williamr@2: */ williamr@2: EDownloadEventPaused, williamr@2: /** williamr@2: * A paused download was resumed. The aValue associated with this event williamr@2: * is the size of the file that was downloaded so far. williamr@2: */ williamr@2: EDownloadEventResumed, williamr@2: /** williamr@2: * Notifies the host application as to whether or not a particular williamr@2: * download can be paused. The aValue associated with this event is one of the following: williamr@2: * ETrue if the download can be paused williamr@2: * EFalse if the download cannot be paused williamr@2: */ williamr@2: EDownloadEventPausable williamr@2: }; williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CBrCtlInterface; williamr@2: williamr@2: /** williamr@2: * The MBrCtlDownloadObserver class handles download events. williamr@2: * williamr@2: * Usage: williamr@2: * williamr@2: * @code williamr@2: * #include williamr@2: * williamr@2: * williamr@2: * @see S60 Platform: Browser Control API Developer's Guide Version 2.0 williamr@2: * @lib BrowserEngine.lib williamr@2: * @file BrCtlDownloadObserver.h williamr@2: * @endcode * williamr@2: */ williamr@2: class MBrCtlDownloadObserver williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * Inform the host application that a new download has started using the Download Manager williamr@2: * @since 3.0 williamr@2: * @param aTransactionID The ID of the transaction, it is unique as long as the transaction is on-going williamr@2: * @param aFileName Name of the file in which the downloaded content is stored williamr@2: * @param aContentType Type of content to be downloaded. For example: williamr@2: * Markup, Image, Cascading Style Sheet (CSS), Javascript, Netscape plug-in, Sound williamr@2: * @param aUrl The Url of the request to be done in the new window williamr@2: * @return ETrue if the file can be displayed or played while it is williamr@2: * downloading (progressive download) williamr@2: * EFalse if the file cannot be displayed or played while it is downloading williamr@2: */ williamr@2: virtual TBool NewDownloadL(TUint aTransactionID, williamr@2: const TDesC& aFileName, williamr@2: const TDesC& aContentType, williamr@2: const TDesC& aUrl) = 0; williamr@2: williamr@2: /** williamr@2: * Tells the host application to resume an incomplete download. williamr@2: * After the host application restarts, this method is called williamr@2: * for each file whose download was interrupted when the host application closed. williamr@2: * @since 3.0 williamr@2: * @param aTransactionID ID of the transaction williamr@2: * This ID must be unique while the transaction is in progress. williamr@2: * @param aLength Length of the content previously downloaded williamr@2: * @param aFileName Name of the file in which the downloaded content is stored williamr@2: * @param aContentType Type of content downloaded. For example: williamr@2: * Markup, Image, Cascading Style Sheet (CSS), Javascript, Netscape plug-in, Sound williamr@2: * @param aUrl URL of the source of the content to be done in the new window williamr@2: * @return None williamr@2: */ williamr@2: virtual void ResumeDownloadL(TUint aTransactionID, williamr@2: TUint aLength, williamr@2: const TDesC& aFileName, williamr@2: const TDesC& aContentType, williamr@2: const TDesC& aUrl) = 0; williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Informs the host application that one of the following download events is in progress: williamr@2: * NOTE: All events have the prefix EDownload: williamr@2: * EventStarted, EventCompleted, EventProgress, EventCanceled, EventError williamr@2: * EventPaused, EventResumed, EventPausable williamr@2: * @since 3.0 williamr@2: * @param aTransactionID The ID of the transaction, it is unique as long williamr@2: * as the transaction is on-going williamr@2: * @param aDownloadEvent Event to be handled Examples: williamr@2: * EventStarted, EventCompleted, EventProgress, EventCanceled, EventError williamr@2: * EventPaused, EventResumed, EventPausable williamr@2: * @param aValue Value associated with the event. Examples: williamr@2: * Total size of the downloaded file williamr@2: * Size of that was downloaded so far williamr@2: * @return void williamr@2: */ williamr@2: virtual void HandleDownloadEventL(TUint aTransactionID, williamr@2: TBrCtlDownloadEvent aDownloadEvent, williamr@2: TUint aValue) = 0; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // BRCTLDOWNLOADOBSERVER_H williamr@2: williamr@2: // End of File