os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSViewTicker.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSViewTicker.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,99 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// CMVSViewTicker.cpp
    1.18 +// Part of the MVS Application for TechView
    1.19 +//
    1.20 +
    1.21 +
    1.22 +
    1.23 +//
    1.24 +//#include files
    1.25 +//
    1.26 +#include "MVSViewTicker.h"
    1.27 +#include "MVSApp.hrh"
    1.28 +
    1.29 +
    1.30 +
    1.31 +
    1.32 +//
    1.33 +//NewL(...)              *** This method can LEAVE ***
    1.34 +//
    1.35 +// Factory constructor, sets up the ticker for the Set Position dialog
    1.36 +//
    1.37 +CMVSViewTicker* CMVSViewTicker::NewL(CMVSAppUi* aAppUi)
    1.38 +	{
    1.39 +	CMVSViewTicker* self = new(ELeave) CMVSViewTicker(aAppUi);
    1.40 +	CleanupStack::PushL(self);
    1.41 +	self->ConstructL();
    1.42 +	CleanupStack::Pop(self);
    1.43 +	return self;
    1.44 +	}
    1.45 +
    1.46 +
    1.47 +
    1.48 +//
    1.49 +//CMVSViewTicker(...)
    1.50 +//
    1.51 +// Initialises the ticker with an interval and the dialog. This is where the
    1.52 +// ticker interval is set.
    1.53 +//
    1.54 +CMVSViewTicker::CMVSViewTicker(CMVSAppUi* aAppUi)
    1.55 +	{
    1.56 +	iTickInterval = 200000;
    1.57 +    iAppUi = aAppUi;
    1.58 +	}
    1.59 +
    1.60 +
    1.61 +
    1.62 +//
    1.63 +//~CMVSViewTicker()
    1.64 +//
    1.65 +// Destructor
    1.66 +//
    1.67 +CMVSViewTicker::~CMVSViewTicker()
    1.68 +	{
    1.69 +	if (iPeriodic)
    1.70 + 		{
    1.71 + 		iPeriodic->Cancel();
    1.72 + 		}
    1.73 +	delete iPeriodic;
    1.74 +	}
    1.75 +
    1.76 +
    1.77 +
    1.78 +//
    1.79 +//ConstructL()
    1.80 +//
    1.81 +// Second-phase constructor, initialises the periodic member, and starts it
    1.82 +// running.
    1.83 +//
    1.84 +void CMVSViewTicker::ConstructL()
    1.85 +	{
    1.86 +	iPeriodic = CPeriodic::NewL(0);
    1.87 +	iPeriodic->Start(iTickInterval,iTickInterval,TCallBack(Tick, this));
    1.88 +	}
    1.89 +
    1.90 +
    1.91 +
    1.92 +//
    1.93 +//Tick(...)
    1.94 +//
    1.95 +// The callback function, which is called upon a periodic timer event. This
    1.96 +// method calls the UpdatePositionViewL() in the AppUi
    1.97 +//
    1.98 +TInt CMVSViewTicker::Tick(TAny* aObject)
    1.99 +    {
   1.100 +    TRAPD(err,((CMVSViewTicker*)aObject)->iAppUi->UpdatePositionViewL());
   1.101 +    return err;
   1.102 +    }