|
1 // Copyright (c) 2001-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 // This defines the interface classes between the Image Conversion Library |
|
15 // framework and its custom resolver |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef __IMAGERESOLVERAPI_H__ |
|
20 #define __IMAGERESOLVERAPI_H__ |
|
21 |
|
22 // ****************** |
|
23 // Not for public use |
|
24 // ****************** |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <imageconversion.h> |
|
28 |
|
29 const TInt KImageHeaderSize = 32; // This is a compromise. The longest match string we have |
|
30 // yet found was 20 bytes (WMF Clp format) and we've left |
|
31 // some spare in case of longer future formats. But we want |
|
32 // to ensure that we don't exceed the possible minimum size |
|
33 // of a complete image. We don't have to worry about WBMP |
|
34 // and SMS OTA, two of the most compact formats, because |
|
35 // they don't have image headers so won't go through the |
|
36 // match string process. |
|
37 |
|
38 const TInt KIclExtensionOptionsMask = 0x0000ff00; // only 9th -> 16th bits are valid |
|
39 |
|
40 enum TResolverMatchType |
|
41 { |
|
42 EMatchString, // Resolver should match using plugin match strings |
|
43 EMatchUids, // Resolver should match on image type and sub-type Uids |
|
44 EMatchMIMEType, // Resolver should match on MIME type |
|
45 EListImageTypes, // Resolver should return list of image base types or the sub-types of a particular base type |
|
46 EListFileTypes, // Resolver should return list of file extensions and MIME types |
|
47 EMatchFileSuffix, // Resolver should match using file extension |
|
48 EMatchReqUids // Resolver should match using properties and UIDs |
|
49 }; |
|
50 |
|
51 class CCustomMatchData; // declared here |
|
52 /* |
|
53 * |
|
54 * Used to pass parameters from the Image Conversion Library to the resolver |
|
55 * |
|
56 * Controls the identification, (resolution), of which implementation will be |
|
57 * used to satisfy an interface implementation instantiation. It is filled in |
|
58 * and then packaged up in a descriptor to be passed across to the custom |
|
59 * resolver in <code>TEComResolverParams</code>. |
|
60 * |
|
61 * @since 8.0 |
|
62 */ |
|
63 NONSHARABLE_CLASS( CCustomMatchData ): public CBase |
|
64 { |
|
65 // public methods |
|
66 public: |
|
67 ~CCustomMatchData(); |
|
68 static CCustomMatchData* NewL(); |
|
69 static CCustomMatchData* NewL(const TDesC8& aPackage); |
|
70 static CCustomMatchData* NewLC(); |
|
71 static CCustomMatchData* NewLC(const TDesC8& aPackage); |
|
72 void ConstructL(const TDesC8& aPackage); |
|
73 void ExternalizeL(RWriteStream& aStream) const; |
|
74 void InternalizeL(RReadStream& aStream); |
|
75 void SetMatchStringL(const TDesC8& aMIMEType); |
|
76 void SetTypes(const TResolverMatchType& aMatchType, const TUid& aBaseType, const TUid& aSubType); |
|
77 void SetMatchType(const TResolverMatchType& aMatchType); |
|
78 void SetBaseType(const TUid& aBaseType); |
|
79 void SetSubType(const TUid& aSubType); |
|
80 void SetImplementationType(const TUid& aImplementationType); |
|
81 void SetFileSuffixL(const TDesC& aFileSuffix); |
|
82 TResolverMatchType MatchType() const; |
|
83 TUid BaseType() const; |
|
84 TUid SubType() const; |
|
85 TUid ImplementationType() const; |
|
86 const TPtrC8 MatchString() const; |
|
87 const TPtrC FileSuffix() const; |
|
88 void GetTypes(TResolverMatchType& aMatchType, TUid& aBaseType, TUid& aSubType) const; |
|
89 HBufC8* NewPackLC() const; |
|
90 void UnPackL(const TDesC8& aPackage); |
|
91 void SetMatchReqUidsL(const RUidDataArray& aMatchReqUidsArray); |
|
92 void GetMatchReqUidsL(RUidDataArray& aMatchReqUidsArray); |
|
93 void GetOptionsUidsL(RUidDataArray& aOptionsUidsArray); |
|
94 void SetExtensionOptions(TUint aExtensionBits); |
|
95 void SetOptions(CImageDecoder::TOptions aOptions); |
|
96 TUint ExtensionOptions(); |
|
97 TUint Options(); |
|
98 |
|
99 // private methods |
|
100 private: |
|
101 CCustomMatchData(); |
|
102 |
|
103 // private data |
|
104 private: |
|
105 TResolverMatchType iMatchType; |
|
106 TUid iBaseType; |
|
107 TUid iSubType; |
|
108 TUid iImplementationType; |
|
109 HBufC8* iMatchString; |
|
110 HBufC* iFileSuffix; |
|
111 RUidDataArray iMatchReqUidsArray; |
|
112 TUint iExtensionOptions; |
|
113 RUidDataArray iOptionsUidsArray; |
|
114 TUint iOptions; |
|
115 }; |
|
116 |
|
117 #endif // __IMAGERESOLVERAPI_H__ |