lafagnosticuifoundation/animation/tef/ActiveWait.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code 
       
    19 */
       
    20 
       
    21 
       
    22 #include "ActiveWait.h"
       
    23 
       
    24 CActiveWait* CActiveWait::NewL()
       
    25 	{
       
    26 	CActiveWait* self = new (ELeave) CActiveWait;
       
    27 	CleanupStack::PushL(self);
       
    28 	self->ConstructL();
       
    29 	CleanupStack::Pop(self);
       
    30 	return self;
       
    31 	}
       
    32 	
       
    33 void CActiveWait::ConstructL()
       
    34 	{
       
    35 	User::LeaveIfError(iTimer.CreateLocal());
       
    36 	CActiveScheduler::Add(this);
       
    37 	}
       
    38 	
       
    39 CActiveWait::CActiveWait() : CActive(EPriorityNormal)
       
    40 	{
       
    41 	iFromTime.HomeTime();
       
    42 	}
       
    43 
       
    44 CActiveWait::~CActiveWait()
       
    45 	{
       
    46 	Cancel();
       
    47 	iTimer.Close();
       
    48 	}
       
    49 
       
    50 void CActiveWait::DoCancel()
       
    51 	{
       
    52 	iTimer.Cancel();
       
    53 	CActiveScheduler::Stop();
       
    54 	}
       
    55 
       
    56 void CActiveWait::RunL()
       
    57 	{
       
    58 	CActiveScheduler::Stop();
       
    59 	}
       
    60 	
       
    61 TInt CActiveWait::RunError(TInt aError)
       
    62 	{
       
    63 	return aError; // exists so a break point can be placed on it.
       
    64 	}
       
    65 
       
    66 void CActiveWait::Wait(TInt aDelay)
       
    67 
       
    68 //    Note when using this : because other active objects can perform part of their
       
    69 //    processing whilst we wait, wrapping calls to this in __UHEAP_MARK / __UHEAP_MARKEND
       
    70 //    is likely to fail.  The data providers and animators are a major cause of this. 
       
    71 
       
    72 	{
       
    73 	iTimer.After(iStatus, aDelay);
       
    74 	SetActive();
       
    75 	CActiveScheduler::Start();
       
    76 	}