epoc32/include/icl/imagetransformplugin.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 is the plugin API for the Image Transform framework
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @publishedAll
    21  @released
    22 */
    23 
    24 #ifndef __IMAGETRANSFORMPLUGIN_H__
    25 #define __IMAGETRANSFORMPLUGIN_H__
    26 
    27 #include <e32base.h>
    28 #include <imagetransform.h>
    29 
    30 // fwd ref
    31 class CImageTransformFramework;
    32 class CImageTransformPluginExtension;
    33 
    34 /**
    35 This is the plugin API for the Image Transform framework
    36 Intended for use by plugin writers only.
    37 
    38 @publishedAll
    39 @released
    40 */
    41 class CImageTransformPlugin : public CBase
    42 	{
    43 	friend class CImageTransformFramework;
    44 
    45 public:
    46 	IMPORT_C ~CImageTransformPlugin();
    47 
    48 protected:
    49 	/**
    50 	Initialise the plugin and check the image transform settings.
    51 
    52 	This is called by the ImageTransform framework when the client app calls
    53 	CImageTransform::SetupL(). 
    54 	
    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 
    57 	KErrNotSupported.
    58 
    59 	A plugin implementing CImageTransformPluginExtension to allow extension of the 
    60 	client API should initialise it here.
    61 
    62 	This is a virtual function that each individual plugin must implement.
    63 
    64 	@leave  KErrUnsupported
    65 	The plugin decoder doesn not support the request transformation
    66 	*/
    67 	virtual void OpenL() = 0;
    68 
    69 	/**
    70 	Initiate the image transform operation
    71 
    72 	This is a virtual function that each individual plugin must implement.
    73 
    74 	@param  aStatus
    75 			The client's request status. 
    76 			On completion contains an error code.
    77 			KErrNone if image was transformed successfully,
    78 	*/
    79 	virtual void Transform(TRequestStatus& aStatus) = 0;
    80 
    81 	/**
    82 	Cancel the image transform operation
    83 	May be called by the framework even when there is no outstanding request.
    84 
    85 	This is a virtual function that each individual plugin must implement.
    86 	*/
    87 	virtual void CancelTransform() = 0;
    88 
    89 	IMPORT_C CImageTransformPlugin();
    90 
    91 	// getters
    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;
   109 
   110 private:
   111 	IMPORT_C static CImageTransformPlugin* NewL(
   112 		TUid aImplementationUid, CImageTransformFramework& aFramework);
   113 
   114 	// Future proofing
   115 	IMPORT_C virtual void ReservedVirtual1();
   116 	IMPORT_C virtual void ReservedVirtual2();
   117 	IMPORT_C virtual void ReservedVirtual3();
   118 public:
   119 	IMPORT_C virtual CImageTransformPluginExtension* Extension(TUid aExtensionUid, TInt& aError) const;
   120 
   121 private:
   122 	CImageTransformFramework* iFramework;
   123 	};
   124 
   125 #endif // __IMAGETRANSFORMPLUGIN_H__
   126