browserutilities/downloadmgr/DownloadMgrClntSrv/src/DownloadMgrClientApiExt.cpp
changeset 0 dd21522fd290
child 36 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2006 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:  API extensions for RHttpDownloadMgr
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "DownloadMgrClientApiExt.h"
       
    20 #include "DownloadMgrLogger.h"
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 // ---------------------------------------------------------
       
    25 // RHttpDownloadMgrApiExt::AttachToDownloadL
       
    26 // ---------------------------------------------------------
       
    27 //
       
    28 EXPORT_C RHttpDownload& RHttpDownloadMgrApiExt::AttachToDownloadL( const TInt32 aDlId )
       
    29     {
       
    30     CLOG_ENTERFN( "RHttpDownloadMgr::CreateDownloadL" )
       
    31     
       
    32     if( 0 >= aDlId )
       
    33         {
       
    34         User::Leave( KErrBadHandle );
       
    35         }
       
    36 
       
    37     RHttpDownload* download = new (ELeave) RHttpDownload ( (RHttpDownloadMgr*)this );
       
    38     CleanupStack::PushL( download );
       
    39     CleanupClosePushL( *download );
       
    40 
       
    41     download->AttachToDownloadL( aDlId );
       
    42     
       
    43     RHttpDownload& item = AddToArrayL( download );
       
    44 
       
    45     CleanupStack::Pop( 2 );  // download->Close, download
       
    46    
       
    47     return item;    
       
    48     }
       
    49 
       
    50 EXPORT_C RHttpDownloadMgrApiExt::RHttpDownloadMgrApiExt()
       
    51 	{
       
    52     // nothing to do
       
    53 	}