CAppMngr2Runtime Class Reference

class CAppMngr2Runtime : public CBase

Base class for Application Manager Runtime plug-ins.

CAppMngr2Runtime class represents one Runtime plug-in. As it is abstract class plug-in must provide the actual implementation using derived class.

Application Manager lists ECom plug-ins implementing KAppMngr2PluginInterface and creates new CAppMngr2Runtime objects. Creating new CAppMngr2Runtime object loads the Runtime plug-in's DLL and instantiates it.

After all Runtime plug-ins are loaded, Application Manager calls LoadIconsL() to load plug-in specific icons, GetSupportedDataTypesL() to identify installation files that this plug-in support, and GetAdditionalDirsToScanL() to get plug-in specific directories that may contain installation files. Then Application Manager scans directories and recognizes files in them, and proceeds to get installed applications and installation packages. Installed applications are prompted from each plug-in via GetInstalledAppsL() method. Each plug-in creates CAppMngr2AppInfo derived objects to represent currently installed applications. Installation packages are based on recognized files in scanned directories. Application Manager provides list of files that match the supported data types via GetInstallationFilesL() method, and the plug-in creates CAppMngr2PackageInfo objects representing installation packages.

Application Manager monitors changes in scanned directories and known application registeries. When a change is notified, Application Manager gets the latest data using GetInstalledAppsL() and GetInstallationFilesL() methods again. If Application Manager does not listen some specific registry, plug-in can notify change using MAppMngr2RuntimeObserver interface.

appmngr2pluginapi.lib
Since
S60 v5.1

Inherits from

Constructor & Destructor Documentation

CAppMngr2Runtime(MAppMngr2RuntimeObserver &)

IMPORT_C CAppMngr2Runtime ( MAppMngr2RuntimeObserver & aObserver ) [protected]

Protected constructor exported for derived classes.

Parameters

MAppMngr2RuntimeObserver & aObserver

~CAppMngr2Runtime()

IMPORT_C ~CAppMngr2Runtime ( )

Destructs the ECom object and unloads the plug-in DLL.

Member Functions Documentation

AddNearestResourceFileL(const TDesC &)

IMPORT_C TInt AddNearestResourceFileL ( const TDesC & aFileName )

Utility function to open resource file.

Adds nearest localized resource file to the list maintained by CCoeEnv . Uses DriveInfo::EDefaultRom drive and KDC_RESOURCE_FILES_DIR directory by default, if not defined in aFileName. Nearest extension language code is obtained from BaflUtils::NearestLanguageFile() . Added resource files must be deleted using CCoeEnv::DeleteResourceFile() function.

Parameters

const TDesC & aFileName Resource file name

CancelGetInstallationFiles()

void CancelGetInstallationFiles ( ) [pure virtual]

Cancel pending asynchronous GetInstallationFilesL() request.

CancelGetInstalledApps()

void CancelGetInstalledApps ( ) [pure virtual]

Cancel pending asynchronous GetInstalledAppsL() request.

ConstructL(TUid)

void ConstructL ( TUid aImplementationUid ) [private]

Parameters

TUid aImplementationUid

EikonEnv()

IMPORT_C CEikonEnv & EikonEnv ( )

Utility function to return cached CEikonEnv reference.

FullBitmapFileNameLC(const TDesC &)

IMPORT_C HBufC * FullBitmapFileNameLC ( const TDesC & aBitmapFile )

Utility function to construct full bitmap file name.

Constructs the file name using DriveInfo::EDefaultRom drive, KDC_APP_BITMAP_DIR directory, and given MBM/MIF file name.

The caller of this method is responsible to delete the retuned string.

Parameters

const TDesC & aBitmapFile MBM or MIF file name

GetAdditionalDirsToScanL(RFs &, RPointerArray< HBufC > &)

IMPORT_C void GetAdditionalDirsToScanL ( RFs & aFsSession,
RPointerArray < HBufC > & aDirs
) [virtual]

Define additional directories for installation file scanning.

By default all PathInfo::EInstallsPath directories in all non-remote drives are scanned. Also KSWInstallerPackageFolder directory defined in CenRep is scanned. Use this function to add more directories for scanning. All directory names are checked with RFs::IsValidName() and invalid names are ignored. Wild-cards (like '*') are not allowed in directory names.

Parameters

RFs & aFsSession File server session
RPointerArray < HBufC > & aDirs Array where to append additional directories to scan

GetInstallationFilesL(RPointerArray< CAppMngr2PackageInfo > &, const RPointerArray< CAppMngr2RecognizedFile > &, RFs &, TRequestStatus &)

