epoc32/include/exifutility.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/exifutility.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,211 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// 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.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// ExifUtilty.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __EXIFUTILITY_H__
    1.22 +#define __EXIFUTILITY_H__
    1.23 +
    1.24 +class MExifMetadataReader;
    1.25 +class MExifMetadataWriter;
    1.26 +
    1.27 +
    1.28 +/**
    1.29 +@publishedAll
    1.30 +@released
    1.31 +
    1.32 +This class offers a friendly interface to read the metadata in exif encoded image files
    1.33 +
    1.34 +Note: Unless otherwise stated in a method's documentation, TInt& arguments represent unsigned quantities and will be updated with unsigned values, even though TInt is a signed type.
    1.35 +In such cases, proper typecasting should be used to ensure that the values are correctly treated as unsigned.
    1.36 +
    1.37 +Note: Get method arguments will only be updated if the method is returning KErrNone.
    1.38 +
    1.39 +*/
    1.40 +class TExifReaderUtility 
    1.41 +	{
    1.42 +public:
    1.43 +	// Construction and destruction
    1.44 +	IMPORT_C TExifReaderUtility(MExifMetadataReader* aExifMetadataReader);
    1.45 +	
    1.46 +public:
    1.47 +	// Getters
    1.48 +	IMPORT_C TInt GetMake(HBufC8*& aParam) const;
    1.49 +	IMPORT_C TInt GetModel(HBufC8*& aParam) const;
    1.50 +	IMPORT_C TInt GetDateTime(HBufC8*& aParam) const;
    1.51 +	IMPORT_C TInt GetDateTimeOriginal(HBufC8*& aParam) const;
    1.52 +	IMPORT_C TInt GetDateTimeDigitized(HBufC8*& aParam) const;
    1.53 +	IMPORT_C TInt GetInteroperabilityIndex(HBufC8*& aParam) const;
    1.54 +	IMPORT_C TInt GetInteroperabilityVersion(HBufC8*& aParam) const;
    1.55 +
    1.56 +	IMPORT_C TInt GetExifVersion(HBufC8*& aParam) const;
    1.57 +	IMPORT_C TInt GetComponentsConfiguration(HBufC8*& aParam) const;
    1.58 +	IMPORT_C TInt GetFlashPixVersion(HBufC8*& aParam) const;
    1.59 +
    1.60 +	IMPORT_C TInt GetXResolution(TInt& aNumerator, TInt& aDenominator) const;
    1.61 +	IMPORT_C TInt GetYResolution(TInt& aNumerator, TInt& aDenominator) const;
    1.62 +	IMPORT_C TInt GetThumbXResolution(TInt& aNumerator, TInt& aDenominator) const;
    1.63 +	IMPORT_C TInt GetThumbYResolution(TInt& aNumerator, TInt& aDenominator) const;
    1.64 +
    1.65 +	IMPORT_C TInt GetResolutionUnit(TUint16& aParam) const;
    1.66 +	IMPORT_C TInt GetYCbCrPositioning(TUint16& aParam) const;
    1.67 +	IMPORT_C TInt GetOrientation(TUint16& aParam) const;
    1.68 +	IMPORT_C TInt GetColorSpace(TUint16& aParam) const;
    1.69 +	IMPORT_C TInt GetPixelXDimension(TInt& aParam) const;
    1.70 +	IMPORT_C TInt GetPixelYDimension(TInt& aParam) const;
    1.71 +
    1.72 +	IMPORT_C TInt GetThumbCompression(TUint16& aParam) const;
    1.73 +	IMPORT_C TInt GetThumbResolutionUnit(TUint16& aParam) const;
    1.74 +	IMPORT_C TInt GetThumbOrientation(TUint16& aParam) const;
    1.75 +	
    1.76 +	IMPORT_C TInt GetImageDescription(HBufC8*& aParam) const;
    1.77 +	IMPORT_C TInt GetCopyright(HBufC8*& aParam) const;
    1.78 +	IMPORT_C TInt GetMakerNote(HBufC8*& aParam) const;
    1.79 +	IMPORT_C TInt GetUserComment(HBufC8*& aParam) const;
    1.80 +	IMPORT_C TInt GetFlash(TUint16& aParam) const;
    1.81 +	IMPORT_C TInt GetFocalLength(TInt& aNumerator, TInt& aDenominator) const;
    1.82 +	IMPORT_C TInt GetShutterSpeedValue(TInt& aNumerator, TInt& aDenominator) const;
    1.83 +	IMPORT_C TInt GetJpegInterchangeFormatLength(TInt& aParam) const;
    1.84 +	IMPORT_C TInt GetJpegInterchangeFormatLength(TUint& aParam) const;
    1.85 +
    1.86 +	IMPORT_C TInt GetGpsVersionId(HBufC8*& aParam) const;
    1.87 +	IMPORT_C TInt GetGpsLatitudeRef(HBufC8*& aParam) const;
    1.88 +	IMPORT_C TInt GetGpsLatitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const;
    1.89 +	IMPORT_C TInt GetGpsLongitudeRef(HBufC8*& aParam) const;
    1.90 +	IMPORT_C TInt GetGpsLongitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const;
    1.91 +	IMPORT_C TInt GetGpsAltitudeRef(TUint8& aParam) const;
    1.92 +	IMPORT_C TInt GetGpsAltitude(TInt& aNumerator, TInt& aDenominator) const;
    1.93 +	IMPORT_C TInt GetGpsTimeStamp(TInt& aHourNumerator, TInt& aHourDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const;
    1.94 +	IMPORT_C TInt GetGpsSatellites(HBufC8*& aParam) const;
    1.95 +	IMPORT_C TInt GetGpsStatus(HBufC8*& aParam) const;
    1.96 +	IMPORT_C TInt GetGpsMeasureMode(HBufC8*& aParam) const;
    1.97 +	IMPORT_C TInt GetGpsDop(TInt& aNumerator, TInt& aDenominator) const;
    1.98 +	IMPORT_C TInt GetGpsSpeedRef(HBufC8*& aParam) const;
    1.99 +	IMPORT_C TInt GetGpsSpeed(TInt& aNumerator, TInt& aDenominator) const;
   1.100 +	IMPORT_C TInt GetGpsTrackRef(HBufC8*& aParam) const;
   1.101 +	IMPORT_C TInt GetGpsTrack(TInt& aNumerator, TInt& aDenominator) const;
   1.102 +	IMPORT_C TInt GetGpsImgDirectionRef(HBufC8*& aParam) const;
   1.103 +	IMPORT_C TInt GetGpsImgDirection(TInt& aNumerator, TInt& aDenominator) const;
   1.104 +	IMPORT_C TInt GetGpsMapDatum(HBufC8*& aParam) const;
   1.105 +	IMPORT_C TInt GetGpsDestLatitudeRef(HBufC8*& aParam) const;
   1.106 +	IMPORT_C TInt GetGpsDestLatitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const;
   1.107 +	IMPORT_C TInt GetGpsDestLongitudeRef(HBufC8*& aParam) const;
   1.108 +	IMPORT_C TInt GetGpsDestLongitude(TInt& aDegNumerator, TInt& aDegDenominator, TInt& aMinNumerator, TInt& aMinDenominator, TInt& aSecNumerator, TInt& aSecDenominator) const;
   1.109 +	IMPORT_C TInt GetGpsDestBearingRef(HBufC8*& aParam) const;
   1.110 +	IMPORT_C TInt GetGpsDestBearing(TInt& aNumerator, TInt& aDenominator) const;
   1.111 +	IMPORT_C TInt GetGpsDestDistanceRef(HBufC8*& aParam) const;
   1.112 +	IMPORT_C TInt GetGpsDestDistance(TInt& aNumerator, TInt& aDenominator) const;
   1.113 +	IMPORT_C TInt GetGpsProcessingMethod(HBufC8*& aParam) const;
   1.114 +	IMPORT_C TInt GetGpsAreaInformation(HBufC8*& aParam) const;
   1.115 +	IMPORT_C TInt GetGpsDateStamp(HBufC8*& aParam) const;
   1.116 +	IMPORT_C TInt GetGpsDifferential(TUint16& aParam) const;
   1.117 +private:
   1.118 +	MExifMetadataReader* iExifRead;
   1.119 +	};
   1.120 +
   1.121 +
   1.122 +/**
   1.123 +@publishedAll
   1.124 +@released
   1.125 +
   1.126 +This class offers a friendly interface to write the metadata in exif encoded image files
   1.127 +
   1.128 +Note: Unless otherwise stated in a method's documentation, it should be assumed that TInt arguments are representing unsigned quantities, even though TInt is a signed type.
   1.129 +So unless otherwise stated, these parameters should be given unsigned values only.
   1.130 +*/
   1.131 +class TExifWriterUtility
   1.132 +	{	
   1.133 +public:
   1.134 +	// Construction and destruction
   1.135 +	IMPORT_C TExifWriterUtility(MExifMetadataWriter* aExifMetadata);
   1.136 +	
   1.137 +public:
   1.138 +	// Setters
   1.139 +	IMPORT_C TInt SetMake(HBufC8* aMake);
   1.140 +	IMPORT_C TInt SetModel(HBufC8* aModel);
   1.141 +	IMPORT_C TInt SetDateTime(HBufC8* aDateTime);
   1.142 +	IMPORT_C TInt SetDateTimeOriginal(HBufC8* aDateTime);
   1.143 +	IMPORT_C TInt SetDateTimeDigitized(HBufC8* aDateTime);
   1.144 +	IMPORT_C TInt SetInteroperabilityIndex(HBufC8* aIdx);
   1.145 +	IMPORT_C TInt SetInteroperabilityVersion(HBufC8* aIdx);
   1.146 +
   1.147 +	IMPORT_C TInt SetExifVersion(HBufC8* aExifVersion);
   1.148 +	IMPORT_C TInt SetComponentsConfiguration(HBufC8* aComponentsConfig);
   1.149 +	IMPORT_C TInt SetFlashPixVersion(HBufC8* aFlashPixVer);
   1.150 +
   1.151 +	IMPORT_C TInt SetXResolution(TInt aNumerator, TInt aDenominator);
   1.152 +	IMPORT_C TInt SetYResolution(TInt aNumerator, TInt aDenominator);
   1.153 +	IMPORT_C TInt SetThumbXResolution(TInt aNumerator, TInt aDenominator);
   1.154 +	IMPORT_C TInt SetThumbYResolution(TInt aNumerator, TInt aDenominator);
   1.155 +
   1.156 +	IMPORT_C TInt SetResolutionUnit(TInt aResUnit);
   1.157 +	IMPORT_C TInt SetYCbCrPositioning(TInt aPositioning);
   1.158 +	IMPORT_C TInt SetOrientation(TInt aOrientation);
   1.159 +	IMPORT_C TInt SetColorSpace(TInt aColorSpace);
   1.160 +	IMPORT_C TInt SetPixelXDimension(TInt aPixelXDim);
   1.161 +	IMPORT_C TInt SetPixelYDimension(TInt aPixelYDim); 
   1.162 +
   1.163 +	IMPORT_C TInt SetThumbCompression(TInt aCompression);
   1.164 +	IMPORT_C TInt SetThumbResolutionUnit(TInt aResUnit);
   1.165 +	IMPORT_C TInt SetThumbOrientation(TInt aOrientation);
   1.166 +	
   1.167 +	IMPORT_C TInt SetImageDescription(HBufC8* aImageDescription);
   1.168 +	IMPORT_C TInt SetCopyright(HBufC8* aCopyright);
   1.169 +	IMPORT_C TInt SetMakerNote(HBufC8* aMakerNote);
   1.170 +	IMPORT_C TInt SetUserComment(HBufC8* aUserComment);
   1.171 +	IMPORT_C TInt SetFlash(TUint16 aFlash);
   1.172 +	IMPORT_C TInt SetFocalLength(TInt aNumerator, TInt aDenominator);
   1.173 +	IMPORT_C TInt SetShutterSpeedValue(TInt aNumerator, TInt aDenominator);
   1.174 +	
   1.175 +	IMPORT_C TInt SetGpsVersionId(HBufC8* aGpsVersionId);
   1.176 +	IMPORT_C TInt SetGpsLatitudeRef(HBufC8* aGpsLatitudeRef);
   1.177 +	IMPORT_C TInt SetGpsLatitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator);
   1.178 +	IMPORT_C TInt SetGpsLongitudeRef(HBufC8* aGpsLongitudeRef);
   1.179 +	IMPORT_C TInt SetGpsLongitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator);
   1.180 +	IMPORT_C TInt SetGpsAltitudeRef(TUint8 aGpsAltitudeRef);
   1.181 +	IMPORT_C TInt SetGpsAltitude(TInt aNumerator, TInt aDenominator);
   1.182 +	IMPORT_C TInt SetGpsTimeStamp(TInt aHourNumerator, TInt aHourDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator);
   1.183 +	IMPORT_C TInt SetGpsSatellites(HBufC8* aGpsSatellites);
   1.184 +	IMPORT_C TInt SetGpsStatus(HBufC8* aGpsStatus);
   1.185 +	IMPORT_C TInt SetGpsMeasureMode(HBufC8* aGpsMeasureMode);
   1.186 +	IMPORT_C TInt SetGpsDop(TInt aNumerator, TInt aDenominator);
   1.187 +	IMPORT_C TInt SetGpsSpeedRef(HBufC8* aGpsSpeedRef);
   1.188 +	IMPORT_C TInt SetGpsSpeed(TInt aNumerator, TInt aDenominator);
   1.189 +	IMPORT_C TInt SetGpsTrackRef(HBufC8* aGpsTrackRef);
   1.190 +	IMPORT_C TInt SetGpsTrack(TInt aNumerator, TInt aDenominator);
   1.191 +	IMPORT_C TInt SetGpsImgDirectionRef(HBufC8* aGpsImgDirectionRef);
   1.192 +	IMPORT_C TInt SetGpsImgDirection(TInt aNumerator, TInt aDenominator);
   1.193 +	IMPORT_C TInt SetGpsMapDatum(HBufC8* aGpsMapDatum);
   1.194 +	IMPORT_C TInt SetGpsDestLatitudeRef(HBufC8* aGpsDestLatitudeRef);
   1.195 +	IMPORT_C TInt SetGpsDestLatitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator);
   1.196 +	IMPORT_C TInt SetGpsDestLongitudeRef(HBufC8* aGpsDestLongitudeRef);
   1.197 +	IMPORT_C TInt SetGpsDestLongitude(TInt aDegNumerator, TInt aDegDenominator, TInt aMinNumerator, TInt aMinDenominator, TInt aSecNumerator, TInt aSecDenominator);
   1.198 +	IMPORT_C TInt SetGpsDestBearingRef(HBufC8* aGpsDestBearingRef);
   1.199 +	IMPORT_C TInt SetGpsDestBearing(TInt aNumerator, TInt aDenominator);
   1.200 +	IMPORT_C TInt SetGpsDestDistanceRef(HBufC8* aGpsDestDistanceRef);
   1.201 +	IMPORT_C TInt SetGpsDestDistance(TInt aNumerator, TInt aDenominator);
   1.202 +	IMPORT_C TInt SetGpsProcessingMethod(HBufC8* aGpsProcessingMethod);
   1.203 +	IMPORT_C TInt SetGpsAreaInformation(HBufC8* aGpsAreaInformation);
   1.204 +	IMPORT_C TInt SetGpsDateStamp(HBufC8* aDateStamp);
   1.205 +	IMPORT_C TInt SetGpsDifferential(TUint16 aGpsDifferential);
   1.206 +
   1.207 +private: // Member
   1.208 +	
   1.209 +	MExifMetadataWriter* iExifWrite;
   1.210 +	
   1.211 +	};
   1.212 +
   1.213 +
   1.214 +#endif	// __EXIFUTILITY_H__