browserui/browser/BrowserAppSrc/BrowserDownloadIndicatorTimer.cpp
changeset 0 84ad3b177aa3
equal deleted inserted replaced
-1:000000000000 0:84ad3b177aa3
       
     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:  Timer for showing initial download animation in Full Screen Pane of the browser.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include <e32base.h>
       
    21 #include <e32std.h>
       
    22 #include "BrowserDownloadIndicatorTimer.h"
       
    23 #include "BrowserDownloadIndicatorTimerEvent.h"
       
    24 
       
    25 
       
    26 // ---------------------------------------------------------------------------------------
       
    27 // Default C++ constructor
       
    28 // ---------------------------------------------------------------------------------------
       
    29 //
       
    30 CBrowserDownloadIndicatorTimer::CBrowserDownloadIndicatorTimer() 
       
    31     : CTimer(EPriorityNormal)
       
    32     {
       
    33     }
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // CBrowserDownloadIndicatorTimer::~CBrowserDownloadIndicatorTimer()
       
    37 // ---------------------------------------------------------------------------
       
    38 CBrowserDownloadIndicatorTimer::~CBrowserDownloadIndicatorTimer()
       
    39     {
       
    40     Cancel();
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CBrowserDownloadIndicatorTimer::ConstructL()
       
    45 // ---------------------------------------------------------------------------
       
    46 void CBrowserDownloadIndicatorTimer::ConstructL( 
       
    47                     MBrowserDownloadIndicatorTimerEvent& aProgressIndicator )
       
    48     {
       
    49     iProgressIndicator = &aProgressIndicator;
       
    50    
       
    51     CTimer::ConstructL();
       
    52     CActiveScheduler::Add( this );
       
    53     }
       
    54 
       
    55 //-----------------------------------------------------------------------------
       
    56 // CBrowserDownloadIndicatorTimer::NewLC()
       
    57 //-----------------------------------------------------------------------------
       
    58 //
       
    59 CBrowserDownloadIndicatorTimer* CBrowserDownloadIndicatorTimer::NewLC(
       
    60                     MBrowserDownloadIndicatorTimerEvent& aProgressIndicator )
       
    61     {
       
    62     CBrowserDownloadIndicatorTimer* self = 
       
    63                                 new (ELeave) CBrowserDownloadIndicatorTimer;
       
    64     CleanupStack::PushL(self);
       
    65     self->ConstructL(aProgressIndicator);
       
    66     return self;
       
    67     }
       
    68 
       
    69 //-----------------------------------------------------------------------------
       
    70 // CBrowserDownloadIndicatorTimer::NewL()
       
    71 //-----------------------------------------------------------------------------
       
    72 //
       
    73 CBrowserDownloadIndicatorTimer* CBrowserDownloadIndicatorTimer::NewL(
       
    74                     MBrowserDownloadIndicatorTimerEvent& aProgressIndicator)
       
    75     {
       
    76     CBrowserDownloadIndicatorTimer* self = 
       
    77                 CBrowserDownloadIndicatorTimer::NewLC( aProgressIndicator );
       
    78     CleanupStack::Pop();
       
    79     return self;
       
    80     }
       
    81 
       
    82 // ----------------------------------------------------------------------------
       
    83 // CBrowserDownloadIndicatorTimer::RunL()
       
    84 // ----------------------------------------------------------------------------
       
    85 void CBrowserDownloadIndicatorTimer::RunL()
       
    86     {
       
    87     if (iStatus == KErrNone)
       
    88        {
       
    89        iProgressIndicator->SetBrowserDownloadIndicatorStateOff();
       
    90        }
       
    91     }
       
    92 
       
    93 
       
    94 // ----------------------------------------------------------------------------
       
    95 // CBrowserDownloadIndicatorTimer::Start()
       
    96 // ----------------------------------------------------------------------------
       
    97 void CBrowserDownloadIndicatorTimer::Start(TTimeIntervalMicroSeconds32 aPeriod)
       
    98     {
       
    99     CTimer::After( aPeriod );
       
   100     }
       
   101 
       
   102 // End of File