void GetInstallationFilesL ( RPointerArray < CAppMngr2PackageInfo > & aPackageInfos,
const RPointerArray < CAppMngr2RecognizedFile > & aFileList,
RFs & aFsSession,
TRequestStatus & aStatus
) [pure virtual]

Create package info objects.

Package info objects represent installation files in "Installation Files" view. Each package info object is displayed as a separate item. Package info objects should be based on recognized installation files, provided in aFileList array.

GetInstallationFilesL() may be called several times. It is called once for each scanned directory that contains recognized files for this Runtime plugin.

This asynchronous request must be completed properly using the method User::RequestComplete() even if the GetInstallationFilesL() itself has been implemented in synchronous manner. Outstanding request may be cancelled by calling CancelGetInstallationFiles() .

Parameters

RPointerArray < CAppMngr2PackageInfo > & aPackageInfos Array where to append package info objects
const RPointerArray < CAppMngr2RecognizedFile > & aFileList List of file names and corresponding MIME types
RFs & aFsSession File server session
TRequestStatus & aStatus Request status for the asynchronous request

GetInstalledAppsL(RPointerArray< CAppMngr2AppInfo > &, RFs &, TRequestStatus &)

void GetInstalledAppsL ( RPointerArray < CAppMngr2AppInfo > & aApps,
RFs & aFsSession,
TRequestStatus & aStatus
) [pure virtual]

Create application info objects.

Application info objects represent installed applications in "Installed" view. Each application info object is displayed as a separate item.

This asynchronous request must be completed properly using the method User::RequestComplete() even if the GetInstalledAppsL() itself has been implemented in synchronous manner. Outstanding request may be cancelled by calling CancelGetInstalledApps() .

Parameters

RPointerArray < CAppMngr2AppInfo > & aApps Array where to add application info objects
RFs & aFsSession File server session
TRequestStatus & aStatus Request status for the asynchronous request

GetSupportedDataTypesL(CDataTypeArray &)

void GetSupportedDataTypesL ( CDataTypeArray & aDataTypeArray ) [pure virtual]

Supported data types for this plug-in.

Return MIME types that this Runtime plug-in supports for creating installation packages ( CAppMngr2PackageInfo objects). Application Manager scans installation files and recognizes file types. Files that match to the supported MIME types are provided to the plug-in via GetInstallationFilesL() method.

Scanning and recognizing is implemented in Application Manager for performance reasons. Plug-ins should not scan or recognize files as Application Manager has done it already once and it provides list of files and their MIME types to the plug-ins.

Parameters

CDataTypeArray & aDataTypeArray Array where to append supported data types

LoadIconsL(CAknIconArray &)

void LoadIconsL ( CAknIconArray & aIconArray ) [pure virtual]

Load icons for this plug-in.

Plug-in specific icons are used when CAppMngr2InfoBase::IconIndex() or CAppMngr2InfoBase::IndicatorIconIndex() return indexes to the returned aIconArray.

There are no default icons, so each plug-in must provide implementation for LoadIconsL() method.

Parameters

CAknIconArray & aIconArray Array where to append the loaded icons

NewL(TUid, MAppMngr2RuntimeObserver &)

IMPORT_C CAppMngr2Runtime * NewL ( TUid aImplementationUid,
MAppMngr2RuntimeObserver & aObserver
) [static]

ECom object instantiation.

Loads the ECom plug-in DLL and instantiates new Runtime plug-in object.

Parameters

TUid aImplementationUid
MAppMngr2RuntimeObserver & aObserver Observer implementing MAppMngr2RuntimeObserver functions

Observer()

IMPORT_C MAppMngr2RuntimeObserver & Observer ( )

Runtime observer.

Returns reference to object implementing MAppMngr2RuntimeObserver interface. See appmngr2runtimeobserver.h for more info.

RuntimeUid()

IMPORT_C const TUid RuntimeUid ( ) const

Runtime plug-in UID.

Returns UID that identifies the runtime plug-in

$return TUid Runtime plug-in UID

Member Data Documentation

CEikonEnv * iCachedEikonEnv

CEikonEnv * iCachedEikonEnv [private]

CEikonEnv pointer, cached from CEikonEnv::Static() .

TUid iDtorIDKey

TUid iDtorIDKey [private]

ECom instance identifier key.

MAppMngr2RuntimeObserver & iObserver

MAppMngr2RuntimeObserver & iObserver [private]

Application implementing observer interface.

TUid iRuntimeUid

TUid iRuntimeUid [private]

Implementation UID that identifies the plugin.