localconnectivityservice/lcstylustap/src/forcedismounttimer.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:20:40 +0100
branchRCL_3
changeset 40 52a167391590
parent 0 c3e98f10fcf4
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2006 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:  LC stylustap force unmount timeouttimer
*/

#include "debug.h"
#include "forcedismounttimer.h"


const TInt KForceDismountTimeOut   = 6000000; // 6 seconds

// ======== MEMBER FUNCTIONS ========
// ---------------------------------------------------------------------------
// NewL
// ---------------------------------------------------------------------------
//
CForceDismountTimer* CForceDismountTimer::NewL( MTimerNotifier* aTimeOutNotify)
    {
    TRACE_FUNC    
    CForceDismountTimer* self = CForceDismountTimer::NewLC( aTimeOutNotify );
    CleanupStack::Pop(self);
    return self;
    }

// ---------------------------------------------------------------------------
// NewLC
// ---------------------------------------------------------------------------
//    
CForceDismountTimer* CForceDismountTimer::NewLC( MTimerNotifier* aTimeOutNotify )
    {
    TRACE_FUNC    
    CForceDismountTimer* self = new (ELeave) CForceDismountTimer( aTimeOutNotify );
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

// ---------------------------------------------------------------------------
// CTimeOutTimer()
// ---------------------------------------------------------------------------
//
CForceDismountTimer::CForceDismountTimer( MTimerNotifier* aTimeOutNotify):
    CTimer(EPriorityStandard), 
    iNotify(aTimeOutNotify)    
    {
    TRACE_FUNC    
    }    

// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CForceDismountTimer::~CForceDismountTimer()
    {
    TRACE_FUNC    
    Cancel();
    }

// ---------------------------------------------------------------------------
// ConstructL()
// ---------------------------------------------------------------------------
//
void CForceDismountTimer::ConstructL()
    {
    TRACE_FUNC    
    if ( !iNotify )    
        {
        User::Leave(KErrArgument);    
        }
    CTimer::ConstructL();
    CActiveScheduler::Add(this);
    After( KForceDismountTimeOut );
    }

// ---------------------------------------------------------------------------
// From class CActive
// RunL()
// ---------------------------------------------------------------------------
//
void CForceDismountTimer::RunL()
    {
    TRACE_FUNC    
    // Timer request has completed, so notify the timer's owner
    iNotify->TimerExpired();
    }