epoc32/include/icl/imagetransformplugin.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/icl/imagetransformplugin.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/icl/imagetransformplugin.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,123 @@
     1.4 -imagetransformplugin.h
     1.5 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// 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
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +// This is the plugin API for the Image Transform framework
    1.19 +// 
    1.20 +//
    1.21 +/**
    1.22 + @file
    1.23 + @publishedAll
    1.24 + @released
    1.25 +*/
    1.26 +
    1.27 +#ifndef __IMAGETRANSFORMPLUGIN_H__
    1.28 +#define __IMAGETRANSFORMPLUGIN_H__
    1.29 +
    1.30 +#include <e32base.h>
    1.31 +#include <imagetransform.h>
    1.32 +
    1.33 +// fwd ref
    1.34 +class CImageTransformFramework;
    1.35 +class CImageTransformPluginExtension;
    1.36 +
    1.37 +/**
    1.38 +This is the plugin API for the Image Transform framework
    1.39 +Intended for use by plugin writers only.
    1.40 +
    1.41 +@publishedAll
    1.42 +@released
    1.43 +*/
    1.44 +class CImageTransformPlugin : public CBase
    1.45 +	{
    1.46 +	friend class CImageTransformFramework;
    1.47 +
    1.48 +public:
    1.49 +	IMPORT_C ~CImageTransformPlugin();
    1.50 +
    1.51 +protected:
    1.52 +	/**
    1.53 +	Initialise the plugin and check the image transform settings.
    1.54 +
    1.55 +	This is called by the ImageTransform framework when the client app calls
    1.56 +	CImageTransform::SetupL(). 
    1.57 +	
    1.58 +	The plugin should check the validity of the source image and all other settings
    1.59 +	set by the client API. If any of these is unsupported then it should leave with 
    1.60 +	KErrNotSupported.
    1.61 +
    1.62 +	A plugin implementing CImageTransformPluginExtension to allow extension of the 
    1.63 +	client API should initialise it here.
    1.64 +
    1.65 +	This is a virtual function that each individual plugin must implement.
    1.66 +
    1.67 +	@leave  KErrUnsupported
    1.68 +	The plugin decoder doesn not support the request transformation
    1.69 +	*/
    1.70 +	virtual void OpenL() = 0;
    1.71 +
    1.72 +	/**
    1.73 +	Initiate the image transform operation
    1.74 +
    1.75 +	This is a virtual function that each individual plugin must implement.
    1.76 +
    1.77 +	@param  aStatus
    1.78 +			The client's request status. 
    1.79 +			On completion contains an error code.
    1.80 +			KErrNone if image was transformed successfully,
    1.81 +	*/
    1.82 +	virtual void Transform(TRequestStatus& aStatus) = 0;
    1.83 +
    1.84 +	/**
    1.85 +	Cancel the image transform operation
    1.86 +	May be called by the framework even when there is no outstanding request.
    1.87 +
    1.88 +	This is a virtual function that each individual plugin must implement.
    1.89 +	*/
    1.90 +	virtual void CancelTransform() = 0;
    1.91 +
    1.92 +	IMPORT_C CImageTransformPlugin();
    1.93 +
    1.94 +	// getters
    1.95 +	IMPORT_C TBool SourceIsFilename() const;
    1.96 +	IMPORT_C TBool SourceIsData() const;
    1.97 +	IMPORT_C const TDesC& SourceFilename() const;
    1.98 +	IMPORT_C const TDesC8& SourceData() const;
    1.99 +	IMPORT_C const TDesC8& SourceMimeType() const;
   1.100 +	IMPORT_C const TUid SourceImageType() const;
   1.101 +	IMPORT_C const TUid SourceImageSubType() const;
   1.102 +	IMPORT_C TBool SourceRect(TRect& aRect) const;
   1.103 +	IMPORT_C TBool DestIsFilename() const;
   1.104 +	IMPORT_C TBool DestIsData() const;
   1.105 +	IMPORT_C const TDesC& DestFilename() const;
   1.106 +	IMPORT_C HBufC8*& DestData() const;
   1.107 +	IMPORT_C const TSize& DestinationSizeInPixels() const;
   1.108 +	IMPORT_C TUint Options() const;
   1.109 +	IMPORT_C TBool MaintainAspectRatio() const;
   1.110 +	IMPORT_C TBool PreserveImageData() const;
   1.111 +	IMPORT_C virtual CImageTransformPluginExtension* Extension() const;
   1.112 +
   1.113 +private:
   1.114 +	IMPORT_C static CImageTransformPlugin* NewL(
   1.115 +		TUid aImplementationUid, CImageTransformFramework& aFramework);
   1.116 +
   1.117 +	// Future proofing
   1.118 +	IMPORT_C virtual void ReservedVirtual1();
   1.119 +	IMPORT_C virtual void ReservedVirtual2();
   1.120 +	IMPORT_C virtual void ReservedVirtual3();
   1.121 +	IMPORT_C virtual void ReservedVirtual4();
   1.122 +
   1.123 +private:
   1.124 +	CImageTransformFramework* iFramework;
   1.125 +	};
   1.126 +
   1.127 +#endif // __IMAGETRANSFORMPLUGIN_H__