williamr@2: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Interface class for listing/removing uninstalled packages from a removable drive williamr@2: // williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: #ifndef __PKGREMOVER_H__ williamr@2: #define __PKGREMOVER_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: namespace Swi williamr@2: { williamr@2: williamr@2: class CUninstalledPackageEntry; williamr@2: williamr@2: williamr@2: /** williamr@2: * This class provides static methods for managing uninstalled native packages williamr@2: * (SIS files) that are taking up space on removable drives. williamr@2: * williamr@2: * @publishedAll williamr@2: * @released williamr@2: */ williamr@2: williamr@2: NONSHARABLE_CLASS(UninstalledSisPackages) williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Get the list of uninstalled packages on a specified removable drive. In williamr@2: * this context uninstalled means 'not known by this phone'. This will list williamr@2: * uninstalled PA & PP files found in the SWI Daemon's private directory, and williamr@2: * will also search the sis registry files on the drive for uninstalled williamr@2: * applications. williamr@2: * williamr@2: * @param aDrive Removable drive number (@see TDriveNumber) williamr@2: * @param aPackageList Array of pointers to the uninstalled packages williamr@2: * found on the specified drive (@see williamr@2: * CUninstalledPackageEntry). This array is assumed to be empty. williamr@2: * The caller takes ownership of the elements added to the array. williamr@2: * @leave One of the system-wide error codes. williamr@2: * @leave KErrNotRemovable If the drive is not removable or is substed williamr@2: * @leave KErrPackageFileCorrupt If an error occurs during the processing of files williamr@2: * @capability ReadDeviceData Required to access protected directories during listing operation williamr@2: * @capability ProtServ Required to access services of software installer williamr@2: * @capability TrustedUI Required to access services of software installer williamr@2: */ williamr@2: IMPORT_C static void ListL(TDriveNumber aDrive, RPointerArray& aPackageList); williamr@2: williamr@2: /** williamr@2: * Remove the specified uninstalled package. The following restrictions apply to the files that will be removed: williamr@2: *
    williamr@2: *
  • For security reasons only files on the same drive as the package controller will be removed. Files on other drives will be orphaned. williamr@2: *
  • Files belonging to other packages will not be removed. williamr@2: *
williamr@2: * williamr@2: * @param aPackage The uninstalled package to remove (@see CUninstalledPackageEntry) williamr@2: * @leave One of the system-wide error codes. williamr@2: * @leave KErrNotRemovable If the drive is not removable or is substed williamr@2: * @leave KErrPackageIsInstalled If the specified package is installed on the device williamr@2: * @leave KErrPackageFileCorrupt If an error occurs during the processing of files williamr@2: * @capability WriteDeviceData Required to write to protected directories during remove operation williamr@2: * @capability ProtServ Required to access services of software installer williamr@2: * @capability TrustedUI Required to access services of software installer williamr@2: */ williamr@2: IMPORT_C static void RemoveL(const CUninstalledPackageEntry& aPackage); williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * Uninstalled application entry class. williamr@2: * williamr@2: * This class is not externally instantiable. It is returned as a result of williamr@2: * querying for a list of uninstalled packages present on a removable drive. williamr@2: * Each object of this type represents one uninstalled package. Methods can williamr@2: * be called on this object to retrieve the package details such as williamr@2: * Package UID, Name, Vendor, Version and Type. williamr@2: * williamr@2: * @publishedAll williamr@2: * @released williamr@2: */ williamr@2: williamr@2: NONSHARABLE_CLASS(CUninstalledPackageEntry) : public CBase williamr@2: { williamr@2: public: williamr@2: enum TPackageType williamr@2: { williamr@2: ESaPackage, ///< Standard Application williamr@2: ESpPackage, ///< Standard Patch (augmentation) williamr@2: EPuPackage, ///< Partial Upgrade williamr@2: EPaPackage, ///< Preinstalled Application williamr@2: EPpPackage ///< Preinstalled Patch williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Get the package Uid williamr@2: * williamr@2: * @return The Uid of this package williamr@2: */ williamr@2: IMPORT_C const TUid& Uid() const; williamr@2: williamr@2: /** williamr@2: * Get the package name williamr@2: * williamr@2: * @return The name of this package as reference to TDesC williamr@2: */ williamr@2: IMPORT_C const TDesC& Name() const; williamr@2: williamr@2: /** williamr@2: * Get the package unique vendor name williamr@2: * williamr@2: * @return The unique vendor name of this package as reference to TDesC williamr@2: */ williamr@2: IMPORT_C const TDesC& Vendor() const; williamr@2: williamr@2: /** williamr@2: * Get the package version williamr@2: * williamr@2: * @return The version number of this package williamr@2: */ williamr@2: IMPORT_C const TVersion& Version() const; williamr@2: williamr@2: /** williamr@2: * Get the package type williamr@2: * williamr@2: * @return The package type of this package williamr@2: */ williamr@2: IMPORT_C const TPackageType& PackageType() const; williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: virtual ~CUninstalledPackageEntry(); williamr@2: williamr@2: private: williamr@2: static CUninstalledPackageEntry* NewLC(const TUid& aUid, const TDesC& aPackageName, williamr@2: const TDesC& aVendorName, const TVersion& aVersion, const TPackageType aPackageType, williamr@2: const TDesC& aPackageFile, const TDesC& aAssocStubSisFile); williamr@2: williamr@2: private: williamr@2: CUninstalledPackageEntry(); williamr@2: williamr@2: private: williamr@2: void ConstructL(const TUid& aUid, const TDesC& aPackageName, const TDesC& aVendorName, williamr@2: const TVersion& aVersion, const TPackageType aPackageType, const TDesC& aPackageFile, williamr@2: const TDesC& aAssocStubSisFile); williamr@2: williamr@2: const TDesC& PackageFile() const; williamr@2: const TDesC& AssociatedStubSisFile() const; williamr@2: williamr@2: private: williamr@2: /// The package Uid williamr@2: TUid iUid; williamr@2: williamr@2: /// The package name williamr@2: HBufC* iPackageName; williamr@2: williamr@2: /// The package unique vendor name williamr@2: HBufC* iVendorName; williamr@2: williamr@2: /// The package version williamr@2: TVersion iVersion; williamr@2: williamr@2: /// The package type williamr@2: TPackageType iType; williamr@2: williamr@2: // The sis/controller file name with full path williamr@2: HBufC* iPackageFile; williamr@2: williamr@2: // The stub sis file name with full path (if the package file is a controller file) williamr@2: HBufC* iAssocStubSisFile; williamr@2: private: williamr@2: friend class UninstalledSisPackages; williamr@2: }; williamr@2: williamr@2: } // namespace Swi williamr@2: williamr@2: #endif // __PKGREMOVER_H__