1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/src/Recognizer/RecMmf.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,95 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __MMF_CLIENT_RECOGNIZER_H__
1.20 +#define __MMF_CLIENT_RECOGNIZER_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +#include <apmrec.h>
1.24 +#include <apmstd.h>
1.25 +#include "mmfcontrollerpluginresolver.h"
1.26 +
1.27 +const int KRecMmfDllUidValue = 0x101f7c0c;
1.28 +
1.29 +typedef TBuf8<KMaxDataTypeLength> TMimeDataType;
1.30 +
1.31 +/**
1.32 + * @internalComponent
1.33 + *
1.34 + * Class owned by the CApaMmfRecognizer recognizer class.
1.35 + * maintains a list of MIME-types supported and
1.36 + * an instance of the CMmfRecognizerUtil class which contains
1.37 + * ECOM-derived information about the header data to match against.
1.38 + *
1.39 + */
1.40 +class CMmfRecognizer : public CBase
1.41 + {
1.42 +public:
1.43 + enum TMatchMethod
1.44 + {
1.45 + ENotMatched,
1.46 + EByName,
1.47 + EBySignature
1.48 + };
1.49 +public:
1.50 + static CMmfRecognizer* NewL();
1.51 + virtual ~CMmfRecognizer();
1.52 +
1.53 + void BuildListL();
1.54 +
1.55 + TMatchMethod MatchL(const TDesC& aFileName, const TDesC8& aBuffer);
1.56 +
1.57 + const TDesC8& MimeString() const;
1.58 +
1.59 + const TPtrC8 SupportedDataTypeL(TInt aIndex) const;
1.60 + TInt NumMimeTypes() const;
1.61 +
1.62 +private:
1.63 + CMmfRecognizer();
1.64 + void ConstructL();
1.65 +
1.66 +private:
1.67 + CDesC8Array* iMimeTypes; // owned
1.68 + TBuf8<KMaxDataTypeLength> iMimeString;
1.69 + CMmfRecognizerUtil* iMmfRecognizerUtil; // owned
1.70 + };
1.71 +
1.72 +/**
1.73 + * @internalAll
1.74 + *
1.75 + * Concrete implementation of the recognizer API
1.76 + * Used to recognize non-native files supported by the
1.77 + * Multimedia framework. e.g. .WAV files, .AU files etc
1.78 + */
1.79 +class CApaMmfRecognizer : public CApaDataRecognizerType
1.80 + {
1.81 +public:
1.82 + static CApaMmfRecognizer* NewL();
1.83 + ~CApaMmfRecognizer();
1.84 +
1.85 + TDataType SupportedDataTypeL(TInt aIndex) const;
1.86 + TUint PreferredBufSize();
1.87 + void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer);
1.88 +
1.89 +private:
1.90 + CApaMmfRecognizer();
1.91 + void ConstructL();
1.92 +
1.93 +private:
1.94 + CMmfRecognizer* iMmfRecognizer;
1.95 + };
1.96 +
1.97 +
1.98 +#endif