sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // mmf\common\mmfcontrollerpluginresolver.h sl@0: // sl@0: // sl@0: sl@0: #ifndef MMF_COMMON_MMFCONTROLLERPLUGINRESOLVER_H sl@0: #define MMF_COMMON_MMFCONTROLLERPLUGINRESOLVER_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Default heap size for the controller thread sl@0: */ sl@0: const TUint KMMFDefaultControllerThreadHeapSize = 0x100000; //1MB sl@0: sl@0: sl@0: class CMMFFormatImplementationInformation; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Array of CMMFFormatImplementationInformation sl@0: */ sl@0: typedef RPointerArray RMMFFormatImplInfoArray; sl@0: sl@0: class CMMFControllerImplementationInformation; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Array of CMMFControllerImplementationInformation sl@0: */ sl@0: typedef RPointerArray RMMFControllerImplInfoArray; sl@0: sl@0: class CMatchData; sl@0: sl@0: class CDesC8Array; sl@0: sl@0: /** sl@0: @publishedAll sl@0: sl@0: Abstract class that contains basic information about ECom Multimedia plugins. sl@0: sl@0: @released sl@0: @since 7.0s sl@0: */ sl@0: class CMMFPluginImplementationInformation : public CBase sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Returns the uid of this particular plugin implementation. sl@0: This is the UID used to instantiate this multimedia plugin. sl@0: sl@0: @return The implementation uid. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TUid Uid() const; sl@0: sl@0: /** sl@0: Returns the display name of this plugin implementation. sl@0: sl@0: @return The display name. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const TDesC& DisplayName() const; sl@0: sl@0: /** sl@0: Returns the name of the supplier of this plugin implementation, e.g. "Symbian". sl@0: sl@0: @return The plugin supplier. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const TDesC& Supplier() const; sl@0: sl@0: /** sl@0: Returns the version number of this plugin. sl@0: sl@0: @return The version number. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TInt Version() const; sl@0: sl@0: /** sl@0: Returns the array of media IDs supported by this plugin. sl@0: sl@0: The media ID can be used by clients to determine whether the plugin supports audio or sl@0: video data (or both). A UID is used for the media ID to provide future extensibility. sl@0: sl@0: @return The array of media IDs. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const RArray& SupportedMediaIds() const; sl@0: sl@0: /** sl@0: Tests whether this plugin was supplied by aSupplier. sl@0: sl@0: @param aSupplier sl@0: The required supplier. sl@0: sl@0: @return A boolean indicating if this plugin was supplied by aSupplier. ETrue if this plugin was supplied sl@0: by aSupplier, EFalse if not. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TBool SupportsSupplier(const TDesC& aSupplier) const; sl@0: sl@0: /** sl@0: Tests whether this plugin supports aMediaId. sl@0: sl@0: @param aMediaId sl@0: The required media id. sl@0: sl@0: @return A boolean indicating if the plugin supports aMediaId. ETrue if this plugin supports aMediaId, EFalse if not. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TBool SupportsMediaId(TUid aMediaId) const; sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: virtual ~CMMFPluginImplementationInformation(); sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: Constructor. sl@0: */ sl@0: CMMFPluginImplementationInformation(); sl@0: sl@0: /** sl@0: Sets the supplier. Takes a copy of aData. sl@0: */ sl@0: void SetSupplierL(const TDesC8& aData); sl@0: sl@0: /** sl@0: Adds a media id. aData is parsed to find the uid of the media id to be added. sl@0: */ sl@0: void AddMediaIdL(const TDesC8& aData); sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: The UID of this plugin. sl@0: */ sl@0: TUid iUid; sl@0: sl@0: /** sl@0: The display name of this plugin. sl@0: */ sl@0: HBufC* iDisplayName; sl@0: sl@0: /** sl@0: The supplier of this plugin. sl@0: */ sl@0: HBufC* iSupplier; sl@0: sl@0: /** sl@0: The version number of this plugin. sl@0: */ sl@0: TInt iVersion; sl@0: sl@0: /** sl@0: The media ids supported by this plugin. sl@0: */ sl@0: RArray iMediaIds; sl@0: }; sl@0: sl@0: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: sl@0: /** sl@0: @publishedAll sl@0: sl@0: Interface to be implemented by customers of the class TaggedDataParser. sl@0: */ sl@0: class MTaggedDataParserClient sl@0: { sl@0: public: sl@0: virtual void ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aData) = 0; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Contains format support information retrieved from the ECom registry. sl@0: sl@0: An object of this type may describe either a concrete format plugin (ie a CMMFFormatEncode or a sl@0: CMMFFormatDecode implementation) or a format supported by a controller plugin. sl@0: sl@0: The object is created using a CImplementationInformation object retrieved from the ECom registry. sl@0: All relevant data is copied out of the CImplementationInformation object, and its opaque data is sl@0: parsed to provide the supplier, supported media ids, supported mime types, supported file extensions, sl@0: and supported header data matches. sl@0: sl@0: Notes for Format Plugin developers: sl@0: @code sl@0: The opaque data section of the ECom plugin resource file must be in the format: sl@0: sl@0: opaque_data = "Data 1Data 2Data 3Data 4[...]Data N"; sl@0: sl@0: The preceding the data determines the meaning of the data. The following are the possible tags: sl@0: sl@0: - Supplier sl@0: - Media Id sl@0: - Mime Type sl@0: - File Extension sl@0: - Header Data sl@0: - Custom Interfaces sl@0: sl@0: UIDs must always be in hex in the format '0x12345678', must include the '0x' and be 10 characters long sl@0: @endcode sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFFormatImplementationInformation : public CMMFPluginImplementationInformation, MTaggedDataParserClient sl@0: { sl@0: public: sl@0: /** sl@0: Constructs a new format implementation information object. sl@0: sl@0: @param aImplInfo sl@0: The ECOM implementation information sl@0: sl@0: @return The new object created. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: static CMMFFormatImplementationInformation* NewL(const CImplementationInformation& aImplInfo); sl@0: sl@0: /** sl@0: Constructs a new format implementation information object. sl@0: sl@0: @param aImplInfo sl@0: The ECOM implementation information sl@0: sl@0: @return The new object created. Note that this will be on the cleanup stack. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: static CMMFFormatImplementationInformation* NewLC(const CImplementationInformation& aImplInfo); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: virtual ~CMMFFormatImplementationInformation(); sl@0: sl@0: /** sl@0: Returns the array of supported file extensions. sl@0: sl@0: @return The array of file extensions. sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const CDesC8Array& SupportedFileExtensions() const; sl@0: sl@0: /** sl@0: Returns the array of supported mime types. sl@0: sl@0: @return The array of mime types. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const CDesC8Array& SupportedMimeTypes() const; sl@0: sl@0: /** sl@0: Returns the array of supported header data matches. sl@0: sl@0: @return The array of header data. sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const CDesC8Array& SupportedHeaderData() const; sl@0: sl@0: /** sl@0: Tests whether this format provides support for the specified file extension, aFileExtension. sl@0: sl@0: @param aFileExtension sl@0: The requested file extension. Must be the extension only, and contain the dot '.' sl@0: sl@0: @return A boolean indicating if the specified file extension is supported. ETrue if this format provides sl@0: the required support, EFalse if it does not. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TBool SupportsFileExtension(const TDesC8& aFileExtension) const; sl@0: sl@0: /** sl@0: Tests whether this format provides support for aMimeType. sl@0: sl@0: @param aMimeType sl@0: The requested mime type. sl@0: sl@0: @return A boolean indicating if the format is supported. ETrue if this format provides the required support, EFalse if not. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TBool SupportsMimeType(const TDesC8& aMimeType) const; sl@0: sl@0: /** sl@0: Tests whether this format provides support for aHeaderData. sl@0: aHeaderData is searched for each chunk supported by this format. sl@0: sl@0: @param aHeaderData sl@0: The requested header data. sl@0: sl@0: @return A boolean indicating if aHeaderData is supported. ETrue if this format provides the required support, EFalse if not. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TBool SupportsHeaderDataL(const TDesC8& aHeaderData) const; sl@0: sl@0: /** sl@0: Tests whether this format provides support for Custom Interfaces. sl@0: sl@0: @return A boolean indicating if Custom Interfaces are supported. ETrue if this format provides the required support, EFalse if not. sl@0: */ sl@0: IMPORT_C TBool SupportsCustomInterfaces() const; sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: Constructor sl@0: */ sl@0: CMMFFormatImplementationInformation(); sl@0: sl@0: /** sl@0: 2nd phase constructor sl@0: */ sl@0: void ConstructL(const CImplementationInformation& aImplInfo); sl@0: sl@0: /** sl@0: Adds a file extension to the array of extensions supported by this format. sl@0: */ sl@0: void AddFileExtensionL(const TDesC8& aData); sl@0: sl@0: /** sl@0: Adds a mime type to the array of types supported by this format. sl@0: */ sl@0: void AddMimeTypeL(const TDesC8& aData); sl@0: sl@0: /** sl@0: Adds a chunk of header data to the array of chunks supported by this format. sl@0: */ sl@0: void AddHeaderDataL(const TDesC8& aData); sl@0: sl@0: /** sl@0: from MTaggedDataParserClient sl@0: */ sl@0: void ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aData); sl@0: sl@0: private: sl@0: class CBody; sl@0: /** sl@0: CMMFFormatImplementationInformation body sl@0: */ sl@0: CBody* iBody; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Contains controller plugin information retrieved from the ECom registry. sl@0: sl@0: The object is created using a CImplementationInformation object retrieved from the ECom registry. sl@0: All relevant data is copied out of the CImplementationInformation object, and its opaque data is sl@0: parsed to provide the supplier, supported media IDs. sl@0: sl@0: Notes for Format Plugin developers: sl@0: The exact formats supported by the controller plugin are calculated by: sl@0: sl@0: 1. The formats supported by the controller plugin itself must be declared in separate entries in the sl@0: controller plugin resource file. Two interface UIDs should be defined by the plugin writer - one sl@0: for the play formats supported, the other for the record formats supported. The play formats are sl@0: then listed as implementations of the play format interface uid, and likewise the record formats. sl@0: sl@0: 2. Format plugins (CMMFFormatEncode and CMMFFormatDecode) declare which controller plugin they sl@0: extend. ECom is search for the format plugins that extend the controller plugin, and they sl@0: are added to the list. sl@0: sl@0: The opaque data section of the ECom plugin resource file must be in the format: sl@0: @code sl@0: sl@0: opaque_data = "Data 1Data 2Data 3Data 4[...]Data N"; sl@0: sl@0: The preceding the data determines the meaning of the data. The following are the possible tags: sl@0: sl@0: - Supplier - must be only one sl@0: - Media Id sl@0:

