epoc32/include/imagetransform.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 // Copyright (c) 2007-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // This is the public client API for the Image Transform Library
    15 // 
    16 //
    17 /**
    18  @file
    19  @publishedAll
    20  @released
    21 */
    22 
    23 #ifndef __IMAGETRANSFORM_H__
    24 #define __IMAGETRANSFORM_H__
    25 
    26 #include <e32base.h>
    27 #include <fbs.h>
    28 
    29 // fwd refs
    30 class CImageTransformFramework;	//fwd ref
    31 class CImageTransformPluginExtension;
    32 
    33 /**
    34 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 
    37 @publishedAll
    38 @released
    39 */
    40 class CImageTransform : public CBase
    41 	{
    42 public:
    43 	/**
    44 	Flags to control how the image is transformed.
    45 	The EThumbnail and EIgnoreExifMetadataProcessing are mutually exclusive,
    46 	and SHOULD NOT be used together. If they are, then EThumbnail is used.
    47 	*/
    48 	enum TOptions
    49 		{
    50 		/** No flag set. This is the default option*/
    51 		EOptionNone = 0x00,
    52 		/** If set, the destination image will always have a thumbnail.
    53 		If the source already has a thumbnail, then this is the one that will appear
    54 		in the destination, otherwise one will be generated. */
    55 		EThumbnail	= 0x01,
    56 		/** If set, then the Exif data is not parsed and ExifMetaData() will always return NULL. If the source image is EXIF, 
    57 		then the EXIF information is copied without modification (i.e. without parsing) to the destination. In cases where 
    58 		the source is JFIF, the destination image is also JFIF.
    59 		*/
    60 		EIgnoreExifMetadataProcessing = 0x02,
    61 		/**
    62 		TOptions should not be set greater than or equal to this value.
    63 		*/
    64 		EEnumBoundary = 0x04
    65 		};
    66 
    67 public:
    68 	IMPORT_C static CImageTransform* NewL(RFs& aFs);
    69 	IMPORT_C ~CImageTransform();
    70 	IMPORT_C void SetPluginUidL(TUid aPluginUid);
    71 	IMPORT_C void SetSourceFilenameL(const TDesC& aFilename);
    72 	IMPORT_C void SetSourceDataL(const TDesC8& aData);
    73 	IMPORT_C void SetSourceMimeTypeL(const TDesC8& aMIMEType);
    74 	IMPORT_C void SetSourceImageTypeL(TUid aImageType, TUid aImageSubType = KNullUid);
    75 	IMPORT_C void SetSourceRect(const TRect& aRect);
    76 	IMPORT_C void ClearSourceRect();
    77 
    78 	IMPORT_C void SetDestFilenameL(const TDesC& aFilename);
    79 	IMPORT_C void SetDestDataL(HBufC8*& aData);
    80 	IMPORT_C void SetDestSizeInPixelsL(const TSize& aDestinationSize, TBool aMaintainAspectRatio = ETrue);
    81 
    82 	IMPORT_C void SetOptionsL(TUint aOptions);
    83 	IMPORT_C void SetPreserveImageData(TBool aPreserveImageData);
    84 
    85 	IMPORT_C void SetupL();
    86 	IMPORT_C void Transform(TRequestStatus& aStatus);
    87 	IMPORT_C void CancelTransform();
    88 	IMPORT_C void Reset();
    89 	IMPORT_C CImageTransformPluginExtension* Extension() const;
    90 
    91 private:
    92 	CImageTransform();
    93 	void ConstructL(RFs& aFs);
    94 
    95 private:
    96 	CImageTransformFramework* iBody;
    97 	};
    98 
    99 #endif // __IMAGETRANSFORM_H__