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.
Public Member Functions | |
---|---|
~CAppMngr2Runtime() | |
IMPORT_C TInt | AddNearestResourceFileL(const TDesC &) |
void | CancelGetInstallationFiles() |
void | CancelGetInstalledApps() |
IMPORT_C CEikonEnv & | EikonEnv() |
IMPORT_C HBufC * | FullBitmapFileNameLC(const TDesC &) |
IMPORT_C void | GetAdditionalDirsToScanL(RFs &, RPointerArray< HBufC > &) |
void | GetInstallationFilesL(RPointerArray< CAppMngr2PackageInfo > &, const RPointerArray< CAppMngr2RecognizedFile > &, RFs &, TRequestStatus &) |
void | GetInstalledAppsL(RPointerArray< CAppMngr2AppInfo > &, RFs &, TRequestStatus &) |
void | GetSupportedDataTypesL(CDataTypeArray &) |
void | LoadIconsL(CAknIconArray &) |
IMPORT_C CAppMngr2Runtime * | NewL(TUid, MAppMngr2RuntimeObserver &) |
IMPORT_C MAppMngr2RuntimeObserver & | Observer() |
IMPORT_C const TUid | RuntimeUid() |
Protected Member Functions | |
---|---|
CAppMngr2Runtime(MAppMngr2RuntimeObserver &) |
Private Member Functions | |
---|---|
void | ConstructL(TUid) |
Private Attributes | |
---|---|
CEikonEnv * | iCachedEikonEnv |
TUid | iDtorIDKey |
MAppMngr2RuntimeObserver & | iObserver |
TUid | iRuntimeUid |
IMPORT_C | CAppMngr2Runtime | ( | MAppMngr2RuntimeObserver & | aObserver | ) | [protected] |
Protected constructor exported for derived classes.
MAppMngr2RuntimeObserver & aObserver |
IMPORT_C | ~CAppMngr2Runtime | ( | ) |
Destructs the ECom object and unloads the plug-in DLL.
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.
const TDesC & aFileName | Resource file name |
void | CancelGetInstallationFiles | ( | ) | [pure virtual] |
Cancel pending asynchronous GetInstallationFilesL() request.
void | CancelGetInstalledApps | ( | ) | [pure virtual] |
Cancel pending asynchronous GetInstalledAppsL() request.
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 & aBitmapFile | MBM or MIF file name |
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.
RFs & aFsSession | File server session |
RPointerArray< HBufC > & aDirs | Array where to append additional directories to scan |
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().
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 |
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().
RPointerArray< CAppMngr2AppInfo > & aApps | Array where to add application info objects |
RFs & aFsSession | File server session |
TRequestStatus & aStatus | Request status for the asynchronous request |
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.
CDataTypeArray & aDataTypeArray | Array where to append supported data types |
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.
CAknIconArray & aIconArray | Array where to append the loaded icons |
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.
TUid aImplementationUid | |
MAppMngr2RuntimeObserver & aObserver | Observer 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 TUid | RuntimeUid | ( | ) | const |
Runtime plug-in UID.
Returns UID that identifies the runtime plug-in
$return TUid Runtime plug-in UID
CEikonEnv * | iCachedEikonEnv | [private] |
CEikonEnv pointer, cached from CEikonEnv::Static().
MAppMngr2RuntimeObserver & | iObserver | [private] |
Application implementing observer interface.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.