- UID of play format 'interface' - must be only one sl@0: - UID of record format 'interface' - must be only one sl@0: sl@0: UIDs must always be in hex in the format '0x12345678', must include the '0x' and be 10 characters long. sl@0: @endcode sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFControllerImplementationInformation : public CMMFPluginImplementationInformation, MTaggedDataParserClient sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Constructs a new controller implementation information object. sl@0: sl@0: @param aImplInfo sl@0: The ECOM implementation information. sl@0: sl@0: @return The new object created. sl@0: sl@0: @internalTechnology sl@0: sl@0: @since 7.0s sl@0: */ sl@0: static CMMFControllerImplementationInformation* NewL(const CImplementationInformation& aImplInfo); sl@0: sl@0: /** sl@0: Constructs a new controller implementation information object. sl@0: sl@0: Note: sl@0: The new object will be on the cleanup stack. sl@0: sl@0: @param aImplInfo sl@0: The ECOM implementation information sl@0: sl@0: @return The new object created. sl@0: sl@0: @internalTechnology sl@0: sl@0: @since 7.0s sl@0: */ sl@0: static CMMFControllerImplementationInformation* NewLC(const CImplementationInformation& aImplInfo); sl@0: sl@0: /** sl@0: Constructs a new controller implementation information object. sl@0: sl@0: @param aUid sl@0: The Uid of the controller to obtain controller implementation information sl@0: sl@0: @return The new object created. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFControllerImplementationInformation* NewL(TUid aUid); sl@0: sl@0: /** sl@0: Destructor. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: ~CMMFControllerImplementationInformation(); sl@0: sl@0: /** sl@0: Returns the array of play formats supported by this controller. sl@0: sl@0: @return The play formats supported. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const RMMFFormatImplInfoArray& PlayFormats() const; sl@0: sl@0: /** sl@0: Returns the array of record formats supported by this controller. sl@0: sl@0: @return The record formats supported. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const RMMFFormatImplInfoArray& RecordFormats() const; sl@0: sl@0: /** sl@0: Returns the heap space required by this controller. sl@0: sl@0: @return The heap space required. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TUint HeapSpaceRequired() const; sl@0: sl@0: /** sl@0: Queries the ECom registry for the play formats supported. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void GetPlayFormatsL(); sl@0: sl@0: /** sl@0: Queries the ECom registry for the record formats supported. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void GetRecordFormatsL(); sl@0: sl@0: /** sl@0: Returns the uri schemes of this plugin. sl@0: sl@0: @return The array of uri schemes. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: IMPORT_C const CDesC8Array& SupportedUriSchemes() const; sl@0: sl@0: /** sl@0: Tests whether the plugin supports aUriScheme. sl@0: sl@0: @param aUriScheme sl@0: The required Uri Scheme. sl@0: sl@0: @return A boolean indicating if the plugin supports aUriScheme. ETrue if this plugin supports aUriScheme, EFalse if not. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: IMPORT_C TBool SupportsUriScheme(const TDesC8& aUriScheme) const; sl@0: sl@0: /** sl@0: Tests whether the controller plugin supports url sl@0: sl@0: @return A boolean indicating if the plugin supports url. ETrue for uri supporting controller, EFalse if not. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: IMPORT_C TBool SupportsNetworkCapability() const; sl@0: sl@0: /** sl@0: Sets the uri priority of this controller sl@0: sl@0: @param aUriPriority sl@0: The Uri priority to be assigned. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: IMPORT_C void SetUriPriority(TInt aUriPriority); sl@0: sl@0: /** sl@0: Retrieves the uri priority of this controller. sl@0: Higher priority implies greater number. ie UriPriority() returning 3 sl@0: has higher prioirty than UriPriority() returning 1. sl@0: sl@0: @return The assigned Uri priority. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: IMPORT_C TInt UriPriority() const; sl@0: sl@0: /** sl@0: Check whether the controller plugin supports secure DRM process mode sl@0: sl@0: @return A boolean indicating if the plugin supports secure DRM process mode. sl@0: ETrue for secure DRM process mode supporting controller, EFalse if not. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: IMPORT_C TBool SupportsSecureDRMProcessMode() const; sl@0: sl@0: /** sl@0: Returns the stack space required by this controller. sl@0: sl@0: @return The stack space required. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: IMPORT_C TUint StackSize() const; sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: Constructor. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: CMMFControllerImplementationInformation(); sl@0: sl@0: /** sl@0: 2nd phase constructor. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void ConstructL(const CImplementationInformation& aImplInfo); sl@0: sl@0: /** sl@0: Parses aData to get the collection UID of the play formats supported by this controller. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void SetPlayFormatCollectionUidL(const TDesC8& aData); sl@0: sl@0: /** sl@0: Parses aData to get the collection UID of the record formats supported by this controller. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void SetRecordFormatCollectionUidL(const TDesC8& aData); sl@0: sl@0: /** sl@0: Parses aData to get the size of the stack the controller requires. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void SetHeapSizeL(const TDesC8& aData); sl@0: sl@0: /** sl@0: From MTaggedDataParserClient. sl@0: */ sl@0: void ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aData); sl@0: sl@0: /** sl@0: Queries the ECom registry for: sl@0: - all registry entries with an interface UID of aFormatCollectionUid sl@0: - all format plugins with an interface UID of aFormatPluginCollectionUid (ie CMMFFormatEncode sl@0: or CMMFFormatDecode) that have the UID of this controller plugin in the default_data field sl@0: of their ECom resource file. sl@0: sl@0: CMMFFormatImplementationInformation objects are created for each entry returned, and appended to sl@0: aFormatArray. sl@0: sl@0: @param aFormatCollectionUid sl@0: See above. sl@0: @param aFormatPluginCollectionUid sl@0: See above. sl@0: @param aFormatArray sl@0: See above. sl@0: sl@0: @internalTechnology sl@0: sl@0: @since 7.0s sl@0: */ sl@0: void GetFormatsL(TUid aFormatCollectionUid, TUid aFormatPluginCollectionUid, RMMFFormatImplInfoArray& aFormatArray); sl@0: sl@0: /** sl@0: Creates CMMFFormatImplementationInformation objects for all CImplementationInformation objects sl@0: in aEcomArray. Any corrupt objects are ignored. The objects created are added to aFormatArray. sl@0: sl@0: @param aEcomArray sl@0: See above. sl@0: @param aFormatArray sl@0: See above. sl@0: sl@0: @internalTechnology sl@0: sl@0: @since 7.0s sl@0: */ sl@0: void AddFormatsSwallowCorruptL(RImplInfoPtrArray& aEcomArray, RMMFFormatImplInfoArray& aFormatArray); sl@0: sl@0: /** sl@0: Sets the Uri Scheme found in opaque data sl@0: sl@0: @param aUriScheme sl@0: Gives the uri scheme supported by the controller sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void SetUriSchemeL(const TDesC8& aUriScheme); sl@0: sl@0: /** sl@0: Sets the Network capability found in opaque data sl@0: sl@0: @param aNetworkCapable sl@0: Declares the incapability to support uri if matches to 'yes'. sl@0: If this is the case, iIsNetworkCtrl is set to EFalse sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void SetNetworkCapabilityL(const TDesC8& aNetworkCapable); sl@0: sl@0: /** sl@0: Parses aData to get the size of the stack the controller requires. sl@0: sl@0: @internalTechnology sl@0: */ sl@0: void SetStackSizeL(const TDesC8& aData); sl@0: sl@0: sl@0: private: sl@0: sl@0: /** sl@0: The play formats supported by this controller. sl@0: */ sl@0: RMMFFormatImplInfoArray iPlayFormats; sl@0: sl@0: /** sl@0: The record formats supported by this controller. sl@0: */ sl@0: RMMFFormatImplInfoArray iRecordFormats; sl@0: sl@0: /** sl@0: The interface uid of the resource file definitions of the play formats supported directly by this controller. sl@0: */ sl@0: TUid iPlayFormatCollectionUid; sl@0: sl@0: /** sl@0: The interface uid of the resource file definitions of the record formats supported directly by this controller. sl@0: */ sl@0: TUid iRecordFormatCollectionUid; sl@0: sl@0: /** sl@0: The heap space required by this controller sl@0: */ sl@0: TUint iHeapSpaceRequired; sl@0: sl@0: /** sl@0: The Uri scheme supported by this plugin sl@0: */ sl@0: CDesC8Array* iUriSchemes; sl@0: sl@0: /** sl@0: The uri priority acquired by this controller sl@0: */ sl@0: TInt iUriPriority; sl@0: sl@0: /** sl@0: The uri support provided by this controller sl@0: */ sl@0: TBool iIsNetworkCtrl; sl@0: sl@0: /** sl@0: Secure DRM process model supported by this controller sl@0: */ sl@0: TBool iSupportsSecureDRMProcessMode; sl@0: /** sl@0: The stack space required by this controller sl@0: */ sl@0: TUint iStackSize; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: sl@0: Contains the parameters used to select mmf plugins from the ECOM registry. sl@0: sl@0: @released sl@0: @since 7.0s sl@0: */ sl@0: class CMMFPluginSelectionParameters : public CBase sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Describes the type of preferred supplier match to be performed on the plugins return from sl@0: the ECOM registry. sl@0: */ sl@0: enum TPreferredSupplierMatchType sl@0: { sl@0: sl@0: /** No preferred supplier match will be performed. sl@0: */ sl@0: ENoPreferredSupplierMatch, sl@0: sl@0: /** Plugins from all suppliers will be returned, but those from the preferred supplier will be first in the list. sl@0: */ sl@0: EPreferredSupplierPluginsFirstInList, sl@0: sl@0: /** Only plugins from the preferred supplier will be returned. sl@0: */ sl@0: EOnlyPreferredSupplierPluginsReturned sl@0: }; sl@0: /** sl@0: Describes the type of media ID match to be performed on the plugins return from sl@0: the ECOM registry. sl@0: */ sl@0: enum TMediaIdMatchType sl@0: { sl@0: sl@0: /** No media ID match will be performed. sl@0: */ sl@0: ENoMediaIdMatch, sl@0: sl@0: /** All plugins that support the media ID supplied will be returned, even those that support sl@0: other media IDs. For example, if an audio plugin is requested, plugins that support sl@0: audio and video will also be returned. sl@0: */ sl@0: EAllowOtherMediaIds, sl@0: sl@0: /** Only plugins that support the exact media IDs supplied will be returned. For example, if an sl@0: audio plugin is requested, plugins that only support audio will be returned sl@0: (ie. no audio/video plugins). sl@0: */ sl@0: EAllowOnlySuppliedMediaIds sl@0: }; sl@0: sl@0: public: sl@0: sl@0: /** sl@0: Destructor. Resets and destroys all member data. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: virtual ~CMMFPluginSelectionParameters(); sl@0: sl@0: sl@0: /** sl@0: Sets the preferred supplier of the plugin. sl@0: sl@0: @param aPreferredSupplier sl@0: The preferred supplier of the plugin. sl@0: @param aMatchType sl@0: The type of match to be made. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetPreferredSupplierL(const TDesC& aPreferredSupplier, TPreferredSupplierMatchType aMatchType); sl@0: sl@0: /** sl@0: Sets the media IDs that must be supported by the plugin, for example audio, video etc. sl@0: sl@0: @param aMediaIds sl@0: An array of the media IDs that the selected plugins must support. sl@0: @param aMatchType sl@0: The type of match to be made. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetMediaIdsL(const RArray& aMediaIds, TMediaIdMatchType aMatchType); sl@0: sl@0: /** sl@0: Returns the preferred supplier. If no preferred supplier has been set, a blank sl@0: string will be returned. sl@0: sl@0: @return The preferred supplier sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const TDesC& PreferredSupplier() const; sl@0: sl@0: /** sl@0: Returns the type of preferred supplier match to perform. sl@0: sl@0: @return The preferred supplier match type. sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TPreferredSupplierMatchType PreferredSupplierMatchType() const; sl@0: sl@0: /** sl@0: Returns the list of media IDs that must be supported by the plugin. sl@0: sl@0: @return The list of media IDs. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const RArray& MediaIds() const; sl@0: sl@0: /** sl@0: Returns the type of preferred supplier match to perform. sl@0: sl@0: @return The preferred supplier match type. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TMediaIdMatchType MediaIdMatchType() const; sl@0: sl@0: /** sl@0: Returns the uid of the interface to be searched for plugin matches. sl@0: sl@0: @return The interface uid. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TUid InterfaceUid() const; sl@0: sl@0: protected: sl@0: sl@0: /** sl@0: Protected constructor. sl@0: sl@0: Defaults to setting the TPreferredSupplierMatchType enum to ENoPreferredSupplierMatch and TMediaIdMatchType sl@0: to ENoMediaIdMatch. sl@0: sl@0: @param aPluginInterfaceUid sl@0: The plugin's interface UID. sl@0: */ sl@0: CMMFPluginSelectionParameters(TUid aPluginInterfaceUid); sl@0: sl@0: /** sl@0: Tests whether the specified media is supported by the plugin. sl@0: sl@0: @param aPlugin sl@0: The media to test. sl@0: sl@0: @return A boolean indicating if the specified media is supported by the plugin. ETrue if the specified sl@0: media is supported by the plugin. EFalse if the specified media is not supported by the plugin. sl@0: */ sl@0: TBool CheckMediaIdSupportL(const CMMFPluginImplementationInformation& aPlugin) const; sl@0: private: sl@0: TUid iPluginInterfaceUid; sl@0: HBufC* iPreferredSupplier; sl@0: TPreferredSupplierMatchType iPreferredSupplierMatchType; sl@0: RArray iMediaIds; sl@0: TMediaIdMatchType iMediaIdMatchType; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: sl@0: Defines the format support required. sl@0: sl@0: On construction, the selection parameters are blank, causing all plugins to be returned. sl@0: sl@0: @released sl@0: @since 7.0s sl@0: */ sl@0: class CMMFFormatSelectionParameters : public CBase sl@0: { sl@0: public: sl@0: /** sl@0: Describes the type of match to be performed. sl@0: The match types are mutually exclusive. sl@0: */ sl@0: enum TMatchDataType sl@0: { sl@0: sl@0: /** All plugins will be selected. This is the default option. sl@0: */ sl@0: EMatchAny, sl@0: sl@0: /** The match will be based on a file extension. sl@0: */ sl@0: EMatchFileExtension, sl@0: sl@0: /** The match will be based on a mime type. sl@0: */ sl@0: EMatchMimeType, sl@0: sl@0: /** The match will be based on a header data. sl@0: */ sl@0: EMatchHeaderData, sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: The match will be based on Uri details. sl@0: */ sl@0: EMatchUri sl@0: }; sl@0: sl@0: public: sl@0: sl@0: /** sl@0: Allocates and constructs a new format selection parameter object with blank parameters. sl@0: sl@0: Calls NewLC(). sl@0: sl@0: @return A new format selection parameter object. sl@0: */ sl@0: IMPORT_C static CMMFFormatSelectionParameters* NewL(); sl@0: sl@0: /** sl@0: Allocates and constructs a new format selection parameter object with blank parameters, placing it on the sl@0: cleanup stack. sl@0: sl@0: @return A new format selection parameter object. sl@0: */ sl@0: IMPORT_C static CMMFFormatSelectionParameters* NewLC(); sl@0: sl@0: /** sl@0: Allocates and constructs a new format selection parameter object with the specified parameters. sl@0: sl@0: @param aParams sl@0: The required parameters. sl@0: @return A new format selection parameter object. sl@0: */ sl@0: static CMMFFormatSelectionParameters* NewL(const CMMFFormatSelectionParameters& aParams); sl@0: sl@0: /** sl@0: Sets this object to match to a file extension. sl@0: sl@0: aFileName can be a full filename or just an extension. If there is no dot in the filename sl@0: and it is 5 characters or less in length then it is assumed to be an extension. If the first sl@0: character of the filename is a dot, it assumed to be an extension. Otherwise, the filename sl@0: is parsed using TParse to reveal the extension. sl@0: sl@0: Once the extension has been extracted, it is converted from unicode to utf8 and copied into sl@0: iMatchData. sl@0: sl@0: @param aFileName sl@0: The file name to be matched. Must include the extension. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetMatchToFileNameL(const TDesC& aFileName); sl@0: sl@0: /** sl@0: Sets this object to match to a file extension specified by a URI sl@0: sl@0: Once the extension has been extracted, it is copied into iMatchData. sl@0: sl@0: @param aUri sl@0: The URI containing the file name to be matched. Must include the extension. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetMatchToUriL(const TDesC& aUri); sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Sets this object to match to uri scheme and file extension specified by a URI. sl@0: sl@0: The Uri scheme and extension are saved in iMatchReqData. Further,iMatchData contains uri extension, sl@0: iMatchUriScheme contains uri scheme. sl@0: sl@0: @param aUri sl@0: The URI containing the scheme and uri extension to be matched. sl@0: sl@0: */ sl@0: IMPORT_C void SetMatchToUriSupportL(const TDesC& aUri); sl@0: sl@0: /** sl@0: Sets this object to match to a MIME type. sl@0: sl@0: @param aMimeType sl@0: The mime type to match. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetMatchToMimeTypeL(const TDesC8& aMimeType); sl@0: sl@0: /** sl@0: Sets this object to match to a pattern in header data. sl@0: sl@0: @param aHeaderData sl@0: The header of the file in question. This header data will be matched sl@0: against the match patterns provided by the plugins. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetMatchToHeaderDataL(const TDesC8& aHeaderData); sl@0: sl@0: /** sl@0: Returns the data used to perform the plugin match. sl@0: sl@0: @return The match data. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const TDesC8& MatchData() const; sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Returns the uri scheme used to perform the plugin match. sl@0: sl@0: @return The uri scheme. sl@0: sl@0: */ sl@0: IMPORT_C const TDesC8& MatchUriScheme() const; sl@0: sl@0: /** sl@0: Returns the type of the data used to perform the plugin match. sl@0: sl@0: @return The match data type. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TMatchDataType MatchDataType() const; sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: virtual ~CMMFFormatSelectionParameters(); sl@0: protected: sl@0: sl@0: /** sl@0: Protected constructor. sl@0: */ sl@0: CMMFFormatSelectionParameters(); sl@0: void ConstructL(const CMMFFormatSelectionParameters& aParams); sl@0: sl@0: private: sl@0: CMatchData* iMatchReqData; sl@0: TMatchDataType iMatchDataType; sl@0: }; sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Contains the parameters used to select controller plugins from the ECOM registry. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFControllerPluginSelectionParameters : public CMMFPluginSelectionParameters sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Constructs a new controller selection parameters object. sl@0: sl@0: @return The new object created. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFControllerPluginSelectionParameters* NewL(); sl@0: sl@0: /** sl@0: Construct a new controller selection parameters object. sl@0: sl@0: @return The new object created. Note that the new object will be left on the cleanup stack. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFControllerPluginSelectionParameters* NewLC(); sl@0: sl@0: /** sl@0: Sets the play format support required. sl@0: sl@0: Note: sl@0: The play formats supported by the controller plugins will only be retrieved if sl@0: this method is called. To get all the play formats supported by the system, call this sl@0: with a 'blank' CMMFFormatSelectionParameters object. sl@0: sl@0: @param aRequiredSupport sl@0: The play format support required. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetRequiredPlayFormatSupportL(const CMMFFormatSelectionParameters& aRequiredSupport); sl@0: sl@0: /** sl@0: Sets the record format support required. sl@0: sl@0: Note: sl@0: The record formats supported by the controller plugins will only be retrieved if sl@0: this method is called. To get all the record formats supported by the system, call this sl@0: with a 'blank' CMMFFormatSelectionParameters object. sl@0: sl@0: @param aRequiredSupport sl@0: The record format support required. sl@0: sl@0: @return The new object created. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetRequiredRecordFormatSupportL(const CMMFFormatSelectionParameters& aRequiredSupport); sl@0: sl@0: /** sl@0: Retrieves all controller plugins that support the requirements of the caller. sl@0: sl@0: @param aImplementations sl@0: After this method returns, this array will contain all the sl@0: controller plugins that support the caller's requirements. sl@0: Note: The array will be emptied by this method. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C virtual void ListImplementationsL(RMMFControllerImplInfoArray& aImplementations) const; sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: virtual ~CMMFControllerPluginSelectionParameters(); sl@0: protected: sl@0: CMMFControllerPluginSelectionParameters(); sl@0: void MatchImplementationToSelectParamsL(RMMFControllerImplInfoArray& aImplementations, const CMMFControllerImplementationInformation& aPlugin, TInt& aArrayPos) const; sl@0: TInt CheckPreferredSupplierL(RMMFControllerImplInfoArray& aImplementations, const CMMFControllerImplementationInformation& aPlugin) const; sl@0: TBool CheckFormatSupportL(CMMFFormatSelectionParameters* aSelectParams, const RMMFFormatImplInfoArray& aFormats) const; sl@0: /** sl@0: Checks the given Controller for uri support. Uri support may be there sl@0: if either requiredscheme or extension matches with that given controller sl@0: sl@0: @param aSelectParams sl@0: Describes the selection parameter which a controller needs to sl@0: support in order to be selected sl@0: sl@0: @param aPlugin sl@0: The controller plugin which is checked for uri support sl@0: sl@0: @param aFormats sl@0: The play or record formats looked for extension match sl@0: */ sl@0: TBool CheckUriSupport(CMMFFormatSelectionParameters* aSelectParams, CMMFControllerImplementationInformation* aPlugin, const RMMFFormatImplInfoArray& aFormats) const; sl@0: sl@0: protected: sl@0: /** sl@0: The required play format support sl@0: */ sl@0: CMMFFormatSelectionParameters* iRequiredPlayFormatSupport; sl@0: sl@0: /** sl@0: The required record format support sl@0: */ sl@0: CMMFFormatSelectionParameters* iRequiredRecordFormatSupport; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Contains the parameters used to select controller plugins which support SecureDRM model sl@0: from the ECOM registry. Controller plugins which support SecureDRM model allow play back of DRM-protected sl@0: content by client processes without DRM capability. In such case the controller will be loaded in a separate secure DRM process. sl@0: */ sl@0: class CMMFControllerSecureDrmPluginSelectionParameters : public CMMFControllerPluginSelectionParameters sl@0: { sl@0: sl@0: public: sl@0: /** sl@0: Constructs a new controller selection parameters object. sl@0: sl@0: @return The new object created. sl@0: */ sl@0: IMPORT_C static CMMFControllerSecureDrmPluginSelectionParameters* NewL(); sl@0: sl@0: /** sl@0: Construct a new controller selection parameters object. sl@0: sl@0: @return The new object created. Note that the new object will be left on the cleanup stack. sl@0: */ sl@0: IMPORT_C static CMMFControllerSecureDrmPluginSelectionParameters* NewLC(); sl@0: sl@0: /** sl@0: Retrieves all controller plugins that support SecureDRM model and the requirements of the caller. sl@0: sl@0: @param aImplementations sl@0: After this method returns, this array will contain all the sl@0: controller plugins that support the caller's requirements. sl@0: Note: The array will be emptied by this method and SecureDRM model. sl@0: */ sl@0: IMPORT_C virtual void ListImplementationsL(RMMFControllerImplInfoArray& aImplementations) const; sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: virtual ~CMMFControllerSecureDrmPluginSelectionParameters() {}; sl@0: protected: sl@0: CMMFControllerSecureDrmPluginSelectionParameters(); sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Abstract class used to contain the parameters used to select format plugins from the ECOM registry. sl@0: sl@0: Note: sl@0: The classes CMMFFormatEncodePluginSelectionParamters and CMMFFormatDecodePluginSelectionParameters sl@0: should be used to list and select format plugin implementations. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFFormatPluginSelectionParameters : public CMMFPluginSelectionParameters sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Retrieves all format plugins that support the requirements of the caller. sl@0: sl@0: @param aImplementations sl@0: After this function returns, this array will contain all the sl@0: format plugins that support the caller's requirements. sl@0: Note: The array will be emptied by this method. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void ListImplementationsL(RMMFFormatImplInfoArray& aImplementations) const; sl@0: sl@0: /** sl@0: Sets the format support required. sl@0: sl@0: @param aRequiredSupport sl@0: The format support required. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetRequiredFormatSupportL(const CMMFFormatSelectionParameters& aRequiredSupport); sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: virtual ~CMMFFormatPluginSelectionParameters(); sl@0: protected: sl@0: /** sl@0: Protected constructor. sl@0: */ sl@0: CMMFFormatPluginSelectionParameters(TUid aInterfaceUid); sl@0: sl@0: void MatchImplementationToSelectParamsL(RMMFFormatImplInfoArray& aImplementations, const CMMFFormatImplementationInformation& aPlugin, TInt& aArrayPos) const; sl@0: TInt CheckPreferredSupplierL(RMMFFormatImplInfoArray& aImplementations, const CMMFFormatImplementationInformation& aPlugin) const; sl@0: TBool CheckFormatSupportL(const CMMFFormatImplementationInformation& aPlugin) const; sl@0: protected: sl@0: /** sl@0: The format support required sl@0: */ sl@0: CMMFFormatSelectionParameters* iRequiredFormatSupport; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Class used to list and select plugins implementing the CMMFFormatEncode interface. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFFormatEncodePluginSelectionParameters : public CMMFFormatPluginSelectionParameters sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Construct a new format encode selection parameters object. sl@0: sl@0: @return The new object created. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFFormatEncodePluginSelectionParameters* NewL(); sl@0: sl@0: /** sl@0: Constructs a new format encode selection parameters object. sl@0: sl@0: @return The new object created. Note that the new object will be left on the cleanup stack. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFFormatEncodePluginSelectionParameters* NewLC(); sl@0: protected: sl@0: /** sl@0: Protected constructor. sl@0: */ sl@0: CMMFFormatEncodePluginSelectionParameters(); sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Class used to list and select plugins implementing the CMMFFormatDecode interface. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFFormatDecodePluginSelectionParameters : public CMMFFormatPluginSelectionParameters sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Constructs a new format decode selection parameters object. sl@0: sl@0: @return The new object created. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFFormatDecodePluginSelectionParameters* NewL(); sl@0: sl@0: /** sl@0: Constructs a new format decode selection parameters object. sl@0: sl@0: @return The new object created. Note that the new object will be left on the cleanup stack. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFFormatDecodePluginSelectionParameters* NewLC(); sl@0: protected: sl@0: /** sl@0: Protected constructor. sl@0: */ sl@0: CMMFFormatDecodePluginSelectionParameters(); sl@0: }; sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Template class CleanupResetAndDestroy to clean up the array sl@0: of implementation information from the cleanup stack. sl@0: */ sl@0: sl@0: template sl@0: class CleanupResetAndDestroy sl@0: { sl@0: public: sl@0: /** sl@0: Puts an item on the cleanup stack. sl@0: sl@0: @param aRef sl@0: The implementation information to be put on the cleanup stack. sl@0: */ sl@0: inline static void PushL(T& aRef); sl@0: private: sl@0: static void ResetAndDestroy(TAny *aPtr); sl@0: }; sl@0: template sl@0: inline void CleanupResetAndDestroyPushL(T& aRef); sl@0: template sl@0: inline void CleanupResetAndDestroy::PushL(T& aRef) sl@0: {CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef));} sl@0: template sl@0: void CleanupResetAndDestroy::ResetAndDestroy(TAny *aPtr) sl@0: {(STATIC_CAST(T*,aPtr))->ResetAndDestroy();} sl@0: template sl@0: inline void CleanupResetAndDestroyPushL(T& aRef) sl@0: {CleanupResetAndDestroy::PushL(aRef);} sl@0: sl@0: sl@0: #endif