CAppMngr2InfoBase Class Reference

class CAppMngr2InfoBase : public CBase
CAppMngr2InfoBase is the base class for objects representing:
  • installed applications and

  • installation packages (aka installation files).

Installed applications and installation packages are displayed in the Appliction Manager UI using the data that Runtime plug-ins provide with CAppMngr2InfoBase derived objects. Application Manager gets the data via GetInstalledAppsL() and GetInstallationFilesL() metods in CAppMngr2Runtime class.

CAppMngr2InfoBase contains the common functionality for both installed applications and installation packages. Derived classes CAppMngr2AppInfo and CAppMngr2PackageInfo are placeholders for more specific functionality.

CAppMngr2InfoBase, as well as CAppMngr2AppInfo and CAppMngr2PackageInfo, are abstracts classes. Runtime plug-ins must provide the actual implementation by using derived classes.

appmngr2pluginapi.lib
Since
S60 v5.1

Inherits from

Constructor & Destructor Documentation

CAppMngr2InfoBase(CAppMngr2Runtime &, RFs &)

CAppMngr2InfoBase(CAppMngr2Runtime &aRuntime,
RFs &aFsSession
)[protected]

Constructor, not exported because used via CAppMngr2AppInfo and CAppMngr2PackageInfo

Parameters

CAppMngr2Runtime & aRuntime
RFs & aFsSession

~CAppMngr2InfoBase()

~CAppMngr2InfoBase()

Member Functions Documentation

CancelCommand()

voidCancelCommand()[pure virtual]

Cancels the current asynchronous command.

This method may be called at any time when an asynchronous command is started using HandleCommandL() method. It must cancel the running command as quickly as possible.

ConstructL()

voidConstructL()

Details()

const TDesC &Details()const [pure virtual]

Details (size) of this item.

Items are displayed in a list in the UI. The list uses two labels (name and details) for each item. Descriptor that the Details() method returns is displayed as the second label (the 2nd line of the item).

Plug-ins can use SizeStringWithUnitsL() method to create details string to display the item size in UI.

GetMenuItemsL(RPointerArray< CEikMenuPaneItem::SData > &)

IMPORT_C voidGetMenuItemsL(RPointerArray< CEikMenuPaneItem::SData > &aMenuCmds)[virtual]

Optional specific menu items for this item.

If the item supports specific menu commands, return the menu pane data. Plug-in can use ReadMenuItemDataFromResourceL() method to read menu pane data from resources. Menu commands are run via HandleCommandL() method.

The caller of this method is responsible to delete the returned CEikMenuPaneItem::SData data structs.

Default implementation is empty.

Parameters

RPointerArray< CEikMenuPaneItem::SData > & aMenuCmdsArray where plug-in specific menu items are added

GetMiddleSoftkeyCommandL(TInt &, TInt &)

IMPORT_C voidGetMiddleSoftkeyCommandL(TInt &aResourceId,
TInt &aCommandId
)[virtual]

Optional specific middle softkey command for this item.

If the item supports specific middle softkey command, return TBUF resource id (for the command label) and command id. Item specific command is run via HandleCommandL() method when user presses the middle softkey.

Default middle softkey command is used, if plug-in does not override it.

Parameters

TInt & aResourceIdCommand label to be displayed in UI (TBUF resource)
TInt & aCommandIdCommand id to be passed to HandleCommandL

HandleCommandL(TInt, TRequestStatus &)

voidHandleCommandL(TIntaCommandId,
TRequestStatus &aStatus
)[pure virtual]

Starts asynchronously a user invoked command.

The command can be a generic one or specific to the plug-in. The ids for the generic commands are defined in AppMngr2Common.hrh (see the enumeration TAppMngr2GenericCommand). The plug-in specific commands are defined via GetMenuItemsL() and GetMiddleSoftkeyCommandL() methods.

The caller of this method must call HandleCommandResultL() after the asynchronous request has been completed.

This asynchronous request must be completed properly using the method User::RequestComplete() even if the command itself has been implemented in synchronous manner.

Parameters

TInt aCommandIdId of the command to be run
TRequestStatus & aStatusActive object request status

HandleCommandResultL(TInt)

voidHandleCommandResultL(TIntaResult)[pure virtual]

Handles the completion result of an asynchronous command.

This method is provided so that the plug-in may decide upon handling possible errors encountered during the command processing (note that the completion status is received directly by the caller of the method HandleCommandL() and not by this plug-in). These actions may include for example closing open sessions and deleting objects.

This function should leave if an error note should be displayed in the UI (e.g. KErrNoMemory). Note that the result may be KErrCancel or SwiUI::KSWInstErrUserCancel if the user cancelled the operation.

Parameters

TInt aResultCompletion code, KErrNone or some error code

IconIndex()

TInt IconIndex()const [pure virtual]

Icon index of this item (installed application or installation package).

Items are displayed in a list in the UI. Each item has an icon image, two labels (name and details) and an optional small indicator icon. IconIndex() method provides index for the icon image.

Icon index can be either:

If item has a specific icon that no other items use, return value EAppMngr2UseSpecificIcon and load the specific icon via SpecificIconL().

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

IndicatorIconIndex()

IMPORT_C TIntIndicatorIconIndex()const [virtual]

Indicator icon index of this item.

Icon index can be either:
  • default icon index defined in TAppMngr2IconIndex in AppMngr2Common.hrh

  • index to icon array loaded in CAppMngr2Runtime::LoadIconsL() method

  • special value EAppMngr2UseSpecificIcon defined in AppMngr2Common.hrh

