epoc32/include/imagetransform.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 // This is the public client API for the Image Transform Library
    14 // This is the public client API for the Image Transform Library
    15 // 
    15 // 
    16 //
    16 //
       
    17 
    17 /**
    18 /**
    18  @file
    19  @file
    19  @publishedAll
    20  @publishedAll
    20  @released
    21  @released
    21 */
    22 */
    23 #ifndef __IMAGETRANSFORM_H__
    24 #ifndef __IMAGETRANSFORM_H__
    24 #define __IMAGETRANSFORM_H__
    25 #define __IMAGETRANSFORM_H__
    25 
    26 
    26 #include <e32base.h>
    27 #include <e32base.h>
    27 #include <fbs.h>
    28 #include <fbs.h>
    28 
       
    29 // fwd refs
    29 // fwd refs
    30 class CImageTransformFramework;	//fwd ref
    30 class CImageTransformFramework;	//fwd ref
    31 class CImageTransformPluginExtension;
    31 class CImageTransformPluginExtension;
    32 
    32 
       
    33 	
    33 /**
    34 /**
    34 The public API for clients to call the Image Transform (scaling) library.
    35 The public API for clients to call the Image Transform (scaling) library.
    35 This class provides functions to scale images held in files or descriptors.
    36 This class provides functions to scale images held in files or descriptors.
    36 
    37 
    37 @publishedAll
    38 @publishedAll
    61 		/**
    62 		/**
    62 		TOptions should not be set greater than or equal to this value.
    63 		TOptions should not be set greater than or equal to this value.
    63 		*/
    64 		*/
    64 		EEnumBoundary = 0x04
    65 		EEnumBoundary = 0x04
    65 		};
    66 		};
    66 
    67 	/**
       
    68 	Flags to specify the desired transformations. 
       
    69 	If no flag or "EScale" flag is set then the framework will look for the plugins 
       
    70 	supporting scaling which includes all the plugins supporting 
       
    71 	version-1 opaque data and the plugins supporting version-2 opaque 
       
    72 	data with the scaling flag set.
       
    73 	A plug-in supporting Squeeze, Orientation and Overlay in a single transform
       
    74 	must perform these transformation in the order: Overlaying, Orientation and then
       
    75 	Squeezing
       
    76 	*/
       
    77 	enum TTransformations
       
    78 		{
       
    79 		/** 
       
    80 		No transformation set
       
    81 		*/
       
    82 		ETransformationNone = 0x00,
       
    83 		/**
       
    84 		If set, the image is scaled based on the parameter passed in SetDestSizeInPixelsL(). 
       
    85 		*/
       
    86 		EScale = 0x01,
       
    87 		/**
       
    88 		If set, the image is clipped based on the parameter passed in SetSourceRect(). 
       
    89 		*/
       
    90 		ECrop = 0x02,
       
    91 		/**
       
    92 		If set, the image is squeezed
       
    93 		*/			
       
    94 		ESqueeze = 0x04,
       
    95 		/**
       
    96 		If set, the image is oriented 
       
    97 		*/			
       
    98 		EOrientation = 0x08,
       
    99 		/**
       
   100 		If set, the image is blend with the overlay image
       
   101 		*/
       
   102 		EOverlay = 0x10,
       
   103 		/**
       
   104 		If set, the plugin having exif extension is looked for
       
   105 		*/
       
   106 		EExif = 0x20,
       
   107 		/**
       
   108 		TTransformations should not be set greater than or equal to this value 
       
   109 		*/
       
   110 		ETransformEnumBoundary = 0x40
       
   111 		};
    67 public:
   112 public:
    68 	IMPORT_C static CImageTransform* NewL(RFs& aFs);
   113 	IMPORT_C static CImageTransform* NewL(RFs& aFs);
    69 	IMPORT_C ~CImageTransform();
   114 	IMPORT_C ~CImageTransform();
    70 	IMPORT_C void SetPluginUidL(TUid aPluginUid);
   115 	IMPORT_C void SetPluginUidL(TUid aPluginUid);
    71 	IMPORT_C void SetSourceFilenameL(const TDesC& aFilename);
   116 	IMPORT_C void SetSourceFilenameL(const TDesC& aFilename);
    76 	IMPORT_C void ClearSourceRect();
   121 	IMPORT_C void ClearSourceRect();
    77 
   122 
    78 	IMPORT_C void SetDestFilenameL(const TDesC& aFilename);
   123 	IMPORT_C void SetDestFilenameL(const TDesC& aFilename);
    79 	IMPORT_C void SetDestDataL(HBufC8*& aData);
   124 	IMPORT_C void SetDestDataL(HBufC8*& aData);
    80 	IMPORT_C void SetDestSizeInPixelsL(const TSize& aDestinationSize, TBool aMaintainAspectRatio = ETrue);
   125 	IMPORT_C void SetDestSizeInPixelsL(const TSize& aDestinationSize, TBool aMaintainAspectRatio = ETrue);
    81 
   126 	
    82 	IMPORT_C void SetOptionsL(TUint aOptions);
   127 	IMPORT_C void SetOptionsL(TUint aOptions);
    83 	IMPORT_C void SetPreserveImageData(TBool aPreserveImageData);
   128 	IMPORT_C void SetPreserveImageData(TBool aPreserveImageData);
    84 
   129 
    85 	IMPORT_C void SetupL();
   130 	IMPORT_C void SetupL();
    86 	IMPORT_C void Transform(TRequestStatus& aStatus);
   131 	IMPORT_C void Transform(TRequestStatus& aStatus);
    87 	IMPORT_C void CancelTransform();
   132 	IMPORT_C void CancelTransform();
    88 	IMPORT_C void Reset();
   133 	IMPORT_C void Reset();
    89 	IMPORT_C CImageTransformPluginExtension* Extension() const;
   134 	IMPORT_C CImageTransformPluginExtension* Extension() const;
    90 
   135 	IMPORT_C CImageTransformPluginExtension* Extension(TUid aExtensionUid, TInt& aError) const;
       
   136 	IMPORT_C void SetTransformationsL(TUint aTransformations);
    91 private:
   137 private:
    92 	CImageTransform();
   138 	CImageTransform();
    93 	void ConstructL(RFs& aFs);
   139 	void ConstructL(RFs& aFs);
    94 
   140 
    95 private:
   141 private: