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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This is the plugin API for the Image Transform framework
23 #ifndef __IMAGETRANSFORMPLUGIN_H__
24 #define __IMAGETRANSFORMPLUGIN_H__
27 #include <imagetransform.h>
30 class CImageTransformFramework;
31 class CImageTransformPluginExtension;
34 This is the plugin API for the Image Transform framework
35 Intended for use by plugin writers only.
40 class CImageTransformPlugin : public CBase
42 friend class CImageTransformFramework;
45 IMPORT_C ~CImageTransformPlugin();
49 Initialise the plugin and check the image transform settings.
51 This is called by the ImageTransform framework when the client app calls
52 CImageTransform::SetupL().
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
58 A plugin implementing CImageTransformPluginExtension to allow extension of the
59 client API should initialise it here.
61 This is a virtual function that each individual plugin must implement.
63 @leave KErrUnsupported
64 The plugin decoder doesn not support the request transformation
66 virtual void OpenL() = 0;
69 Initiate the image transform operation
71 This is a virtual function that each individual plugin must implement.
74 The client's request status.
75 On completion contains an error code.
76 KErrNone if image was transformed successfully,
78 virtual void Transform(TRequestStatus& aStatus) = 0;
81 Cancel the image transform operation
82 May be called by the framework even when there is no outstanding request.
84 This is a virtual function that each individual plugin must implement.
86 virtual void CancelTransform() = 0;
88 IMPORT_C CImageTransformPlugin();
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;
110 IMPORT_C static CImageTransformPlugin* NewL(
111 TUid aImplementationUid, CImageTransformFramework& aFramework);
114 IMPORT_C virtual void ReservedVirtual1();
115 IMPORT_C virtual void ReservedVirtual2();
116 IMPORT_C virtual void ReservedVirtual3();
117 IMPORT_C virtual void ReservedVirtual4();
120 CImageTransformFramework* iFramework;
123 #endif // __IMAGETRANSFORMPLUGIN_H__