mmplugins/imagingplugins/codecs/JPEGCodec/Exif/ifdgeneralentry.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     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 //
       
    15 
       
    16 #ifndef IFDGENERALENTRY_H
       
    17 #define IFDGENERALENTRY_H
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 const TUint8 KNullCharacter = '\0';
       
    22 
       
    23 class CIfdGeneral;
       
    24 
       
    25 class CIfdGeneralEntry : public CBase
       
    26 	{
       
    27 public:
       
    28 	friend class CExifVerifier;	
       
    29 
       
    30 public:
       
    31 	static CIfdGeneralEntry* NewLC();
       
    32 	static CIfdGeneralEntry* NewLC(const TUint& aTag, const TUint& aFormat, const TUint& aComponentCount, const TUint8* aParam, CIfdGeneral* aIfd);
       
    33 	static CIfdGeneralEntry* NewL(const TUint& aTag, const TUint& aFormat, const TUint& aComponentCount, const TUint8* aParam, CIfdGeneral* aIfd, TBool& aUnknownTag);
       
    34 
       
    35 	~CIfdGeneralEntry();
       
    36 
       
    37 	TUint Tag();
       
    38 	TUint Format();
       
    39 	TUint ComponentCount();
       
    40 	TUint ValueOffset();
       
    41 	const TUint8* ActualValue(); 
       
    42 	
       
    43 	// Accessor functions.
       
    44 	
       
    45 
       
    46 	// Returns the number of additional data bytes stored for an IfdEntry (outside of the 12 byte directory entry)
       
    47 	TInt ExtraSize();
       
    48 	// returns the total size of the ifd entry
       
    49 	TInt TotalSize();		
       
    50 
       
    51 	// Alter fields.
       
    52 	TInt UpdateRational(const TInt aNumerator, const TInt aDenominator);
       
    53 	TInt UpdateString(const HBufC8* aStringValue);
       
    54 	TInt UpdateInteger(const TInt aIntegerValue);
       
    55 	TInt UpdateShort(const TUint16 aShortValue);
       
    56 	TInt UpdateData(TUint aComponentCount, const TUint8* aData); // A catch-all update function.
       
    57 	// Check whether this entry has data of a particular type.
       
    58 	TBool IsRationalFormat();
       
    59 	TBool IsStringFormat();
       
    60 	TBool IsUndefinedFormat();
       
    61 	TBool IsIntegerFormat();
       
    62 	TBool IsShortFormat();
       
    63 	TBool IsUnicodeData();
       
    64 
       
    65 	// Set fields in a new directory entry.
       
    66 	TInt SetActualData(const TAny* aActualData, const TUint aSize, const TUint aBytes);
       
    67 
       
    68 private: // Functions
       
    69 	void SetTag(const TUint aTag);
       
    70 	void SetFormat(const TUint aFormat);
       
    71 	void SetComponentCount(const TUint aCompCount);
       
    72 	void SetValueOffset(const TUint8* aValueOffset);
       
    73 
       
    74 	CIfdGeneralEntry();
       
    75 	void ConstructL();
       
    76 	void ConstructL(const TUint& aTag, const TUint& aFormat, TUint aComponentCount, const TUint8* aValueOffset, CIfdGeneral* aIfd, TBool& aUnknownTag);
       
    77 	
       
    78 private: // Member variables.
       
    79 	TUint8* iDirEntryData; // The actual data in a buffer pointed to by this.
       
    80 	TUint8* iActualData; // Stores n bytes of data pointed to by value offset field.
       
    81 	CIfdGeneral* iIfd; // not owned
       
    82 	};
       
    83 
       
    84 #endif // IFDGENERALENTRY_H