browserui/browser/BrowserAppSrc/BrowserContentViewZoomModeTimer.cpp
branchRCL_3
changeset 48 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
47:6385c4c93049 48:8e6fa1719340
       
     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:  Timer for zoom mode.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include <e32base.h>
       
    21 
       
    22 #include "BrowserContentView.h"
       
    23 #include "BrowserContentViewZoomModeTimer.h"
       
    24 
       
    25 // ---------------------------------------------------------------------------------------
       
    26 // Default C++ constructor
       
    27 // ---------------------------------------------------------------------------------------
       
    28 //
       
    29 CBrowserContentViewZoomModeTimer::CBrowserContentViewZoomModeTimer() 
       
    30     : CTimer( EPriorityUserInput )
       
    31     {
       
    32     }
       
    33 
       
    34 // ---------------------------------------------------------------------------
       
    35 // CBrowserContentViewZoomModeTimer::~CBrowserContentViewZoomModeTimer()
       
    36 // ---------------------------------------------------------------------------
       
    37 CBrowserContentViewZoomModeTimer::~CBrowserContentViewZoomModeTimer()
       
    38     {
       
    39     Cancel();
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // CBrowserContentViewZoomModeTimer::ConstructL()
       
    44 // ---------------------------------------------------------------------------
       
    45 void CBrowserContentViewZoomModeTimer::ConstructL( 
       
    46                                     CBrowserContentView* aBrowserContentView )
       
    47     {
       
    48     iBrowserContentView = aBrowserContentView;
       
    49 
       
    50     CTimer::ConstructL();
       
    51     CActiveScheduler::Add( this );
       
    52     }
       
    53 
       
    54 //-----------------------------------------------------------------------------
       
    55 // CBrowserContentViewZoomModeTimer::NewL()
       
    56 //-----------------------------------------------------------------------------
       
    57 //
       
    58 CBrowserContentViewZoomModeTimer* CBrowserContentViewZoomModeTimer::NewL( 
       
    59                                     CBrowserContentView* aBrowserContentView )
       
    60     {
       
    61     CBrowserContentViewZoomModeTimer* self = 
       
    62                 CBrowserContentViewZoomModeTimer::NewLC( aBrowserContentView );
       
    63     CleanupStack::Pop();
       
    64     return self;
       
    65     }
       
    66 
       
    67 //-----------------------------------------------------------------------------
       
    68 // CBrowserContentViewZoomModeTimer::NewLC()
       
    69 //-----------------------------------------------------------------------------
       
    70 //
       
    71 CBrowserContentViewZoomModeTimer* CBrowserContentViewZoomModeTimer::NewLC(
       
    72                                     CBrowserContentView* aBrowserContentView )
       
    73     {
       
    74     CBrowserContentViewZoomModeTimer* self = 
       
    75                                 new (ELeave) CBrowserContentViewZoomModeTimer();
       
    76     CleanupStack::PushL(self);
       
    77     self->ConstructL( aBrowserContentView );
       
    78     return self;
       
    79     }
       
    80 
       
    81 // ----------------------------------------------------------------------------
       
    82 // CBrowserContentViewZoomModeTimer::RunL()
       
    83 // ----------------------------------------------------------------------------
       
    84 void CBrowserContentViewZoomModeTimer::RunL()
       
    85     {
       
    86     if ( iBrowserContentView->isZoomMode() )
       
    87         {
       
    88         // If in zoom mode and timer expires, turn off zoom mode. Zoom indicator
       
    89         // should also be removed.
       
    90         iBrowserContentView->SetZoomModeL( EFalse );
       
    91         }
       
    92     }
       
    93 
       
    94 // ----------------------------------------------------------------------------
       
    95 // CBrowserDownloadIndicatorTimer::Start()
       
    96 // ----------------------------------------------------------------------------
       
    97 void CBrowserContentViewZoomModeTimer::Start( TTimeIntervalMicroSeconds32 aPeriod )
       
    98     {
       
    99     CTimer::After( aPeriod );
       
   100     }
       
   101 
       
   102 // End of File