uifw/AvKon/src/aknprogresstimer.cpp
changeset 0 2f259fa3e83a
child 4 8ca85d2f0db7
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 // AknProgressTimer.cpp: implementation of the CAknProgressTimer class.
       
    19 //
       
    20 //////////////////////////////////////////////////////////////////////
       
    21 
       
    22 #include "aknnotecontrol.h"
       
    23 #include "aknprogresstimer.h"
       
    24 #include <coemain.h>
       
    25 
       
    26 //////////////////////////////////////////////////////////////////////
       
    27 // Construction/Destruction
       
    28 //////////////////////////////////////////////////////////////////////
       
    29 
       
    30 CAknProgressTimer::CAknProgressTimer() : CTimer(EActivePriorityClockTimer)
       
    31   {
       
    32 
       
    33   }
       
    34 
       
    35 
       
    36 CAknProgressTimer::~CAknProgressTimer()
       
    37   {
       
    38   Cancel();
       
    39   }
       
    40 
       
    41 void CAknProgressTimer::AdjustRunningState()
       
    42   {
       
    43   (iModel->iRunning) ? Queue() : Cancel();
       
    44   }
       
    45 
       
    46 void CAknProgressTimer::ConstructL(TTimerModel *aModel,CAknNoteControl *aContainer,TCallBack aCallBack)
       
    47   {
       
    48   iCallBack = aCallBack;
       
    49   CTimer::ConstructL();
       
    50   CActiveScheduler::Add(this);
       
    51   iModel = aModel;
       
    52   iContainer = aContainer;
       
    53   iContainer->SetFinalProgressValue(iModel->iFinalValue);
       
    54   if (iModel->iRunning)
       
    55     Queue();
       
    56   }
       
    57 
       
    58 void CAknProgressTimer::Queue()
       
    59   {
       
    60   After(10000 * iModel->iHundreths);
       
    61   }
       
    62 
       
    63 void CAknProgressTimer::RunL()
       
    64   {
       
    65   if (iContainer->IncrementBarsAndDraw(iModel->iIncrement))
       
    66     Queue();
       
    67   else
       
    68     iCallBack.CallBack();
       
    69   }
       
    70 
       
    71 // End of File