videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/inc/IptvTestDownloadManager.h
branchRCL_3
changeset 47 826cea16efd9
parent 45 798ee5f1972c
child 48 13a33d82ad98
equal deleted inserted replaced
45:798ee5f1972c 47:826cea16efd9
     1 /*
       
     2 * Copyright (c) 2008 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IPTVTESTDOWNLOADMANAGER_H
       
    20 #define IPTVTESTDOWNLOADMANAGER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <CommDbConnPref.h>
       
    24 #include <es_sock.h>
       
    25 #include <DownloadMgrClient.h>
       
    26 #include <HttpDownloadMgrCommon.h>
       
    27 #include "MTestUtilDownloadObserver.h"
       
    28 #include "MIptvTestTimerObserver.h"
       
    29 
       
    30 // FORWARD DECLARATIONS;
       
    31 class CIptvTestTimer;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 
       
    36 /**
       
    37 * CTestUtilConnection  Controls the internet connection initiation and shutdown
       
    38 */
       
    39 class CIptvTestDownloadManager : public CBase, MHttpDownloadMgrObserver, public MIptvTestTimerObserver
       
    40     {
       
    41 	public:
       
    42 
       
    43 	    /*
       
    44 	     * NewL()
       
    45 	     */
       
    46 	    IMPORT_C static CIptvTestDownloadManager* NewL(MTestUtilDownloadObserver *aObs);
       
    47 
       
    48 	    /*
       
    49 	     * NewL()
       
    50 	     */
       
    51 	    IMPORT_C static CIptvTestDownloadManager* NewLC(MTestUtilDownloadObserver *aObs);
       
    52 
       
    53 	    /*
       
    54 	     * ~CTestUtilConnection()
       
    55 	     */
       
    56 	    IMPORT_C virtual ~CIptvTestDownloadManager();
       
    57 
       
    58 
       
    59 		IMPORT_C TInt DownloadL( TDesC& aAddress, TDesC16& aOutFile, TDesC& aUserName, TDesC& aPassword, TInt32 aIapId = 0, TInt aTimeoutSeconds = 300);
       
    60 
       
    61 		IMPORT_C void GetError(RHttpDownload& aDownload, TInt32& aDownloadError);
       
    62 
       
    63 	private:
       
    64 
       
    65 	   virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
       
    66 
       
    67 	   virtual void TimerComplete(TInt aTimerId, TInt aError);
       
    68 
       
    69 	   void DeleteDownloadAsync( TInt aError );
       
    70 
       
    71 	private:
       
    72 
       
    73 		void ConstructL();
       
    74 
       
    75 		CIptvTestDownloadManager(MTestUtilDownloadObserver *aObs);
       
    76 
       
    77 	private:
       
    78 		RHttpDownloadMgr iDownloadMgr;
       
    79 		RHttpDownload* iDownload;
       
    80 
       
    81 		MTestUtilDownloadObserver *iObserver;
       
    82 
       
    83 		TBool iDownloadRunning;
       
    84 		CIptvTestTimer* iTimer;
       
    85 
       
    86 		TBool iTimerStartedForDownloadDeletion;
       
    87 		TInt iError;
       
    88 		TBool iDownloadFinishInformed;
       
    89     };
       
    90 
       
    91 
       
    92 #endif // IAPCONNECT_V20ENGINE_H