/*
* Copyright (c) 2010 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: ?Description
*
*/
#ifndef T_CA_INSTALLER_H
#define T_CA_INSTALLER_H
#include <e32base.h>
#include <f32file.h>
#include <usif/sif/sif.h>
#include <usif/scr/scr.h>
/**
* Installer
*
*/
NONSHARABLE_CLASS(T_Installer): public CActive {
public:
/**
* Destructor
*/
virtual ~T_Installer();
/**
* Two-phased constructor. Leaves on failure.
* Allocates memory for and constructs an uninstaller object. After that
* starts asynchronous uninnstallation of the requested entry
* @param aFileName name of the file to be installed
* @param aPriority priority of the active scheduler responsible for handling
* asynchronous installation operation
* @return The constructed object.
*/
static T_Installer *NewL( TInt aPriority = CActive::EPriorityStandard );
/**
* Starts asynchronous installation operation
* @param aFileName name of the file to be installed
* @param aComponentId placeholder for component id of the package after
* instalation is completed.
*/
void InstallL(const TDesC& aFileName);
/**
* Uninstall operation
* @param aComponentId id of the component to be installed.
*/
void UninstallL( Usif::TComponentId aComponentId );
/**
* Uninstall operation for package(s) based on filename
* for native and HS widgets.
* @param aFileName the file name installed with the package(s)
*/
void UninstallL( const TDesC& aFileName );
/**
* Uninstall operation for java applications
* @param aUid ui
*/
void UninstallL(TUint32 aUid);
/**
* Find component id for a file name
* @param aFileName the file name installed with the package(s)
* @return componentId for a requested file name
*/
Usif::TComponentId GetComponentIdL( const TDesC& aFileName );
/**
* Find component id for a uid
* @param aUid ui
* @return componentId for a requested uid
*/
Usif::TComponentId GetComponentIdL( TInt32 aUid );
private:
// construction
/**
* Constructor.
* Starts active scheduler.
* @param aPriority priority of the active scheduler responsible for handling
* asynchronous installation operation
*/
T_Installer(TInt aPriority);
/**
* Initializes the object and starts asynchronous uninstallation process.
*/
void ConstructL();
private:
// from CActive
void RunL();
void DoCancel();
TInt RunError( TInt aError );
private:
Usif::COpaqueNamedParams* iArguments;
Usif::COpaqueNamedParams* iResults;
// RFs iFs;
Usif::RSoftwareInstall iInstaller;
Usif::RSoftwareComponentRegistry iSoftwareRegistry;
CActiveSchedulerWait iSchedulerWait;
};
#endif // T_CA_INSTALLER_H