diff -r 36d60d12b4af -r 819e59dfc032 perfapps/memspyui/ui/avkon/src/MemSpyAsyncTracker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/perfapps/memspyui/ui/avkon/src/MemSpyAsyncTracker.cpp Mon Oct 04 10:09:02 2010 +0300 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 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: +* +*/ +#include + +#include "MemSpyAsyncTracker.h" + +CMemSpyAsyncTracker::CMemSpyAsyncTracker(RMemSpySession& aSession, void (RMemSpySession::*function)(TRequestStatus&)) : + CActive(EPriorityIdle), + iFunction(function), + iSession(aSession) + { + CActiveScheduler::Add(this); + } + +CMemSpyAsyncTracker::~CMemSpyAsyncTracker() + { + delete iWaitNote; + } + +void CMemSpyAsyncTracker::RunL() + { + // If an error occurred handle it in RunError(). + User::LeaveIfError(iStatus.Int()); + + // Operation has finished successfully + iWaitNote->DialogDismissedL(0); + + delete this; + } + +void CMemSpyAsyncTracker::DoCancel() + { + // nothing to do here + } + +TInt CMemSpyAsyncTracker::RunError(TInt aError) + { + return KErrNone; + } + +void CMemSpyAsyncTracker::StartL() + { + (iSession.*iFunction)(iStatus); + + SetActive(); + + iWaitNote = new (ELeave) CMemSpyWaitNote; + + iWaitNote->StartWaitNoteL(); + } + + + + + + + + + + + +CMemSpyWaitNote::~CMemSpyWaitNote() + { + delete iWaitDialog; + } + +void CMemSpyWaitNote::StartWaitNoteL() + { + iWaitDialog = new (ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**, &iWaitDialog)), ETrue); + iWaitDialog->PrepareLC( R_MEMSPY_WAIT_NOTE ); + iWaitDialog->SetCallback(this); + iWaitDialog->RunLD(); + } + +void CMemSpyWaitNote::DialogDismissedL(TInt aButtonId) + { + iWaitDialog->ProcessFinishedL(); + }