|
1 // Copyright (c) 2004-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 Display Library |
|
15 // framework and its custom resolver |
|
16 // Not for public use |
|
17 // |
|
18 // |
|
19 |
|
20 |
|
21 #ifndef __IMAGEDISPLAYRESOLVERAPI_H__ |
|
22 #define __IMAGEDISPLAYRESOLVERAPI_H__ |
|
23 |
|
24 #include <e32std.h> |
|
25 |
|
26 /** @file |
|
27 @internalComponent */ |
|
28 |
|
29 |
|
30 const TInt KImageHeaderSize = 32; // This is a compromise. The longest match string we have |
|
31 // yet found was 20 bytes (WMF Clp format) and we've left |
|
32 // some spare in case of longer future formats. But we want |
|
33 // to ensure that we don't exceed the possible minimum size |
|
34 // of a complete image. We don't have to worry about WBMP |
|
35 // and SMS OTA, two of the most compact formats, because |
|
36 // they don't have image headers so won't go through the |
|
37 // match string process. |
|
38 |
|
39 enum TResolverMatchType |
|
40 { |
|
41 EMatchString, // Resolver should match using plugin match strings |
|
42 EMatchUids, // Resolver should match on image type and sub-type Uids |
|
43 EMatchMIMEType, // Resolver should match on MIME type |
|
44 EMatchFileSuffix // Resolver should match using file extension |
|
45 }; |
|
46 |
|
47 // these flags provide a way of indicating to the resolver |
|
48 // what capabilites the plugin must support |
|
49 enum TPluginFlagsNeeded |
|
50 { |
|
51 ECanMatchByFileSuffix = 0x00000001, |
|
52 ESetSourceRectSupportNeeded = 0x00000002 |
|
53 }; |
|
54 /* |
|
55 * |
|
56 * Used to pass parameters from the Image Display Library to the resolver |
|
57 * |
|
58 * Controls the identification, (resolution), of which implementation will be |
|
59 * used to satisfy an interface implementation instantiation. It is filled in |
|
60 * and then packaged up in a descriptor to be passed across to the custom |
|
61 * resolver in <code>TEComResolverParams</code>. |
|
62 * |
|
63 * @since 8.0 |
|
64 * @lib "ImageDisplay.lib" |
|
65 */ |
|
66 class CCustomMatchData : public CBase |
|
67 { |
|
68 // public methods |
|
69 public: |
|
70 ~CCustomMatchData(); |
|
71 static CCustomMatchData* NewL(); |
|
72 static CCustomMatchData* NewL(const TDesC8& aPackage); |
|
73 static CCustomMatchData* NewLC(); |
|
74 static CCustomMatchData* NewLC(const TDesC8& aPackage); |
|
75 void ConstructL(const TDesC8& aPackage); |
|
76 void ExternalizeL(RWriteStream& aStream) const; |
|
77 void InternalizeL(RReadStream& aStream); |
|
78 void SetMatchStringL(const TDesC8& aMIMEType); |
|
79 void SetTypes(const TResolverMatchType& aMatchType, const TUid& aBaseType, const TUid& aSubType); |
|
80 void SetMatchType(const TResolverMatchType& aMatchType); |
|
81 void SetPluginFlagsNeeded(const TPluginFlagsNeeded& aPluginFlags); |
|
82 void SetBaseType(const TUid& aBaseType); |
|
83 void SetSubType(const TUid& aSubType); |
|
84 void SetImplementationType(const TUid& aImplementationType); |
|
85 void SetFileSuffixL(const TDesC& aFileSuffix); |
|
86 TResolverMatchType MatchType() const; |
|
87 TPluginFlagsNeeded PluginFlagsNeeded() const; |
|
88 TUid BaseType() const; |
|
89 TUid SubType() const; |
|
90 TUid ImplementationType() const; |
|
91 const TPtrC8 MatchString() const; |
|
92 const TPtrC FileSuffix() const; |
|
93 void GetTypes(TResolverMatchType& aMatchType, TUid& aBaseType, TUid& aSubType) const; |
|
94 HBufC8* NewPackLC() const; |
|
95 void UnPackL(const TDesC8& aPackage); |
|
96 |
|
97 // private methods |
|
98 private: |
|
99 CCustomMatchData(); |
|
100 |
|
101 // private data |
|
102 private: |
|
103 TResolverMatchType iMatchType; |
|
104 TPluginFlagsNeeded iPluginFlagsNeeded; |
|
105 TUid iBaseType; |
|
106 TUid iSubType; |
|
107 TUid iImplementationType; |
|
108 HBufC8* iMatchString; |
|
109 HBufC* iFileSuffix; |
|
110 }; |
|
111 |
|
112 #endif // __IMAGEDISPLAYRESOLVERAPI_H__ |