1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: SConMetadata header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _SCONMETADATA_H_ |
|
20 #define _SCONMETADATA_H_ |
|
21 |
|
22 #include <MetaDataField.hrh> |
|
23 |
|
24 class CSConTask; |
|
25 class CExifRead; |
|
26 class CExifTag; |
|
27 //============================================================ |
|
28 // Class CSConMetadata declaration |
|
29 //============================================================ |
|
30 NONSHARABLE_CLASS( SConMetadata ) |
|
31 { |
|
32 public: |
|
33 |
|
34 /** |
|
35 * Start processing metadata task |
|
36 * @param aTask used task |
|
37 * @param aFs aReference to RFs connection. |
|
38 * @return none |
|
39 */ |
|
40 static void ProcessTask( CSConTask& aTask, RFs& aFs ); |
|
41 |
|
42 private: |
|
43 |
|
44 /** |
|
45 * Get audio metadata to task |
|
46 * @return none |
|
47 */ |
|
48 static void GetAudioMetadataL( CSConTask& aTask ); |
|
49 |
|
50 /** |
|
51 * Get video metadata to task |
|
52 * @param aFs aReference to RFs connection. |
|
53 * @return none |
|
54 */ |
|
55 static void GetVideoMetadataL( CSConTask& aTask, RFs& aFs ); |
|
56 |
|
57 /** |
|
58 * parse exif field |
|
59 * @return HBufC8* parsed data. Leaves if not found |
|
60 */ |
|
61 static HBufC8* GetExifTagL( CExifRead* aReader, const TUint8 aTagID ) ; |
|
62 |
|
63 /** |
|
64 * Parse TUint32 value from aData |
|
65 * @return TUint32 value |
|
66 */ |
|
67 static TUint32 ReadTUint32( const TDesC8& aData ); |
|
68 |
|
69 /** |
|
70 * Read data from file |
|
71 * @param aFs aReference to RFs connection. |
|
72 * @return file data |
|
73 */ |
|
74 static HBufC8* GetFileDataLC( const TDesC& aFilename, RFs& aFs ); |
|
75 |
|
76 /** |
|
77 * Get exif metadata to task |
|
78 * @param aFs aReference to RFs connection. |
|
79 * @return none |
|
80 */ |
|
81 static void ReadExifDataL( CSConTask& aTask, RFs& aFs ); |
|
82 |
|
83 /** |
|
84 * Convert latidute/longitude tag to TReal64 value |
|
85 * @return KErrNone if successfully converted |
|
86 */ |
|
87 static TInt ConvertRationalTag( const CExifTag& aTag, TDes& aPosDegrees ); |
|
88 |
|
89 /** |
|
90 * Get latidute value from Exif |
|
91 * @param aExifRead ExifReader used to read |
|
92 * @param aLatitude readed latidute |
|
93 * @return KErrNone if found |
|
94 */ |
|
95 static TInt GetExifGPSLatitudeL( CExifRead& aExifRead, TDes& aLatitude ); |
|
96 |
|
97 /** |
|
98 * Get longitude value from Exif |
|
99 * @param aExifRead ExifReader used to read |
|
100 * @param aLongitude readed longitude |
|
101 * @return KErrNone if found |
|
102 */ |
|
103 static TInt GetExifGPSLongitudeL( CExifRead& aExifRead, TDes& aLongitude ); |
|
104 |
|
105 /** |
|
106 * Get altidute value from Exif |
|
107 * @param aExifRead ExifReader used to read |
|
108 * @param aAltidute readed altidute |
|
109 * @return KErrNone if found |
|
110 */ |
|
111 static TInt GetExifGPSAltiduteL( CExifRead& aExifRead, TDes& aAltidute ); |
|
112 |
|
113 /** |
|
114 * Appends data field to buffer |
|
115 * @return none |
|
116 */ |
|
117 static void AppendUtf8DataFieldL( CBufFlat* aBuffer, const TPtrC aAppendData, |
|
118 const TUint8 aFieldId ); |
|
119 |
|
120 /** |
|
121 * Appends data field to buffer |
|
122 * @return none |
|
123 */ |
|
124 static void AppendByteDataFieldL( CBufFlat* aBuffer, const TPtrC8 aAppendData, |
|
125 const TUint8 aFieldId ); |
|
126 |
|
127 /** |
|
128 * Writes TUint32 value to buffer |
|
129 * @return none |
|
130 */ |
|
131 static void WriteTUint32( CBufFlat* aBuffer, TInt offset, TUint32 aValue ); |
|
132 |
|
133 /** |
|
134 * Appends data field to buffer |
|
135 * @return none |
|
136 */ |
|
137 static void AppendTUintDataFieldL( CBufFlat* aBuffer, TUint32 aValue, |
|
138 const TUint8 aFieldId ); |
|
139 |
|
140 /** |
|
141 * Get AudioFieldId |
|
142 * @return TUint8 |
|
143 */ |
|
144 static TUint8 AudioFieldId( const TMetaDataFieldId fieldId ); |
|
145 |
|
146 }; |
|
147 |
|
148 #endif // _SCONMETADATA_H_ |
|