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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This is the plugin API for the Image Transform framework
24 #ifndef __IMAGETRANSFORMPLUGIN_H__
25 #define __IMAGETRANSFORMPLUGIN_H__
28 #include <imagetransform.h>
31 class CImageTransformFramework;
32 class CImageTransformPluginExtension;
35 This is the plugin API for the Image Transform framework
36 Intended for use by plugin writers only.
41 class CImageTransformPlugin : public CBase
43 friend class CImageTransformFramework;
46 IMPORT_C ~CImageTransformPlugin();
50 Initialise the plugin and check the image transform settings.
52 This is called by the ImageTransform framework when the client app calls
53 CImageTransform::SetupL().
55 The plugin should check the validity of the source image and all other settings
56 set by the client API. If any of these is unsupported then it should leave with
59 A plugin implementing CImageTransformPluginExtension to allow extension of the
60 client API should initialise it here.
62 This is a virtual function that each individual plugin must implement.
64 @leave KErrUnsupported
65 The plugin decoder doesn not support the request transformation
67 virtual void OpenL() = 0;
70 Initiate the image transform operation
72 This is a virtual function that each individual plugin must implement.
75 The client's request status.
76 On completion contains an error code.
77 KErrNone if image was transformed successfully,
79 virtual void Transform(TRequestStatus& aStatus) = 0;
82 Cancel the image transform operation
83 May be called by the framework even when there is no outstanding request.
85 This is a virtual function that each individual plugin must implement.
87 virtual void CancelTransform() = 0;
89 IMPORT_C CImageTransformPlugin();
92 IMPORT_C TBool SourceIsFilename() const;
93 IMPORT_C TBool SourceIsData() const;
94 IMPORT_C const TDesC& SourceFilename() const;
95 IMPORT_C const TDesC8& SourceData() const;
96 IMPORT_C const TDesC8& SourceMimeType() const;
97 IMPORT_C const TUid SourceImageType() const;
98 IMPORT_C const TUid SourceImageSubType() const;
99 IMPORT_C TBool SourceRect(TRect& aRect) const;
100 IMPORT_C TBool DestIsFilename() const;
101 IMPORT_C TBool DestIsData() const;
102 IMPORT_C const TDesC& DestFilename() const;
103 IMPORT_C HBufC8*& DestData() const;
104 IMPORT_C const TSize& DestinationSizeInPixels() const;
105 IMPORT_C TUint Options() const;
106 IMPORT_C TBool MaintainAspectRatio() const;
107 IMPORT_C TBool PreserveImageData() const;
108 IMPORT_C virtual CImageTransformPluginExtension* Extension() const;
111 IMPORT_C static CImageTransformPlugin* NewL(
112 TUid aImplementationUid, CImageTransformFramework& aFramework);
115 IMPORT_C virtual void ReservedVirtual1();
116 IMPORT_C virtual void ReservedVirtual2();
117 IMPORT_C virtual void ReservedVirtual3();
119 IMPORT_C virtual CImageTransformPluginExtension* Extension(TUid aExtensionUid, TInt& aError) const;
122 CImageTransformFramework* iFramework;
125 #endif // __IMAGETRANSFORMPLUGIN_H__