author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 2 |
// All rights reserved. |
sl@0 | 3 |
// This component and the accompanying materials are made available |
sl@0 | 4 |
// under the terms of "Eclipse Public License v1.0" |
sl@0 | 5 |
// which accompanies this distribution, and is available |
sl@0 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 7 |
// |
sl@0 | 8 |
// Initial Contributors: |
sl@0 | 9 |
// Nokia Corporation - initial contribution. |
sl@0 | 10 |
// |
sl@0 | 11 |
// Contributors: |
sl@0 | 12 |
// |
sl@0 | 13 |
// Description: |
sl@0 | 14 |
// CMVSViewTicker.cpp |
sl@0 | 15 |
// Part of the MVS Application for TechView |
sl@0 | 16 |
// |
sl@0 | 17 |
|
sl@0 | 18 |
|
sl@0 | 19 |
|
sl@0 | 20 |
// |
sl@0 | 21 |
//#include files |
sl@0 | 22 |
// |
sl@0 | 23 |
#include "MVSViewTicker.h" |
sl@0 | 24 |
#include "MVSApp.hrh" |
sl@0 | 25 |
|
sl@0 | 26 |
|
sl@0 | 27 |
|
sl@0 | 28 |
|
sl@0 | 29 |
// |
sl@0 | 30 |
//NewL(...) *** This method can LEAVE *** |
sl@0 | 31 |
// |
sl@0 | 32 |
// Factory constructor, sets up the ticker for the Set Position dialog |
sl@0 | 33 |
// |
sl@0 | 34 |
CMVSViewTicker* CMVSViewTicker::NewL(CMVSAppUi* aAppUi) |
sl@0 | 35 |
{ |
sl@0 | 36 |
CMVSViewTicker* self = new(ELeave) CMVSViewTicker(aAppUi); |
sl@0 | 37 |
CleanupStack::PushL(self); |
sl@0 | 38 |
self->ConstructL(); |
sl@0 | 39 |
CleanupStack::Pop(self); |
sl@0 | 40 |
return self; |
sl@0 | 41 |
} |
sl@0 | 42 |
|
sl@0 | 43 |
|
sl@0 | 44 |
|
sl@0 | 45 |
// |
sl@0 | 46 |
//CMVSViewTicker(...) |
sl@0 | 47 |
// |
sl@0 | 48 |
// Initialises the ticker with an interval and the dialog. This is where the |
sl@0 | 49 |
// ticker interval is set. |
sl@0 | 50 |
// |
sl@0 | 51 |
CMVSViewTicker::CMVSViewTicker(CMVSAppUi* aAppUi) |
sl@0 | 52 |
{ |
sl@0 | 53 |
iTickInterval = 200000; |
sl@0 | 54 |
iAppUi = aAppUi; |
sl@0 | 55 |
} |
sl@0 | 56 |
|
sl@0 | 57 |
|
sl@0 | 58 |
|
sl@0 | 59 |
// |
sl@0 | 60 |
//~CMVSViewTicker() |
sl@0 | 61 |
// |
sl@0 | 62 |
// Destructor |
sl@0 | 63 |
// |
sl@0 | 64 |
CMVSViewTicker::~CMVSViewTicker() |
sl@0 | 65 |
{ |
sl@0 | 66 |
if (iPeriodic) |
sl@0 | 67 |
{ |
sl@0 | 68 |
iPeriodic->Cancel(); |
sl@0 | 69 |
} |
sl@0 | 70 |
delete iPeriodic; |
sl@0 | 71 |
} |
sl@0 | 72 |
|
sl@0 | 73 |
|
sl@0 | 74 |
|
sl@0 | 75 |
// |
sl@0 | 76 |
//ConstructL() |
sl@0 | 77 |
// |
sl@0 | 78 |
// Second-phase constructor, initialises the periodic member, and starts it |
sl@0 | 79 |
// running. |
sl@0 | 80 |
// |
sl@0 | 81 |
void CMVSViewTicker::ConstructL() |
sl@0 | 82 |
{ |
sl@0 | 83 |
iPeriodic = CPeriodic::NewL(0); |
sl@0 | 84 |
iPeriodic->Start(iTickInterval,iTickInterval,TCallBack(Tick, this)); |
sl@0 | 85 |
} |
sl@0 | 86 |
|
sl@0 | 87 |
|
sl@0 | 88 |
|
sl@0 | 89 |
// |
sl@0 | 90 |
//Tick(...) |
sl@0 | 91 |
// |
sl@0 | 92 |
// The callback function, which is called upon a periodic timer event. This |
sl@0 | 93 |
// method calls the UpdatePositionViewL() in the AppUi |
sl@0 | 94 |
// |
sl@0 | 95 |
TInt CMVSViewTicker::Tick(TAny* aObject) |
sl@0 | 96 |
{ |
sl@0 | 97 |
TRAPD(err,((CMVSViewTicker*)aObject)->iAppUi->UpdatePositionViewL()); |
sl@0 | 98 |
return err; |
sl@0 | 99 |
} |