uifw/AvKon/src/aknprogresstimer.cpp
author William Roberts <williamr@symbian.org>
Wed, 10 Nov 2010 12:08:34 +0000
branchRCL_3
changeset 76 5c9f0ba5102a
parent 56 d48ab3b357f1
permissions -rw-r--r--
Improve debug tracing of AknGlobalNote::StartL - Bug 2673

/*
* 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