sl@0: // Copyright (c) 2003-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: // sl@0: sl@0: #ifndef __MMF_CLIENT_RECOGNIZER_H__ sl@0: #define __MMF_CLIENT_RECOGNIZER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "mmfcontrollerpluginresolver.h" sl@0: sl@0: const int KRecMmfDllUidValue = 0x101f7c0c; sl@0: sl@0: typedef TBuf8 TMimeDataType; sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * sl@0: * Class owned by the CApaMmfRecognizer recognizer class. sl@0: * maintains a list of MIME-types supported and sl@0: * an instance of the CMmfRecognizerUtil class which contains sl@0: * ECOM-derived information about the header data to match against. sl@0: * sl@0: */ sl@0: class CMmfRecognizer : public CBase sl@0: { sl@0: public: sl@0: enum TMatchMethod sl@0: { sl@0: ENotMatched, sl@0: EByName, sl@0: EBySignature sl@0: }; sl@0: public: sl@0: static CMmfRecognizer* NewL(); sl@0: virtual ~CMmfRecognizer(); sl@0: sl@0: void BuildListL(); sl@0: sl@0: TMatchMethod MatchL(const TDesC& aFileName, const TDesC8& aBuffer); sl@0: sl@0: const TDesC8& MimeString() const; sl@0: sl@0: const TPtrC8 SupportedDataTypeL(TInt aIndex) const; sl@0: TInt NumMimeTypes() const; sl@0: sl@0: private: sl@0: CMmfRecognizer(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: CDesC8Array* iMimeTypes; // owned sl@0: TBuf8 iMimeString; sl@0: CMmfRecognizerUtil* iMmfRecognizerUtil; // owned sl@0: }; sl@0: sl@0: /** sl@0: * @internalAll sl@0: * sl@0: * Concrete implementation of the recognizer API sl@0: * Used to recognize non-native files supported by the sl@0: * Multimedia framework. e.g. .WAV files, .AU files etc sl@0: */ sl@0: class CApaMmfRecognizer : public CApaDataRecognizerType sl@0: { sl@0: public: sl@0: static CApaMmfRecognizer* NewL(); sl@0: ~CApaMmfRecognizer(); sl@0: sl@0: TDataType SupportedDataTypeL(TInt aIndex) const; sl@0: TUint PreferredBufSize(); sl@0: void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer); sl@0: sl@0: private: sl@0: CApaMmfRecognizer(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: CMmfRecognizer* iMmfRecognizer; sl@0: }; sl@0: sl@0: sl@0: #endif