|
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 __ICL_CLIENT_RECOGNIZER_H__ |
|
17 #define __ICL_CLIENT_RECOGNIZER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <apmrec.h> |
|
21 #include <apmstd.h> |
|
22 |
|
23 #include <imageconversion.h> |
|
24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
25 #include <iclrecognizerutil.h> |
|
26 #endif |
|
27 |
|
28 const int KRecIclDllUidValue = 0x101f7c0b; |
|
29 |
|
30 class CImgDisplayMimeTypeRecognizer; |
|
31 |
|
32 /** |
|
33 * @internalComponent |
|
34 * |
|
35 * Class owned by the CApaIclRecognizer recognizer class. |
|
36 * maintains a list of MIME-types supported and |
|
37 * an instance of the CIclRecognizerUtil class which contains |
|
38 * ECOM-derived information about the header data to match against. |
|
39 * Both the ImageDecoder and ImageDisplay plug-ins are used to determine |
|
40 * Mime type. ImageDecoder plug-ins are used first. |
|
41 * |
|
42 */ |
|
43 class CIclRecognizer : public CBase |
|
44 { |
|
45 public: |
|
46 enum TMatchMethod |
|
47 { |
|
48 ENotMatched, |
|
49 EByName, |
|
50 EBySignature |
|
51 }; |
|
52 public: |
|
53 static CIclRecognizer* NewL(); |
|
54 virtual ~CIclRecognizer(); |
|
55 |
|
56 void BuildListL(); |
|
57 |
|
58 TMatchMethod MatchL(const TDesC8& aBuffer, const TDesC& aFileName); |
|
59 |
|
60 const TDesC8& MimeString() const; |
|
61 |
|
62 const TDesC8& SupportedDataTypeL(TInt aIndex) const; |
|
63 TInt NumMimeTypes() const; |
|
64 |
|
65 private: |
|
66 CIclRecognizer(); |
|
67 void ConstructL(); |
|
68 |
|
69 private: |
|
70 RFileExtensionMIMETypeArray iFileExtensionMIMETypeArray; |
|
71 TBuf8<KMaxDataTypeLength> iMimeString; |
|
72 CIclRecognizerUtil* iIclRecognizerUtil; // owned |
|
73 CImgDisplayMimeTypeRecognizer* iImgDisplayRecognizer; |
|
74 }; |
|
75 |
|
76 /** |
|
77 * @internalAll |
|
78 * |
|
79 * Concrete implementation of the recognizer API |
|
80 * Used to recognize non-native files supported by the |
|
81 * Image conversion library. e.g .BMP files etc. |
|
82 */ |
|
83 class CApaIclRecognizer : public CApaDataRecognizerType |
|
84 { |
|
85 public: |
|
86 static CApaIclRecognizer* NewL(); |
|
87 ~CApaIclRecognizer(); |
|
88 |
|
89 TDataType SupportedDataTypeL(TInt aIndex) const; |
|
90 TUint PreferredBufSize(); |
|
91 void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer); |
|
92 |
|
93 private: |
|
94 CApaIclRecognizer(); |
|
95 void ConstructL(); |
|
96 |
|
97 private: |
|
98 CIclRecognizer* iIclRecognizer; |
|
99 }; |
|
100 |
|
101 |
|
102 #endif |