connectionutilities/ConnectionDialogs/src/ExpiryTimer.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 08:55:21 +0200
changeset 0 5a93021fdf25
child 1 40cb640ef159
permissions -rw-r--r--
Revision: 200949 Kit: 200951

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Implementation of class CExpiryTimer 
*
*/


#include "ExpiryTimer.h"

static const TInt KTimeout = 60000000;
// ---------------------------------------------------------------------------
// NewL. Constructs and returns the class object.
// ---------------------------------------------------------------------------
//
CExpiryTimer* CExpiryTimer::NewL( MExpiryTimerCallback& aCallback )
    {
    CExpiryTimer* self = new (ELeave) CExpiryTimer( aCallback );
    CleanupStack::PushL(self);
    self->ConstructL();
    CleanupStack::Pop(); // self;
    return self;
    }

CExpiryTimer::CExpiryTimer( MExpiryTimerCallback& aCallback ) 
 : CTimer(CActive::EPriorityStandard),
   iCallback( aCallback )
    {
    CActiveScheduler::Add(this);
    }

void CExpiryTimer::ConstructL()
    {
    CTimer::ConstructL();        
    }

// ---------------------------------------------------------------------------
// Start. Starts up the timer
// ---------------------------------------------------------------------------
//

void CExpiryTimer::Start()
    {
    TTimeIntervalMicroSeconds32 timeout = KTimeout;
    After( timeout );
    }

void CExpiryTimer::RunL()
    {
    iCallback.HandleTimedOut();
    }