diff -r 000000000000 -r dd21522fd290 browserutilities/downloadmgr/DownloadMgrClntSrv/inc/DownloadMgrHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browserutilities/downloadmgr/DownloadMgrClntSrv/inc/DownloadMgrHandler.h Mon Mar 30 12:54:55 2009 +0300 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains the definition of the receive handler of Download Mgr Server. +* +*/ + + + +#ifndef __DOWNLOADMGR_RECEIVEHANDLER_H__ +#define __DOWNLOADMGR_RECEIVEHANDLER_H__ + +#include "DownloadMgrClient.h" +#include + +// FORWARD DECLARATIONS +class RHttpDownload; +class RHttpDownloadMgr; +class MHttpDownloadMgrObserver; + +// CLASS DECLARATION + +/** +* Handles the responses of the asyncron services. +* It can be created by a RHttpDownloadMgr session or +* RHttpDownload subsession. +* +* @lib - +* @since Series 60 2.8 +*/ +NONSHARABLE_CLASS( CDownloadMgrHandler ) : public CActive + { + public: + + /** + * C++ default constructor. + */ + CDownloadMgrHandler( MHttpDownloadMgrObserver* aHandler, + RHttpDownload* aSubSession ); + + /** + * C++ default constructor. + */ + CDownloadMgrHandler( RHttpDownloadMgr* aSession ); + + /** + * Destructor. + */ + ~CDownloadMgrHandler(); + + public: + + /** + * Starts handle request completion event. + * @param - + * @return None. + */ + void StartL(); + + /** + * Handler type + * + * @lib - + * @since Series 60 2.8 + */ + enum THandlerType + { + EHttpDownloadMgr, + EHttpDownload + }; + + private: // New functions + + void AdjustPriority( THttpDownloadEvent& aCurrentDlEvent ); + + private: // From CActive + + /** + * Handles an active object’s request completion event. + * @param - + * @return None. + */ + void RunL(); + + /** + * Implements cancellation of an outstanding request. + * @param - + * @return None. + */ + void DoCancel(); + + private: + // Reference the owner + RHttpDownload* iDownloadSubSession; ///< NOT Owned. + RHttpDownloadMgr* iDownloadSession; ///< NOT Owned. + // Points to the observer + MHttpDownloadMgrObserver* iHandler; ///< NOT Owned. + // Possible event parameters. + TPckgBuf iDownloadState; + TPckgBuf iProgressState; + TPckgBuf iHandle; // Contains masked values of 'handle' and 'media index' + // Must be unmasked before use. + HBufC8* iPackedEventAttribs; ///