uifw/AvKon/src/aknprogresstimer.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 23:04:46 +0200
branchRCL_3
changeset 4 8ca85d2f0db7
parent 0 2f259fa3e83a
child 55 aecbbf00d063
permissions -rw-r--r--
Revision: 201003 Kit: 201007

/*
* Copyright (c) 2002 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: 
*
*/

// AknProgressTimer.cpp: implementation of the CAknProgressTimer class.
//
//////////////////////////////////////////////////////////////////////
#include <coemain.h>
#include "aknnotecontrol.h"
#include "aknprogresstimer.h"
#include "akntrace.h"


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CAknProgressTimer::CAknProgressTimer() : CTimer(EActivePriorityClockTimer)
  {

  }


CAknProgressTimer::~CAknProgressTimer()
  {
  Cancel();
  }

void CAknProgressTimer::AdjustRunningState()
  {
  (iModel->iRunning) ? Queue() : Cancel();
  }

void CAknProgressTimer::ConstructL(TTimerModel *aModel,CAknNoteControl *aContainer,TCallBack aCallBack)
  {
  _AKNTRACE_FUNC_ENTER;
  iCallBack = aCallBack;
  CTimer::ConstructL();
  CActiveScheduler::Add(this);
  iModel = aModel;
  iContainer = aContainer;
  iContainer->SetFinalProgressValue(iModel->iFinalValue);
  if (iModel->iRunning)
    Queue();
  _AKNTRACE_FUNC_EXIT;
  }

void CAknProgressTimer::Queue()
  {
  After(10000 * iModel->iHundreths);
  }

void CAknProgressTimer::RunL()
  {
  _AKNTRACE_FUNC_ENTER;
  if (iContainer->IncrementBarsAndDraw(iModel->iIncrement))
    Queue();
  else
    iCallBack.CallBack();
  _AKNTRACE_FUNC_EXIT;
  }

// End of File