CMPXPluginHandlerBase Class Reference

class CMPXPluginHandlerBase : public CBase

CMPXPluginHandlerBase instantiates and owns a CMPXPluginMonitor to monitor plugins for the designated plugin interface. It also provides plugin selection APIs and a common method for resolving a plugin from a set of selection criteria.

mpxcommon.lib

Inherits from

  • CMPXPluginHandlerBase
Public Member Functions
CMPXPluginHandlerBase(TUid, TPluginSelection, TInt, MMPXPluginHandlerObserver &, CMPXPluginMonitor *)
~CMPXPluginHandlerBase()
IMPORT_C voidClearSelectionCriteria()
IMPORT_C voidCreatePluginListL()
IMPORT_C TUidFindPlugin(const TArray< TUid > &)
IMPORT_C voidGetPluginTypes(RArray< TInt > &)
IMPORT_C voidGetPluginUids(RArray< TUid > &)
IMPORT_C voidGetPluginUidsL(RArray< TUid > &, TInt)
IMPORT_C voidGetSelectionCriteria(TPluginSelection &, TInt &, TUid &, TPtrC8 &, TPtrC8 &, TPtrC8 &)
IMPORT_C TIntIndexOf(const TUid &)
IMPORT_C TUintPluginFlagsL(const TUid &)
IMPORT_C const TDesC &PluginName(TInt)
IMPORT_C const TDesC &PluginName(const TUid &)
IMPORT_C CDesCArray *PluginNamesL()
IMPORT_C TUidPluginType(const TUid &)
IMPORT_C TUidPluginUid(const TDesC &)
IMPORT_C TBoolReleasePlugin(const TUid &)
IMPORT_C voidSelectPluginL(const TUid &)
IMPORT_C voidSelectPluginL(const TDesC &)
IMPORT_C voidSelectPluginL(const TDesC &, const TDesC8 &)
IMPORT_C voidSelectPluginL(const RFile &)
IMPORT_C voidSelectPluginL(TInt)
IMPORT_C TBoolSupportUids(const TUid &, const TArray< TUid > &)
IMPORT_C TUidSupportedAppUid(const TUid &)
IMPORT_C CDesCArray *SupportedExtensionsL()
IMPORT_C CDesCArray *SupportedExtensionsL(const TUid &)
IMPORT_C CDesCArray *SupportedMimeTypesL()
IMPORT_C CDesCArray *SupportedMimeTypesL(const TUid &)
IMPORT_C CDesCArray *SupportedSchemasL()
IMPORT_C voidUsePlugin(const TUid &)
Protected Member Functions
IMPORT_C voidBaseConstructL()
IMPORT_C CMPXPluginInfo *ConstructPluginInfoLC(const CImplementationInformation &)
IMPORT_C voidDoResolvePluginL(TUid &, TInt &, TPtrC &, TInt &)
IMPORT_C voidHandlePluginUnload(const TUid &)
IMPORT_C TBoolIsPluginLoaded(const TUid &)
IMPORT_C voidLoadPluginL(const TUid &)
IMPORT_C voidPluginsChangedL()
IMPORT_C voidResolvePluginL()
IMPORT_C voidUnloadPlugin(const TUid &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTPluginSelection { ESelectionType, ESelectionUid }
Protected Attributes
HBufC8 *iDataType
HBufC8 *iExt
TUid iInterfaceUid
MMPXPluginHandlerObserver &iObserver
TBool iOwnedPluginMonitor
RPointerArray< CMPXPluginInfo >iPluginInfoArray
CMPXPluginMonitor *iPluginMonitor
HBufC8 *iScheme
TInt iSelectedType
TUid iSelectedUid
TPluginSelection iSelection

Constructor & Destructor Documentation

CMPXPluginHandlerBase(TUid, TPluginSelection, TInt, MMPXPluginHandlerObserver &, CMPXPluginMonitor *)

IMPORT_CCMPXPluginHandlerBase(TUidaInterfaceUid,
TPluginSelectionaSelection,
TIntaSelectionType,
MMPXPluginHandlerObserver &aObserver,
CMPXPluginMonitor *aPluginMonitor = NULL
)

Constructor.

Since
S60 3.2.3

Parameters

TUid aInterfaceUidThe UID of the ECOM plugin interface this plugin handler is designated for
TPluginSelection aSelectionplugin selection choices as defined in TPluginSelection
TInt aSelectionTypespecifies the type of plugin for selection
MMPXPluginHandlerObserver & aObserverplugin handler observer instance
CMPXPluginMonitor * aPluginMonitor = NULLplugin monitor. It is for the clients to share the same plugin monitor object.

~CMPXPluginHandlerBase()

IMPORT_C~CMPXPluginHandlerBase()

Destructor.

Since
S60 3.2.3

Member Functions Documentation

BaseConstructL()

IMPORT_C voidBaseConstructL()[protected]

2nd phase contructor.

Since
S60 3.2.3

ClearSelectionCriteria()

IMPORT_C voidClearSelectionCriteria()[virtual]

Clear selection criteria parameters.

Since
S60 3.2.3

ConstructPluginInfoLC(const CImplementationInformation &)

IMPORT_C CMPXPluginInfo *ConstructPluginInfoLC(const CImplementationInformation &aData)[protected, virtual]

Constructs the plugins info class. Can be overwritten by subclasses to construct specialized instances of the plugin info. Default implementation constructs a CMPXPluginInfo class.

Since
S60 3.2.3

Parameters

const CImplementationInformation & aDataimplementation data

CreatePluginListL()

IMPORT_C voidCreatePluginListL()

Create a list of plugins.

Since
S60 3.2.3

DoResolvePluginL(TUid &, TInt &, TPtrC &, TInt &)

IMPORT_C voidDoResolvePluginL(TUid &aPluginUid,
TInt &aIndex,
TPtrC &aDisplayName,
TInt &aPluginType
)[protected, virtual]

Resolves a plugin based on properties (iDataType, iExt and iScheme) and selection criteria. When a plugin is found, information about the plugin is returned through parameters.

Since
S60 3.2.3
leave
KErrNotSupported Index is not found

Parameters

TUid & aPluginUidThis is an OUT parameter. The UID of the matching plugin
TInt & aIndexThis is an OUT parameter. The index for the plugin info, plugin UID, and plugin types array for the matching plugin
TPtrC & aDisplayNameThis is an OUT parameter. The display name for the matching plugin. CMPXPluginHandlerBase is responsible for the memory management of this parameter.
TInt & aPluginTypeThis is an OUT parameter. The plugin type for the matching plugin

FindPlugin(const TArray< TUid > &)

IMPORT_C TUidFindPlugin(const TArray< TUid > &aUids)const

Find a plugin with matches the array of uids the best.

Since
S60 3.2.3

Parameters

const TArray< TUid > & aUidscontains plugin uids

GetPluginTypes(RArray< TInt > &)

IMPORT_C voidGetPluginTypes(RArray< TInt > &aTypes)const

Get currently available plug-in types.

Since
S60 3.2.3

Parameters

RArray< TInt > & aTypes

GetPluginUids(RArray< TUid > &)

IMPORT_C voidGetPluginUids(RArray< TUid > &aUids)const

Get currently available plug-in UIDs.

Since
S60 3.2.3

Parameters

RArray< TUid > & aUidscontains plugin uids

GetPluginUidsL(RArray< TUid > &, TInt)

IMPORT_C voidGetPluginUidsL(RArray< TUid > &aPlugins,
TIntaPluginType
)const

All the UIDs of the plug-ins in the system of a specific type.

Since
S60 3.2.3

Parameters

RArray< TUid > & aPluginsOUT parameter. Array of UIDs of all plugins of type aPluginType. Client is responsible for the memory management of this RArray.
TInt aPluginTypeIN parameter. Plugin type

GetSelectionCriteria(TPluginSelection &, TInt &, TUid &, TPtrC8 &, TPtrC8 &, TPtrC8 &)

IMPORT_C voidGetSelectionCriteria(TPluginSelection &aPluginSelection,
TInt &aPluginType,
TUid &aPluginUid,
TPtrC8 &aDataType,
TPtrC8 &aScheme,
TPtrC8 &aExtension
)[virtual]

Retrieves the current selection criteria.

Since
S60 3.2.3

Parameters

TPluginSelection & aPluginSelectionOUT parameter. the selection choice as defined by TPluginSelection
TInt & aPluginTypeOUT parameter. plugin type to be used for selection
TUid & aPluginUidOUT parameter. UID of the plugin to be used for selection. KNullUid is a possible return value if none is explicitly selected.
TPtrC8 & aDataTypeOUT parameter. The data type to be used for selection. KNullDesC8 if none is specified. CMPXPluginHandlerBase is responsible for the memory management of this parameter.
TPtrC8 & aSchemeOUT parameter. The scheme to be used for selection. KNullDesC8 if none is specified. CMPXPluginHandlerBase is responsible for the memory management of this parameter.
TPtrC8 & aExtensionOUT parameter. The extension to be used for selection. KNullDesC8 if none is specified. CMPXPluginHandlerBase is responsible for the memory management of this parameter.

HandlePluginUnload(const TUid &)

IMPORT_C voidHandlePluginUnload(const TUid &aPluginUid)[protected, virtual]

From MMPXPluginMonitorObserver.

Since
S60 3.2.3
MMPXPluginMonitorObserver

Parameters

const TUid & aPluginUid

IndexOf(const TUid &)

IMPORT_C TIntIndexOf(const TUid &aPluginUid)const

Returns the index of the specified plugin.

Parameters

const TUid & aPluginUidUID of the plugin to search for

IsPluginLoaded(const TUid &)

IMPORT_C TBoolIsPluginLoaded(const TUid &aPluginUid)[protected, virtual]

Checks if the specified plugin is loaded.

Since
S60 3.2.3

Parameters

const TUid & aPluginUididentifies the plugin

LoadPluginL(const TUid &)

IMPORT_C voidLoadPluginL(const TUid &aPluginUid)[protected, virtual]

Request to the derived class to load a specified plugin.

Since
S60 3.2.3

Parameters

const TUid & aPluginUididentifies the plugin

PluginFlagsL(const TUid &)

IMPORT_C TUintPluginFlagsL(const TUid &aUid)const

Get plugin flag for a given implementation UID.

Since
S60 3.2.3
leave
KErrNotFound Uid is not found

Parameters

const TUid & aUidplugin's implementation Uid

PluginName(TInt)

IMPORT_C const TDesC &PluginName(TIntaPluginType)const

Returns display name for plugin with the given type.

Since
S60 3.2.3

Parameters

TInt aPluginType

PluginName(const TUid &)

IMPORT_C const TDesC &PluginName(const TUid &aUid)const

Returns display name for plugin with the given uid.

Since
S60 3.2.3

Parameters

const TUid & aUidplugin id

PluginNamesL()

IMPORT_C CDesCArray *PluginNamesL()

Returns a list of display names for the plugins.

Since
S60 3.2.3

PluginType(const TUid &)

IMPORT_C TUidPluginType(const TUid &aUid)const

Get plugin type for a given implementation UID.

Since
S60 3.2.3

Parameters

const TUid & aUidplugin's implementation Uid

PluginUid(const TDesC &)

IMPORT_C TUidPluginUid(const TDesC &aPluginName)const

Returns the UID of the plugin with the specified display name.

Since
S60 3.2.3

Parameters

const TDesC & aPluginNamea plugin's display name

PluginsChangedL()

IMPORT_C voidPluginsChangedL()[protected, virtual]

From MMPXPluginMonitorObserver. This is invoked by CMPXPluginMonitor when there is a change in the plugins for the designated plugin interface in the system.

Since
S60 3.2.3

ReleasePlugin(const TUid &)

IMPORT_C TBoolReleasePlugin(const TUid &aPluginUid)

Indicates that this plugin is no longer used by a client. Plugins are reference counted and this call may result in the plugin being unloaded.

Since
S60 3.2.3

Parameters

const TUid & aPluginUidplugin UID

ResolvePluginL()

IMPORT_C voidResolvePluginL()[protected, virtual]

Resolves a plugin. To be implemented by the child class. This is invoked whenever a client selects a plugin and whenever CMPXPluginMonitor notifies that there is a change in the plugins for the designated plugin interface in the system.

A typical implementation for this method is to invoke DoResolvePluginL and instantiate a plugin using the plugin UID returned from DoResolvePluginL.

NOTE: this method is not pure virtual because currently the playlist recognizer instantiates this class as opposed to the derived handler. This should be fixed and both ResolvePluginL and UnloadPlugin should be made pure virtuals.

Since
S60 3.2.3

SelectPluginL(const TUid &)

IMPORT_C voidSelectPluginL(const TUid &aPluginUid)

Use this particular plugin.

Since
S60 3.2.3

Parameters

const TUid & aPluginUidUID of the plugin to be used

SelectPluginL(const TDesC &)

IMPORT_C voidSelectPluginL(const TDesC &aPluginName)

Use the plugin with the specified display name.

Since
S60 3.2.3

Parameters

const TDesC & aPluginNamename of the plugin

SelectPluginL(const TDesC &, const TDesC8 &)

IMPORT_C voidSelectPluginL(const TDesC &aUri,
const TDesC8 &aDataType
)[virtual]

Select a plugin based on the URI and data type of the media given.

Since
S60 3.2.3
leave
KErrArgument Invalid URI

Parameters

const TDesC & aUriURI of the media
const TDesC8 & aDataTypeMime type of the media. KNullDesC8 if not to be used for selection.

SelectPluginL(const RFile &)

IMPORT_C voidSelectPluginL(const RFile &aFile)[virtual]

Select a plugin based on file handle for the given media.

Since
S60 3.2.3

Parameters

const RFile & aFilea file handle to the media

SelectPluginL(TInt)

IMPORT_C voidSelectPluginL(TIntaPluginType)[virtual]

Select a plugin based on the plugin type.

Since
S60 3.2.3

Parameters

TInt aPluginTypeplugin type for the appropriate plugin to be used. The representation for each bit is to be defined by each plugin interface.

SupportUids(const TUid &, const TArray< TUid > &)

IMPORT_C TBoolSupportUids(const TUid &aPluginId,
const TArray< TUid > &aUids
)const

Check if the plugin supports the array of uids.

Since
S60 3.2.3

Parameters

const TUid & aPluginIdplugin id
const TArray< TUid > & aUidscontains plugin uids

SupportedAppUid(const TUid &)

IMPORT_C TUidSupportedAppUid(const TUid &aUid)const

Get supported app uid for a given implementation UID

Parameters

const TUid & aUidplugin's implementation Uid

SupportedExtensionsL()

IMPORT_C CDesCArray *SupportedExtensionsL()

Return a list of file extensions supported by plugins.

Since
S60 3.2.3

SupportedExtensionsL(const TUid &)

IMPORT_C CDesCArray *SupportedExtensionsL(const TUid &aUid)

Return a list of file extensions supported by a plugin.

Since
S60 3.2.3

Parameters

const TUid & aUidplugin id

SupportedMimeTypesL()

IMPORT_C CDesCArray *SupportedMimeTypesL()

Return a list of mime types supported by plugins.

Since
S60 3.2.3

SupportedMimeTypesL(const TUid &)

IMPORT_C CDesCArray *SupportedMimeTypesL(const TUid &aUid)

Return a list of mime types supported by a plugin.

Since
S60 3.2.3

Parameters

const TUid & aUidplugin id

SupportedSchemasL()

IMPORT_C CDesCArray *SupportedSchemasL()

Return a list of schemas supported by plugins.

Since
S60 3.2.3

UnloadPlugin(const TUid &)

IMPORT_C voidUnloadPlugin(const TUid &aPluginUid)[protected, virtual]

Request to the derived class to unload a specified plugin.

Since
S60 3.2.3

Parameters

const TUid & aPluginUididentifies the plugin

UsePlugin(const TUid &)

IMPORT_C voidUsePlugin(const TUid &aPluginUid)

Indicates that this plugin is used by a client. Increments the reference count for the plugin.

Since
S60 3.2.3

Parameters

const TUid & aPluginUidplugin UID

Member Enumerations Documentation

Enum TPluginSelection

Enumerators

ESelectionType
ESelectionUid

Member Data Documentation

HBufC8 * iDataType

HBufC8 *iDataType[protected]

HBufC8 * iExt

HBufC8 *iExt[protected]

TUid iInterfaceUid

TUid iInterfaceUid[protected]

MMPXPluginHandlerObserver & iObserver

MMPXPluginHandlerObserver &iObserver[protected]

TBool iOwnedPluginMonitor

TBool iOwnedPluginMonitor[protected]

RPointerArray< CMPXPluginInfo > iPluginInfoArray

RPointerArray< CMPXPluginInfo >iPluginInfoArray[protected]

CMPXPluginMonitor * iPluginMonitor

CMPXPluginMonitor *iPluginMonitor[protected]

HBufC8 * iScheme

HBufC8 *iScheme[protected]

TInt iSelectedType

TInt iSelectedType[protected]

TUid iSelectedUid

TUid iSelectedUid[protected]

TPluginSelection iSelection

TPluginSelection iSelection[protected]