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