browserui/browser/BrowserAppSrc/BrowserDownloadUtil.cpp
branchRCL_3
changeset 65 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
64:6385c4c93049 65:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Download handling utilities.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include "BrowserDownloadUtil.h"
       
    22 #include "logger.h"
       
    23 #include "ApiProvider.h"
       
    24 
       
    25 // ================= MEMBER FUNCTIONS =======================
       
    26 
       
    27 // ---------------------------------------------------------
       
    28 // CAsyncDownloadsListExecuter::CAsyncDownloadsListExecuter
       
    29 // ---------------------------------------------------------
       
    30 //
       
    31 CAsyncDownloadsListExecuter::CAsyncDownloadsListExecuter( MApiProvider& aApiProvider )
       
    32 :   CActive( EPriorityStandard ), 
       
    33     iApiProvider( aApiProvider )
       
    34     {
       
    35 LOG_ENTERFN("CAsyncDownloadsListExecuter::CAsyncDownloadsListExecuter");
       
    36     CActiveScheduler::Add( this );
       
    37     }
       
    38 
       
    39 // ---------------------------------------------------------
       
    40 // CAsyncDownloadsListExecuter::~CAsyncDownloadsListExecuter
       
    41 // ---------------------------------------------------------
       
    42 //
       
    43 CAsyncDownloadsListExecuter::~CAsyncDownloadsListExecuter()
       
    44     {
       
    45 LOG_ENTERFN("CAsyncDownloadsListExecuter::~CAsyncDownloadsListExecuter");
       
    46     Cancel();
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------
       
    50 // CAsyncDownloadsListExecuter::Start
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 void CAsyncDownloadsListExecuter::Start()
       
    54     {
       
    55 LOG_ENTERFN("CAsyncDownloadsListExecuter::Start");
       
    56     if ( !IsActive() )
       
    57         {
       
    58         BROWSER_LOG( ( _L( " Already active" ) ) );
       
    59         SetActive();
       
    60         TRequestStatus* s = &iStatus;
       
    61         User::RequestComplete( s, KErrNone );
       
    62         }
       
    63     }
       
    64 
       
    65 // ---------------------------------------------------------
       
    66 // CAsyncDownloadsListExecuter::DoCancel
       
    67 // ---------------------------------------------------------
       
    68 //
       
    69 void CAsyncDownloadsListExecuter::DoCancel()
       
    70 	{
       
    71 LOG_ENTERFN("CAsyncDownloadsListExecuter::DoCancel");
       
    72 	}
       
    73 
       
    74 // ---------------------------------------------------------
       
    75 // CAsyncDownloadsListExecuter::RunL
       
    76 // ---------------------------------------------------------
       
    77 //
       
    78 void CAsyncDownloadsListExecuter::RunL()
       
    79 	{
       
    80 LOG_ENTERFN("CAsyncDownloadsListExecuter::RunL");
       
    81 	// open the downloads list
       
    82     iApiProvider.BrCtlInterface().HandleCommandL( 
       
    83                                   (TInt)TBrCtlDefs::ECommandShowDownloads + 
       
    84                                   (TInt)TBrCtlDefs::ECommandIdBase );
       
    85     // The list of downloads is now closed.
       
    86 	}
       
    87 
       
    88 // ---------------------------------------------------------
       
    89 // CAsyncDownloadsListExecuter::RunError
       
    90 // ---------------------------------------------------------
       
    91 //
       
    92 #ifdef I__BROWSER_LOG_ENABLED
       
    93 TInt CAsyncDownloadsListExecuter::RunError( TInt aError )
       
    94 	{
       
    95 LOG_ENTERFN("CAsyncDownloadsListExecuter::RunError");
       
    96 	BROWSER_LOG( ( _L( " aError: %d" ), aError ) );
       
    97 	return 0;
       
    98 	}
       
    99 #else
       
   100 TInt CAsyncDownloadsListExecuter::RunError( TInt /*aError*/ )
       
   101 	{
       
   102 	return 0;
       
   103 	}
       
   104 #endif
       
   105 
       
   106 // End of File