os/mm/mmlibs/mmfw/src/Recognizer/RecMmf.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __MMF_CLIENT_RECOGNIZER_H__
    17 #define __MMF_CLIENT_RECOGNIZER_H__
    18 
    19 #include <e32base.h>
    20 #include <apmrec.h>
    21 #include <apmstd.h>
    22 #include "mmfcontrollerpluginresolver.h"
    23 
    24 const int KRecMmfDllUidValue = 0x101f7c0c;
    25 
    26 typedef	TBuf8<KMaxDataTypeLength> TMimeDataType;
    27 
    28 /**
    29  * @internalComponent
    30  *
    31  * Class owned by the CApaMmfRecognizer recognizer class.
    32  * maintains a list of MIME-types supported and
    33  * an instance of the CMmfRecognizerUtil class which contains
    34  * ECOM-derived information about the header data to match against.
    35  * 
    36  */
    37 class CMmfRecognizer : public CBase
    38 	{
    39 public:
    40 	enum TMatchMethod
    41 		{
    42 		ENotMatched,
    43 		EByName,
    44 		EBySignature
    45 		};
    46 public:
    47 	static CMmfRecognizer* NewL();
    48 	virtual ~CMmfRecognizer();
    49 
    50 	void BuildListL();
    51 
    52 	TMatchMethod MatchL(const TDesC& aFileName, const TDesC8& aBuffer);
    53 	
    54 	const TDesC8& MimeString() const;
    55 
    56 	const TPtrC8 SupportedDataTypeL(TInt aIndex) const;
    57 	TInt NumMimeTypes() const;
    58 
    59 private:
    60 	CMmfRecognizer();
    61 	void ConstructL();
    62 
    63 private:
    64 	CDesC8Array* iMimeTypes;				// owned
    65 	TBuf8<KMaxDataTypeLength> iMimeString;
    66 	CMmfRecognizerUtil* iMmfRecognizerUtil;	// owned 
    67 	};
    68 
    69 /**
    70  * @internalAll
    71  *
    72  * Concrete implementation of the recognizer API
    73  * Used to recognize non-native files supported by the
    74  * Multimedia framework. e.g. .WAV files, .AU files etc
    75  */
    76 class CApaMmfRecognizer : public CApaDataRecognizerType 
    77 	{
    78 public: 
    79 	static CApaMmfRecognizer* NewL();	
    80 	~CApaMmfRecognizer();
    81 
    82 	TDataType SupportedDataTypeL(TInt aIndex) const;
    83 	TUint PreferredBufSize();	
    84 	void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
    85 
    86 private: 
    87 	CApaMmfRecognizer();
    88 	void ConstructL();
    89 
    90 private:
    91 	CMmfRecognizer* iMmfRecognizer;
    92 	};
    93 
    94 
    95 #endif