Update contrib.
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Interface class for using the services of CCallbackTimer
24 #include "callbacktimer.h"
26 // Implementation of class CCallbackTimer
27 EXPORT_C CCallbackTimer* CCallbackTimer::NewL(MTimerObserver& aCallBackIf, TBool aEnableCancelCallback/*= EFalse*/)
29 CCallbackTimer* self = new (ELeave) CCallbackTimer(aCallBackIf, aEnableCancelCallback);
30 CleanupStack::PushL(self);
31 self->ConstructL(); // calls CTimer::ConstructL()
32 CleanupStack::Pop(self);
36 CCallbackTimer::CCallbackTimer(MTimerObserver& aCallBackIf, TBool aEnableCancelCallback)
37 : CTimer(CActive::EPriorityStandard),
38 iCallBackIf(aCallBackIf),
39 iEnableCancelCallback(aEnableCancelCallback)
41 CActiveScheduler::Add(this);
44 void CCallbackTimer::RunL()
47 // Don't inform about cancels if that feature is disabled
48 TInt status = iStatus.Int();
49 if (iEnableCancelCallback || status != KErrCancel)
51 iCallBackIf.TimerRun(status);