Default implementation returns the default icon indexes based on the value of iLocation member variable, so plug-ins usually does not need to override this method.

If EAppMngr2UseSpecificIcon value is returned, SpecificIndicatorIconL() method is called to get the indicator icon.

IsShowOnTop()

IMPORT_C TBoolIsShowOnTop()const

ShowOnTop highlight status of this item.

Returns ETrue if this item should be highlighted (e.g. displayed separately on top of other items in installation files/installed applications list). All items are displayed in alphabetical order. If ShowOnTop flag is set, then the item is displayed before other items (or in completely separate list of highligted items). All separately displayed items are listed in alphabetical order too.

Location()

IMPORT_C TAppMngr2LocationLocation()const

Returns the location of installation file or installed application.

Remote drives are not supported. Derived class must fill in the iLocation member variable to provide data for this function.

LocationDrive()

IMPORT_C TDriveUnitLocationDrive()const

Returns the drive where installation file is located, or where installed application is installed.

Derived class must fill in the iLocationDrive member variable to provide data for this function.

Name()

const TDesC &Name()const [pure virtual]

Name of this item.

Items are displayed in a list in the UI. The list uses two labels (name and details) for each item. Descriptor that the Name() method returns is displayed as the first label (the 1st line of the item).

ReadMenuItemDataFromResourceL(TInt, CEikMenuPaneItem::SData &)

IMPORT_C voidReadMenuItemDataFromResourceL(TIntaResourceId,
CEikMenuPaneItem::SData &aMenuItem
)

Utility function to construct CEikMenuPaneItem from MENU_ITEM resource.

Parameters

TInt aResourceIdMENU_ITEM resource id
CEikMenuPaneItem::SData & aMenuItemCEikMenuPaneItem::SData struct that is filled in

Runtime()

IMPORT_C CAppMngr2Runtime &Runtime()const

Reference to the CAppMngr2Runtime object of this plugin.

SizeStringWithUnitsL(TInt64)

IMPORT_C HBufC *SizeStringWithUnitsL(TInt64aSizeInBytes)

Utility function to create displayable string that contains size followed by kilobyte (kB), megabyte (MB) or gigabyte (GB) units.

Size is rounded and formatted using the relevant unit, for example SizeStringWithUnitsL( 5120 ) returns "5 kB".

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

Parameters

TInt64 aSizeInBytesItem size

SpecificIconL()

IMPORT_C CGulIcon *SpecificIconL()const [virtual]

Optional specific icon for this item.

Returns new icon specific for the item. Note that this method is not used unless IconIndex() method returns EAppMngr2UseSpecificIcon value.

The caller of this method is responsible to delete the returned icon object.

Default implementation leaves with KErrNotSupported. Plug-in must override it if IconIndex() returns EAppMngr2UseSpecificIcon value.

If the same icon bitmap is used in many items, it is more efficient to load it once in CAppMngr2Runtime::LoadIconsL() and return icon indexes form IconIndex() method.

SpecificIndicatorIconL()

IMPORT_C CGulIcon *SpecificIndicatorIconL()const [virtual]

Optional specific indicator icon for this item.

Returns new indicator icon specific for the item. Note that this method is not used unless IndicatorIconIndex() method returns special EAppMngr2UseSpecificIcon value.

The caller of this method is responsible to delete the returned icon object.

Default implementation leaves with KErrNotSupported. Plug-in must override it if IndicatorIconIndex() returns EAppMngr2UseSpecificIcon.

If the same icon bitmap is used in many items, it is more efficient to load it once in CAppMngr2Runtime::LoadIconsL() and return icon indexes form IconIndex() method.

SupportsGenericCommand(TInt)

IMPORT_C TBoolSupportsGenericCommand(TIntaCmdId)[virtual]

Enable generic menu commands for this item.

Generic menu commands are defined in TAppMngr2GenericCommands enum in AppMngr2Common.hrh. Generic commands are hidden from the menu if the currently selected item does not support them. Return ETrue for those command ids that are supported by this item. Generic commands are run via HandleCommandL() method.

Parameters

TInt aCmdIdGeneric command id

Member Data Documentation

RFs & iFs

RFs &iFs[protected]

File server session, provided by framework when item is created.

TAppMngr2Location iLocation

TAppMngr2Location iLocation[protected]

Location of this item.

Default implementation of IndicatorIconIndex() function uses this value to return the default indicator icon index. See also the Location() function defined above.

TDriveUnit iLocationDrive

TDriveUnit iLocationDrive[protected]

Drive of this item.

Location drive defines the drive where this item resides (either installation package is stored, or application is installed). CAppMngr2InfoIterator uses this value to display the drive in "Details" dialog. See also the LocationDrive() function defined above.

CAppMngr2Runtime & iRuntime

CAppMngr2Runtime &iRuntime[private]

Reference to CAppMngr2Runtime class for this item. See also the Runtime() function defined above.

TBool iShowOnTop

TBool iShowOnTop[protected]

ShowOnTop (highlight) flag.

If ShowOnTop flag is ETrue, the item is highlighted in UI. It may be displayed on top of other items in installed application or installation files list, or it may be displayed in separate list of highlighted items.

For example, new or untrusted installed applications can be highlighted. When set, the item needs to show the reason why iShowOnTop is enabled (e.g. by using "new" or "untrusted" icon). See also the IsShowOnTop() function defined above.