1 imagetransformplugin.h |
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This is the plugin API for the Image Transform framework |
|
15 // |
|
16 // |
|
17 /** |
|
18 @file |
|
19 @publishedAll |
|
20 @released |
|
21 */ |
|
22 |
|
23 #ifndef __IMAGETRANSFORMPLUGIN_H__ |
|
24 #define __IMAGETRANSFORMPLUGIN_H__ |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <imagetransform.h> |
|
28 |
|
29 // fwd ref |
|
30 class CImageTransformFramework; |
|
31 class CImageTransformPluginExtension; |
|
32 |
|
33 /** |
|
34 This is the plugin API for the Image Transform framework |
|
35 Intended for use by plugin writers only. |
|
36 |
|
37 @publishedAll |
|
38 @released |
|
39 */ |
|
40 class CImageTransformPlugin : public CBase |
|
41 { |
|
42 friend class CImageTransformFramework; |
|
43 |
|
44 public: |
|
45 IMPORT_C ~CImageTransformPlugin(); |
|
46 |
|
47 protected: |
|
48 /** |
|
49 Initialise the plugin and check the image transform settings. |
|
50 |
|
51 This is called by the ImageTransform framework when the client app calls |
|
52 CImageTransform::SetupL(). |
|
53 |
|
54 The plugin should check the validity of the source image and all other settings |
|
55 set by the client API. If any of these is unsupported then it should leave with |
|
56 KErrNotSupported. |
|
57 |
|
58 A plugin implementing CImageTransformPluginExtension to allow extension of the |
|
59 client API should initialise it here. |
|
60 |
|
61 This is a virtual function that each individual plugin must implement. |
|
62 |
|
63 @leave KErrUnsupported |
|
64 The plugin decoder doesn not support the request transformation |
|
65 */ |
|
66 virtual void OpenL() = 0; |
|
67 |
|
68 /** |
|
69 Initiate the image transform operation |
|
70 |
|
71 This is a virtual function that each individual plugin must implement. |
|
72 |
|
73 @param aStatus |
|
74 The client's request status. |
|
75 On completion contains an error code. |
|
76 KErrNone if image was transformed successfully, |
|
77 */ |
|
78 virtual void Transform(TRequestStatus& aStatus) = 0; |
|
79 |
|
80 /** |
|
81 Cancel the image transform operation |
|
82 May be called by the framework even when there is no outstanding request. |
|
83 |
|
84 This is a virtual function that each individual plugin must implement. |
|
85 */ |
|
86 virtual void CancelTransform() = 0; |
|
87 |
|
88 IMPORT_C CImageTransformPlugin(); |
|
89 |
|
90 // getters |
|
91 IMPORT_C TBool SourceIsFilename() const; |
|
92 IMPORT_C TBool SourceIsData() const; |
|
93 IMPORT_C const TDesC& SourceFilename() const; |
|
94 IMPORT_C const TDesC8& SourceData() const; |
|
95 IMPORT_C const TDesC8& SourceMimeType() const; |
|
96 IMPORT_C const TUid SourceImageType() const; |
|
97 IMPORT_C const TUid SourceImageSubType() const; |
|
98 IMPORT_C TBool SourceRect(TRect& aRect) const; |
|
99 IMPORT_C TBool DestIsFilename() const; |
|
100 IMPORT_C TBool DestIsData() const; |
|
101 IMPORT_C const TDesC& DestFilename() const; |
|
102 IMPORT_C HBufC8*& DestData() const; |
|
103 IMPORT_C const TSize& DestinationSizeInPixels() const; |
|
104 IMPORT_C TUint Options() const; |
|
105 IMPORT_C TBool MaintainAspectRatio() const; |
|
106 IMPORT_C TBool PreserveImageData() const; |
|
107 IMPORT_C virtual CImageTransformPluginExtension* Extension() const; |
|
108 |
|
109 private: |
|
110 IMPORT_C static CImageTransformPlugin* NewL( |
|
111 TUid aImplementationUid, CImageTransformFramework& aFramework); |
|
112 |
|
113 // Future proofing |
|
114 IMPORT_C virtual void ReservedVirtual1(); |
|
115 IMPORT_C virtual void ReservedVirtual2(); |
|
116 IMPORT_C virtual void ReservedVirtual3(); |
|
117 IMPORT_C virtual void ReservedVirtual4(); |
|
118 |
|
119 private: |
|
120 CImageTransformFramework* iFramework; |
|
121 }; |
|
122 |
|
123 #endif // __IMAGETRANSFORMPLUGIN_H__ |