iaupdate/IAD/engine/controller/src/iaupdatetimer.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "iaupdatetimer.h"
       
    21 #include "iaupdatetimerobserver.h"
       
    22 
       
    23 
       
    24 CIAUpdateTimer* CIAUpdateTimer::NewL( 
       
    25     MIAUpdateTimerObserver& aObserver )
       
    26     {
       
    27     CIAUpdateTimer* self(
       
    28         CIAUpdateTimer::NewLC( aObserver ) );
       
    29     CleanupStack::Pop( self );
       
    30     return self;
       
    31     }
       
    32 
       
    33 
       
    34 CIAUpdateTimer* CIAUpdateTimer::NewLC( 
       
    35     MIAUpdateTimerObserver& aObserver )
       
    36     {
       
    37     CIAUpdateTimer* self(
       
    38         new( ELeave ) CIAUpdateTimer( aObserver ) );
       
    39     CleanupStack::PushL( self );
       
    40     self->ConstructL();
       
    41     return self;
       
    42     }
       
    43 
       
    44 
       
    45 CIAUpdateTimer::CIAUpdateTimer( 
       
    46     MIAUpdateTimerObserver& aObserver )
       
    47 : CTimer( CActive::EPriorityStandard ),
       
    48 iObserver( aObserver )
       
    49     {
       
    50     // Active object needs to be added to the scheduler.
       
    51     CActiveScheduler::Add( this );
       
    52     }
       
    53 
       
    54 
       
    55 CIAUpdateTimer::~CIAUpdateTimer()
       
    56     {
       
    57     // No need to call Cancel here because
       
    58     // DoCancel is not implemented in this class 
       
    59     // and the parent destructor calls Cancel itself
       
    60     // which also uses the DoCancel of the parent.
       
    61     }
       
    62 
       
    63 
       
    64 void CIAUpdateTimer::RunL()
       
    65     {
       
    66     // Timer has completed its operation.
       
    67     // Inform observer.
       
    68     iObserver.TimerComplete( iStatus.Int() );
       
    69     }