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.

S60 v5.1

Inherits from

Constructor & Destructor Documentation

CAppMngr2Runtime(MAppMngr2RuntimeObserver &)

IMPORT_CCAppMngr2Runtime(MAppMngr2RuntimeObserver &aObserver)[protected]

Protected constructor exported for derived classes.


MAppMngr2RuntimeObserver & aObserver



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

Member Functions Documentation

AddNearestResourceFileL(const TDesC &)

IMPORT_C TIntAddNearestResourceFileL(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.


const TDesC & aFileNameResource file name


voidCancelGetInstallationFiles()[pure virtual]

Cancel pending asynchronous GetInstallationFilesL() request.


voidCancelGetInstalledApps()[pure virtual]

Cancel pending asynchronous GetInstalledAppsL() request.




TUid aImplementationUid


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.


const TDesC & aBitmapFileMBM or MIF file name

GetAdditionalDirsToScanL(RFs &, RPointerArray< HBufC > &)

IMPORT_C voidGetAdditionalDirsToScanL(RFs &aFsSession,
RPointerArray< HBufC > &aDirs

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.


RFs & aFsSessionFile server session
RPointerArray< HBufC > & aDirsArray where to append additional directories to scan

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

voidGetInstallationFilesL(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().


RPointerArray< CAppMngr2PackageInfo > & aPackageInfosArray where to append package info objects
const RPointerArray< CAppMngr2RecognizedFile > & aFileListList of file names and corresponding MIME types
RFs & aFsSessionFile server session
TRequestStatus & aStatusRequest status for the asynchronous request

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

voidGetInstalledAppsL(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().


RPointerArray< CAppMngr2AppInfo > & aAppsArray where to add application info objects
RFs & aFsSessionFile server session
TRequestStatus & aStatusRequest status for the asynchronous request

GetSupportedDataTypesL(CDataTypeArray &)

voidGetSupportedDataTypesL(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.


CDataTypeArray & aDataTypeArrayArray where to append supported data types

LoadIconsL(CAknIconArray &)

voidLoadIconsL(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.


CAknIconArray & aIconArrayArray where to append the loaded icons

NewL(TUid, MAppMngr2RuntimeObserver &)

IMPORT_C CAppMngr2Runtime *NewL(TUidaImplementationUid,
MAppMngr2RuntimeObserver &aObserver

ECom object instantiation.

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


TUid aImplementationUid
MAppMngr2RuntimeObserver & aObserverObserver implementing MAppMngr2RuntimeObserver functions


IMPORT_C MAppMngr2RuntimeObserver &Observer()

Runtime observer.

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


IMPORT_C const TUidRuntimeUid()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.