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

Public Member Functions
CMPXPluginHandlerBase ( TUid , TPluginSelection , TInt , MMPXPluginHandlerObserver &, CMPXPluginMonitor *)
~CMPXPluginHandlerBase ()
IMPORT_C void ClearSelectionCriteria ()
IMPORT_C void CreatePluginListL ()
IMPORT_C TUid FindPlugin (const TArray < TUid > &)
IMPORT_C void GetPluginTypes ( RArray < TInt > &)
IMPORT_C void GetPluginUids ( RArray < TUid > &)
IMPORT_C void GetPluginUidsL ( RArray < TUid > &, TInt )
IMPORT_C void GetSelectionCriteria ( TPluginSelection &, TInt &, TUid &, TPtrC8 &, TPtrC8 &, TPtrC8 &)
IMPORT_C TInt IndexOf (const TUid &)
IMPORT_C TUint PluginFlagsL (const TUid &)
IMPORT_C const TDesC & PluginName ( TInt )
IMPORT_C const TDesC & PluginName (const TUid &)
IMPORT_C CDesCArray * PluginNamesL ()
IMPORT_C TUid PluginType (const TUid &)
IMPORT_C TUid PluginUid (const TDesC &)
IMPORT_C TBool ReleasePlugin (const TUid &)
IMPORT_C void SelectPluginL (const TUid &)
IMPORT_C void SelectPluginL (const TDesC &)
IMPORT_C void SelectPluginL (const TDesC &, const TDesC8 &)
IMPORT_C void SelectPluginL (const RFile &)
IMPORT_C void SelectPluginL ( TInt )
IMPORT_C TBool SupportUids (const TUid &, const TArray < TUid > &)
IMPORT_C TUid SupportedAppUid (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 void UsePlugin (const TUid &)
Protected Member Functions
IMPORT_C void BaseConstructL ()
IMPORT_C CMPXPluginInfo * ConstructPluginInfoLC (const CImplementationInformation &)
IMPORT_C void DoResolvePluginL ( TUid &, TInt &, TPtrC &, TInt &)
IMPORT_C void HandlePluginUnload (const TUid &)
IMPORT_C TBool IsPluginLoaded (const TUid &)
IMPORT_C void LoadPluginL (const TUid &)
IMPORT_C void PluginsChangedL ()
IMPORT_C void ResolvePluginL ()
IMPORT_C void UnloadPlugin (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
enum TPluginSelection { 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_C CMPXPluginHandlerBase ( TUid aInterfaceUid,
TPluginSelection aSelection,
TInt aSelectionType,
MMPXPluginHandlerObserver & aObserver,
CMPXPluginMonitor * aPluginMonitor = NULL
)

Constructor.

Since
S60 3.2.3

Parameters

TUid aInterfaceUid The UID of the ECOM plugin interface this plugin handler is designated for
TPluginSelection aSelection plugin selection choices as defined in TPluginSelection
TInt aSelectionType specifies the type of plugin for selection
MMPXPluginHandlerObserver & aObserver plugin handler observer instance
CMPXPluginMonitor * aPluginMonitor = NULL plugin 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 void BaseConstructL ( ) [protected]

2nd phase contructor.

Since
S60 3.2.3

ClearSelectionCriteria()

IMPORT_C void ClearSelectionCriteria ( ) [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 & aData implementation data

CreatePluginListL()

IMPORT_C void CreatePluginListL ( )

Create a list of plugins.

Since
S60 3.2.3

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

IMPORT_C void DoResolvePluginL ( 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 & aPluginUid This is an OUT parameter. The UID of the matching plugin
TInt & aIndex This is an OUT parameter. The index for the plugin info, plugin UID, and plugin types array for the matching plugin
TPtrC & aDisplayName This is an OUT parameter. The display name for the matching plugin. CMPXPluginHandlerBase is responsible for the memory management of this parameter.
TInt & aPluginType This is an OUT parameter. The plugin type for the matching plugin

FindPlugin(const TArray< TUid > &)

IMPORT_C TUid FindPlugin ( 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 > & aUids contains plugin uids

GetPluginTypes(RArray< TInt > &)

IMPORT_C void GetPluginTypes ( RArray < TInt > & aTypes ) const

Get currently available plug-in types.

Since
S60 3.2.3

Parameters

RArray < TInt > & aTypes

GetPluginUids(RArray< TUid > &)

IMPORT_C void GetPluginUids ( RArray < TUid > & aUids ) const

Get currently available plug-in UIDs.

Since
S60 3.2.3

Parameters

RArray < TUid > & aUids contains plugin uids

GetPluginUidsL(RArray< TUid > &, TInt)

IMPORT_C void GetPluginUidsL ( RArray < TUid > & aPlugins,
TInt aPluginType
) const

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

Since
S60 3.2.3

Parameters

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

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

IMPORT_C void GetSelectionCriteria ( 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 & aPluginSelection OUT parameter. the selection choice as defined by TPluginSelection
TInt & aPluginType OUT parameter. plugin type to be used for selection
TUid & aPluginUid OUT parameter. UID of the plugin to be used for selection. KNullUid is a possible return value if none is explicitly selected.
TPtrC8 & aDataType OUT 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 & aScheme OUT parameter. The scheme to be used for selection. KNullDesC8 if none is specified. CMPXPluginHandlerBase is responsible for the memory management of this parameter.
TPtrC8 & aExtension OUT 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 void HandlePluginUnload ( const TUid & aPluginUid ) [protected, virtual]

From MMPXPluginMonitorObserver.

Since
S60 3.2.3
MMPXPluginMonitorObserver

Parameters

const TUid & aPluginUid

IndexOf(const TUid &)

IMPORT_C TInt IndexOf ( const TUid & aPluginUid ) const

Returns the index of the specified plugin.

Parameters

const TUid & aPluginUid UID of the plugin to search for

IsPluginLoaded(const TUid &)

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

Checks if the specified plugin is loaded.

Since
S60 3.2.3

Parameters

const TUid & aPluginUid identifies the plugin

LoadPluginL(const TUid &)

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

Request to the derived class to load a specified plugin.

Since
S60 3.2.3

Parameters

const TUid & aPluginUid identifies the plugin

PluginFlagsL(const TUid &)

IMPORT_C TUint PluginFlagsL ( 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 & aUid plugin's implementation Uid

PluginName(TInt)

IMPORT_C const TDesC & PluginName ( TInt aPluginType ) 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 & aUid plugin 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 TUid PluginType ( const TUid & aUid ) const

Get plugin type for a given implementation UID.

Since
S60 3.2.3

Parameters

const TUid & aUid plugin's implementation Uid

PluginUid(const TDesC &)

IMPORT_C TUid PluginUid ( const TDesC & aPluginName ) const

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

Since
S60 3.2.3

Parameters

const TDesC & aPluginName a plugin's display name

PluginsChangedL()

IMPORT_C void PluginsChangedL ( ) [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 TBool ReleasePlugin ( 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 & aPluginUid plugin UID

ResolvePluginL()

IMPORT_C void ResolvePluginL ( ) [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 void SelectPluginL ( const TUid & aPluginUid )

Use this particular plugin.

Since
S60 3.2.3

Parameters

const TUid & aPluginUid UID of the plugin to be used

SelectPluginL(const TDesC &)

IMPORT_C void SelectPluginL ( const TDesC & aPluginName )

Use the plugin with the specified display name.

Since
S60 3.2.3

Parameters

const TDesC & aPluginName name of the plugin

SelectPluginL(const TDesC &, const TDesC8 &)

IMPORT_C void SelectPluginL ( 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 & aUri URI of the media
const TDesC8 & aDataType Mime type of the media. KNullDesC8 if not to be used for selection.

SelectPluginL(const RFile &)

IMPORT_C void SelectPluginL ( const RFile & aFile ) [virtual]

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

Since
S60 3.2.3

Parameters

const RFile & aFile a file handle to the media

SelectPluginL(TInt)

IMPORT_C void SelectPluginL ( TInt aPluginType ) [virtual]

Select a plugin based on the plugin type.

Since
S60 3.2.3

Parameters

TInt aPluginType plugin 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 TBool SupportUids ( 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 & aPluginId plugin id
const TArray < TUid > & aUids contains plugin uids

SupportedAppUid(const TUid &)

IMPORT_C TUid SupportedAppUid ( const TUid & aUid ) const

Get supported app uid for a given implementation UID

Parameters

const TUid & aUid plugin'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 & aUid plugin 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 & aUid plugin id

SupportedSchemasL()

IMPORT_C CDesCArray * SupportedSchemasL ( )

Return a list of schemas supported by plugins.

Since
S60 3.2.3

UnloadPlugin(const TUid &)

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

Request to the derived class to unload a specified plugin.

Since
S60 3.2.3

Parameters

const TUid & aPluginUid identifies the plugin

UsePlugin(const TUid &)

IMPORT_C void UsePlugin ( 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 & aPluginUid plugin 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]