epoc32/include/mmf/common/mmfcontrollerpluginresolver.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    49 
    49 
    50 Array of CMMFControllerImplementationInformation 
    50 Array of CMMFControllerImplementationInformation 
    51 */
    51 */
    52 typedef RPointerArray<CMMFControllerImplementationInformation> RMMFControllerImplInfoArray;
    52 typedef RPointerArray<CMMFControllerImplementationInformation> RMMFControllerImplInfoArray;
    53 
    53 
    54 /**
    54 class CMatchData;
    55 @internalComponent
    55 
       
    56 class CDesC8Array;
       
    57 
       
    58 /**
       
    59 @publishedAll
       
    60 
       
    61 Abstract class that contains basic information about ECom Multimedia plugins.
       
    62 
       
    63 @released
       
    64 @since 7.0s
       
    65 */
       
    66 class CMMFPluginImplementationInformation : public CBase
       
    67 	{
       
    68 public:
       
    69 
       
    70 	/**
       
    71 	Returns the uid of this particular plugin implementation.
       
    72 	This is the UID used to instantiate this multimedia plugin.
       
    73 
       
    74 	@return The implementation uid.
       
    75 
       
    76 	@since  7.0s
       
    77 	*/
       
    78 	IMPORT_C TUid Uid() const;
       
    79 
       
    80 	/**
       
    81 	Returns the display name of this plugin implementation.
       
    82 
       
    83 	@return The display name.
       
    84 
       
    85 	@since  7.0s
       
    86 	*/
       
    87 	IMPORT_C const TDesC& DisplayName() const;
       
    88 
       
    89 	/**
       
    90 	Returns the name of the supplier of this plugin implementation, e.g. "Symbian".
       
    91 
       
    92 	@return The plugin supplier.
       
    93 
       
    94 	@since  7.0s
       
    95 	*/
       
    96 	IMPORT_C const TDesC& Supplier() const;
       
    97 
       
    98 	/**
       
    99 	Returns the version number of this plugin.
       
   100 
       
   101 	@return The version number.
       
   102 
       
   103 	@since 7.0s
       
   104 	*/
       
   105 	IMPORT_C TInt Version() const;
       
   106 
       
   107 	/**
       
   108 	Returns the array of media IDs supported by this plugin.
       
   109 	
       
   110 	The media ID can be used by clients to determine whether the plugin supports audio or
       
   111 	video data (or both). A UID is used for the media ID to provide future extensibility.
       
   112 
       
   113 	@return The array of media IDs.
       
   114 
       
   115 	@since  7.0s
       
   116 	*/
       
   117 	IMPORT_C const RArray<TUid>& SupportedMediaIds() const;
       
   118 
       
   119 	/**
       
   120 	Tests whether this plugin was supplied by aSupplier.
       
   121 
       
   122 	@param  aSupplier
       
   123 	        The required supplier.
       
   124 
       
   125 	@return A boolean indicating if this plugin was supplied by aSupplier. ETrue if this plugin was supplied 
       
   126 	        by aSupplier, EFalse if not.
       
   127 
       
   128 	@since 7.0s
       
   129 	*/
       
   130 	IMPORT_C TBool SupportsSupplier(const TDesC& aSupplier) const;
       
   131 
       
   132 	/**
       
   133 	Tests whether this plugin supports aMediaId.
       
   134 
       
   135 	@param  aMediaId
       
   136 	        The required media id.
       
   137 
       
   138 	@return A boolean indicating if the plugin supports aMediaId. ETrue if this plugin supports aMediaId, EFalse if not.
       
   139 
       
   140 	@since 7.0s
       
   141 	*/
       
   142 	IMPORT_C TBool SupportsMediaId(TUid aMediaId) const;
       
   143 
       
   144 	/**
       
   145 	Destructor.
       
   146 	*/
       
   147 	virtual ~CMMFPluginImplementationInformation();
       
   148 
       
   149 protected:
       
   150 
       
   151 	/**
       
   152 	Constructor.
       
   153 	*/
       
   154 	CMMFPluginImplementationInformation();
       
   155 
       
   156 	/** 
       
   157 	Sets the supplier. Takes a copy of aData.
       
   158 	*/
       
   159 	void SetSupplierL(const TDesC8& aData);
       
   160 
       
   161 	/**
       
   162 	Adds a media id. aData is parsed to find the uid of the media id to be added.
       
   163 	*/
       
   164 	void AddMediaIdL(const TDesC8& aData);
       
   165 	
       
   166 protected:
       
   167 
       
   168 	/** 
       
   169 	The UID of this plugin. 
       
   170 	*/
       
   171 	TUid iUid;
       
   172 
       
   173 	/** 
       
   174 	The display name of this plugin. 
       
   175 	*/
       
   176 	HBufC* iDisplayName;
       
   177 
       
   178 	/** 
       
   179 	The supplier of this plugin. 
       
   180 	*/
       
   181 	HBufC* iSupplier;
       
   182 
       
   183 	/** 
       
   184 	The version number of this plugin. 
       
   185 	*/
       
   186 	TInt iVersion;
       
   187 
       
   188 	/**
       
   189 	The media ids supported by this plugin.
       
   190 	*/
       
   191 	RArray<TUid> iMediaIds;
       
   192 	};
       
   193 
       
   194 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   195 #include <mmf/common/taggeddataparser.h>
       
   196 #endif
       
   197 
       
   198 /**
       
   199 @publishedAll
    56 
   200 
    57 Interface to be implemented by customers of the class TaggedDataParser.
   201 Interface to be implemented by customers of the class TaggedDataParser.
    58 */
   202 */
    59 class MTaggedDataParserClient
   203 class MTaggedDataParserClient
    60 	{
   204 	{
    61 public:
   205 public:
    62 	virtual void ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aData) = 0;
   206 	virtual void ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aData) = 0;
    63 	};
       
    64 
       
    65 /**
       
    66 @internalComponent
       
    67 
       
    68 Utility class used to parse data separated by xml-style tags.
       
    69 */
       
    70 class TaggedDataParser
       
    71 	{
       
    72 public:
       
    73 
       
    74 	/**
       
    75 	Splits aData into xml-style tags and values, and gets aClient to process each tag/value pair.
       
    76 	*/
       
    77 	static void ParseTaggedDataL(const TDesC8& aData, MTaggedDataParserClient& aClient);
       
    78 
       
    79 	/**
       
    80 	Converts a string to a uid. If the string begin with "0x" it will be parsed as Hex, else Decimal.
       
    81 	*/
       
    82 	static void ConvertTextToUidL(const TDesC8& aData, TUid& aUid);
       
    83 
       
    84 	/**
       
    85 	Converts a string to a TUint. The string must begin with "0x" and be 10 characters long,
       
    86 	otherwise it is considered corrupt.
       
    87 	*/
       
    88 	static void ConvertTextToTUintL(const TDesC8& aData, TUint& aUid);
       
    89 
       
    90 	};
       
    91 
       
    92 class CMatchData;
       
    93 
       
    94 class CDesC8Array;
       
    95 
       
    96 /**
       
    97 @publishedAll
       
    98 
       
    99 Abstract class that contains basic information about ECom Multimedia plugins.
       
   100 
       
   101 @released
       
   102 @since 7.0s
       
   103 */
       
   104 class CMMFPluginImplementationInformation : public CBase
       
   105 	{
       
   106 public:
       
   107 
       
   108 	/**
       
   109 	Returns the uid of this particular plugin implementation.
       
   110 	This is the UID used to instantiate this multimedia plugin.
       
   111 
       
   112 	@return The implementation uid.
       
   113 
       
   114 	@since  7.0s
       
   115 	*/
       
   116 	IMPORT_C TUid Uid() const;
       
   117 
       
   118 	/**
       
   119 	Returns the display name of this plugin implementation.
       
   120 
       
   121 	@return The display name.
       
   122 
       
   123 	@since  7.0s
       
   124 	*/
       
   125 	IMPORT_C const TDesC& DisplayName() const;
       
   126 
       
   127 	/**
       
   128 	Returns the name of the supplier of this plugin implementation, e.g. "Symbian".
       
   129 
       
   130 	@return The plugin supplier.
       
   131 
       
   132 	@since  7.0s
       
   133 	*/
       
   134 	IMPORT_C const TDesC& Supplier() const;
       
   135 
       
   136 	/**
       
   137 	Returns the version number of this plugin.
       
   138 
       
   139 	@return The version number.
       
   140 
       
   141 	@since 7.0s
       
   142 	*/
       
   143 	IMPORT_C TInt Version() const;
       
   144 
       
   145 	/**
       
   146 	Returns the array of media IDs supported by this plugin.
       
   147 	
       
   148 	The media ID can be used by clients to determine whether the plugin supports audio or
       
   149 	video data (or both). A UID is used for the media ID to provide future extensibility.
       
   150 
       
   151 	@return The array of media IDs.
       
   152 
       
   153 	@since  7.0s
       
   154 	*/
       
   155 	IMPORT_C const RArray<TUid>& SupportedMediaIds() const;
       
   156 
       
   157 	/**
       
   158 	Tests whether this plugin was supplied by aSupplier.
       
   159 
       
   160 	@param  aSupplier
       
   161 	        The required supplier.
       
   162 
       
   163 	@return A boolean indicating if this plugin was supplied by aSupplier. ETrue if this plugin was supplied 
       
   164 	        by aSupplier, EFalse if not.
       
   165 
       
   166 	@since 7.0s
       
   167 	*/
       
   168 	IMPORT_C TBool SupportsSupplier(const TDesC& aSupplier) const;
       
   169 
       
   170 	/**
       
   171 	Tests whether this plugin supports aMediaId.
       
   172 
       
   173 	@param  aMediaId
       
   174 	        The required media id.
       
   175 
       
   176 	@return A boolean indicating if the plugin supports aMediaId. ETrue if this plugin supports aMediaId, EFalse if not.
       
   177 
       
   178 	@since 7.0s
       
   179 	*/
       
   180 	IMPORT_C TBool SupportsMediaId(TUid aMediaId) const;
       
   181 
       
   182 	/**
       
   183 	Destructor.
       
   184 	*/
       
   185 	virtual ~CMMFPluginImplementationInformation();
       
   186 
       
   187 protected:
       
   188 
       
   189 	/**
       
   190 	Constructor.
       
   191 	*/
       
   192 	CMMFPluginImplementationInformation();
       
   193 
       
   194 	/** 
       
   195 	Sets the supplier. Takes a copy of aData.
       
   196 	*/
       
   197 	void SetSupplierL(const TDesC8& aData);
       
   198 
       
   199 	/**
       
   200 	Adds a media id. aData is parsed to find the uid of the media id to be added.
       
   201 	*/
       
   202 	void AddMediaIdL(const TDesC8& aData);
       
   203 	
       
   204 protected:
       
   205 
       
   206 	/** 
       
   207 	The UID of this plugin. 
       
   208 	*/
       
   209 	TUid iUid;
       
   210 
       
   211 	/** 
       
   212 	The display name of this plugin. 
       
   213 	*/
       
   214 	HBufC* iDisplayName;
       
   215 
       
   216 	/** 
       
   217 	The supplier of this plugin. 
       
   218 	*/
       
   219 	HBufC* iSupplier;
       
   220 
       
   221 	/** 
       
   222 	The version number of this plugin. 
       
   223 	*/
       
   224 	TInt iVersion;
       
   225 
       
   226 	/**
       
   227 	The media ids supported by this plugin.
       
   228 	*/
       
   229 	RArray<TUid> iMediaIds;
       
   230 	};
   207 	};
   231 
   208 
   232 /**
   209 /**
   233 @publishedAll
   210 @publishedAll
   234 @released
   211 @released
   523 	@return The heap space required.
   500 	@return The heap space required.
   524 
   501 
   525 	@since  7.0s
   502 	@since  7.0s
   526 	*/
   503 	*/
   527 	IMPORT_C TUint HeapSpaceRequired() const;
   504 	IMPORT_C TUint HeapSpaceRequired() const;
   528 	
   505 
   529 	/**
   506 	/**
   530 	Queries the ECom registry for the play formats supported. 
   507 	Queries the ECom registry for the play formats supported. 
   531 	
   508 	
   532 	@internalTechnology
   509 	@internalTechnology
   533 	*/
   510 	*/
   598 	ETrue for secure DRM process mode supporting controller, EFalse if not.
   575 	ETrue for secure DRM process mode supporting controller, EFalse if not.
   599 	
   576 	
   600 	@internalTechnology
   577 	@internalTechnology
   601 	*/
   578 	*/
   602 	IMPORT_C TBool SupportsSecureDRMProcessMode() const;
   579 	IMPORT_C TBool SupportsSecureDRMProcessMode() const;
       
   580 
       
   581 	/**
       
   582 	Returns the stack space required by this controller.
       
   583 
       
   584 	@return The stack space required.
       
   585 	
       
   586 	@internalTechnology
       
   587 	*/
       
   588 	IMPORT_C TUint StackSize() const;
   603 	
   589 	
   604 protected:
   590 protected:
   605 
   591 
   606 	/**
   592 	/**
   607 	Constructor.
   593 	Constructor.
   700 	
   686 	
   701 	@internalTechnology
   687 	@internalTechnology
   702 	*/
   688 	*/
   703 	void SetNetworkCapabilityL(const TDesC8& aNetworkCapable);
   689 	void SetNetworkCapabilityL(const TDesC8& aNetworkCapable);
   704 
   690 
       
   691 	/**
       
   692 	Parses aData to get the size of the stack the controller requires.
       
   693 		
       
   694 	@internalTechnology
       
   695 	*/
       
   696 	void SetStackSizeL(const TDesC8& aData);
       
   697 
       
   698 
   705 private:
   699 private:
   706 
   700 
   707 	/**
   701 	/**
   708 	The play formats supported by this controller.
   702 	The play formats supported by this controller.
   709 	*/
   703 	*/
   726 	
   720 	
   727 	/**
   721 	/**
   728 	The heap space required by this controller
   722 	The heap space required by this controller
   729 	*/
   723 	*/
   730 	TUint iHeapSpaceRequired;
   724 	TUint iHeapSpaceRequired;
   731 	
   725 		
   732 	/**
   726 	/**
   733 	The Uri scheme supported by this plugin
   727 	The Uri scheme supported by this plugin
   734 	*/
   728 	*/
   735 	CDesC8Array* iUriSchemes;
   729 	CDesC8Array* iUriSchemes;
   736 	
   730 	
   746 	
   740 	
   747 	/**
   741 	/**
   748 	Secure DRM process model supported by this controller
   742 	Secure DRM process model supported by this controller
   749 	*/
   743 	*/
   750 	TBool  iSupportsSecureDRMProcessMode;
   744 	TBool  iSupportsSecureDRMProcessMode;
       
   745 	/**
       
   746 	The stack space required by this controller
       
   747 	*/
       
   748 	TUint iStackSize;		
   751 	};
   749 	};
   752 
   750 
   753 
   751 
   754 /**
   752 /**
   755 @publishedAll
   753 @publishedAll
   951 	*/
   949 	*/
   952 	EMatchHeaderData,
   950 	EMatchHeaderData,
   953 	
   951 	
   954 	/** 
   952 	/** 
   955 	@publishedPartner
   953 	@publishedPartner
   956 	@prototype
   954 	@released
   957 	
   955 	
   958 	The match will be based on Uri details.
   956 	The match will be based on Uri details.
   959 	*/
   957 	*/
   960 	EMatchUri
   958 	EMatchUri
   961 	};
   959 	};
  1018 	*/
  1016 	*/
  1019 	IMPORT_C void SetMatchToUriL(const TDesC& aUri);
  1017 	IMPORT_C void SetMatchToUriL(const TDesC& aUri);
  1020 	
  1018 	
  1021 	/**
  1019 	/**
  1022 	@publishedPartner
  1020 	@publishedPartner
  1023 	@prototype
  1021 	@released
  1024 	
  1022 	
  1025 	Sets this object to match to uri scheme and file extension specified by a URI.
  1023 	Sets this object to match to uri scheme and file extension specified by a URI.
  1026 	
  1024 	
  1027 	The Uri scheme and extension are saved in iMatchReqData. Further,iMatchData contains uri extension, 
  1025 	The Uri scheme and extension are saved in iMatchReqData. Further,iMatchData contains uri extension, 
  1028 	iMatchUriScheme contains uri scheme.
  1026 	iMatchUriScheme contains uri scheme.
  1063 	*/
  1061 	*/
  1064 	IMPORT_C const TDesC8& MatchData() const;
  1062 	IMPORT_C const TDesC8& MatchData() const;
  1065 	
  1063 	
  1066 	/**
  1064 	/**
  1067 	@publishedPartner
  1065 	@publishedPartner
  1068 	@prototype
  1066 	@released
  1069 	
  1067 	
  1070 	Returns the uri scheme used to perform the plugin match.
  1068 	Returns the uri scheme used to perform the plugin match.
  1071 	
  1069 	
  1072 	@return The uri scheme.
  1070 	@return The uri scheme.
  1073 
  1071 
  1254 	*/
  1252 	*/
  1255 	virtual ~CMMFControllerSecureDrmPluginSelectionParameters() {};
  1253 	virtual ~CMMFControllerSecureDrmPluginSelectionParameters() {};
  1256 protected:
  1254 protected:
  1257 	CMMFControllerSecureDrmPluginSelectionParameters();
  1255 	CMMFControllerSecureDrmPluginSelectionParameters();
  1258 	};
  1256 	};
  1259 
       
  1260 class CMmfRecognizerUtil; // declared here.
       
  1261 /**
       
  1262 @internalAll
       
  1263 
       
  1264 MMF utility class used by MMF recognizer
       
  1265 Maintains an array of CMMFControllerImplementationInformation objects
       
  1266 so that data headers can be speedily matched against.
       
  1267 Updates the array when notified by ECOM of a change to the global
       
  1268 interface implementation registration data.
       
  1269 */
       
  1270 NONSHARABLE_CLASS( CMmfRecognizerUtil ): public CBase
       
  1271 	{
       
  1272 public:
       
  1273 	enum TMatchLevel
       
  1274 		{
       
  1275 		EMatchNone, //no match
       
  1276 		EMatchData, //data match only
       
  1277 		EMatchName  //suffix and data match
       
  1278 		};
       
  1279 public:
       
  1280 	IMPORT_C static void GetMimeTypesL(CDesC8Array* aMimeTypes);
       
  1281 
       
  1282 	IMPORT_C static CMmfRecognizerUtil* NewL();
       
  1283 
       
  1284 	~CMmfRecognizerUtil();
       
  1285 	IMPORT_C TMatchLevel GetMimeTypeL(const TDesC& aFileName, const TDesC8& aImageData, TDes8& aMimeType);
       
  1286 
       
  1287 private:
       
  1288 	CMmfRecognizerUtil();
       
  1289 	void ConstructL();
       
  1290 
       
  1291 private:
       
  1292 	class CBody;
       
  1293 	CBody* iBody;
       
  1294 	};
       
  1295 
       
  1296 
  1257 
  1297 /**
  1258 /**
  1298 @publishedAll
  1259 @publishedAll
  1299 @released
  1260 @released
  1300 
  1261