connectionutilities/ConnectionDialogs/src/ExpiryTimer.cpp
changeset 0 5a93021fdf25
child 1 40cb640ef159
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c) 2009 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 "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:  Implementation of class CExpiryTimer 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "ExpiryTimer.h"
       
    20 
       
    21 static const TInt KTimeout = 60000000;
       
    22 // ---------------------------------------------------------------------------
       
    23 // NewL. Constructs and returns the class object.
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 CExpiryTimer* CExpiryTimer::NewL( MExpiryTimerCallback& aCallback )
       
    27     {
       
    28     CExpiryTimer* self = new (ELeave) CExpiryTimer( aCallback );
       
    29     CleanupStack::PushL(self);
       
    30     self->ConstructL();
       
    31     CleanupStack::Pop(); // self;
       
    32     return self;
       
    33     }
       
    34 
       
    35 CExpiryTimer::CExpiryTimer( MExpiryTimerCallback& aCallback ) 
       
    36  : CTimer(CActive::EPriorityStandard),
       
    37    iCallback( aCallback )
       
    38     {
       
    39     CActiveScheduler::Add(this);
       
    40     }
       
    41 
       
    42 void CExpiryTimer::ConstructL()
       
    43     {
       
    44     CTimer::ConstructL();        
       
    45     }
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // Start. Starts up the timer
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 
       
    52 void CExpiryTimer::Start()
       
    53     {
       
    54     TTimeIntervalMicroSeconds32 timeout = KTimeout;
       
    55     After( timeout );
       
    56     }
       
    57 
       
    58 void CExpiryTimer::RunL()
       
    59     {
       
    60     iCallback.HandleTimedOut();
       
    61     }