installationservices/swi/test/tasynccancel/installer.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 12:50:16 +0300
branchRCL_3
changeset 36 f9033e605ee2
parent 0 ba25891c3a9e
permissions -rw-r--r--
Revision: 201019 Kit: 2010121

/*
* 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 the License "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: 
*
*/


/**
 @test
 @internalComponent
*/


#ifndef INSTALLER_H
#define INSTALLER_H

#include "common.h"
#include "asyncc-tui.h"


/**
 * This class defines the object that is used to start and cancel
 * the installation process
 */
class CInstaller : public CActive
	{

	public:
	
		CInstaller();
		static CInstaller* NewLC(CInstallPrefs* aPrefs=NULL);
		static CInstaller* NewL(CInstallPrefs* aPrefs=NULL);
		~CInstaller();

		/**
 		 * Sets up the installation (but without starting the Active Scheduler)
 		 * @param aSisToInstall		Full path to sis file to be installed
 		 */
		void StartL(const TDesC& aSisToInstall);
		void CancelInstallation();
		
		TInt CancelationSuccess()
			{
			return iCancelationSuccess;
			}
			
		TInt FinishedInstallation()
			{
			return iFinishedInstallation;
			}

		TInt FinishedCanceling()
			{
			return iFinishedCanceling;
			}
		
		TInt Status()
			{
			return iEndStatus;
			}
		
	private:
	
		// Executed when cancelation finishes
		void RunL();
		void DoCancel();
		void ConstructL(CInstallPrefs* aPrefs=NULL);
		
		CAsyncLauncher* iLauncher;
		CInstallPrefs* iPrefs;
		CUIScriptAdaptor* iUiHandler;

		TInt iCancelationSuccess;
		TInt iFinishedInstallation;
		TInt iFinishedCanceling;
		
		TInt iDeletePrefs;
		
		TInt iEndStatus;
	};

#endif
// End of file