|
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 // ExtendedPlugin.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "JPEGExifPlugin.h" |
|
19 |
|
20 //CJPEGExifDecoder |
|
21 /** |
|
22 Constructs a new exif decoder. |
|
23 |
|
24 A leave occurs if there is insufficient memory available. |
|
25 |
|
26 @return A pointer to the new exif jpeg decoder. |
|
27 */ |
|
28 EXPORT_C CJPEGExifDecoder* CJPEGExifDecoder::NewL() |
|
29 { |
|
30 CJPEGExifDecoder* self; |
|
31 self = new (ELeave) CJPEGExifDecoder; |
|
32 CleanupStack::PushL(self); |
|
33 self->ConstructL(); |
|
34 CleanupStack::Pop(self); |
|
35 return self; |
|
36 } |
|
37 |
|
38 /** |
|
39 Initialises an exif decoder. |
|
40 |
|
41 A leave occurs if the associated ICL plugin could not be instanciated |
|
42 */ |
|
43 EXPORT_C void CJPEGExifDecoder::ConstructL() |
|
44 { |
|
45 iBody = CJPEGExifDecoder::CBody::NewL(*this); |
|
46 } |
|
47 |
|
48 /** |
|
49 @publishedPartner |
|
50 @released |
|
51 constructor |
|
52 */ |
|
53 EXPORT_C CJPEGExifDecoder::CJPEGExifDecoder() |
|
54 { |
|
55 } |
|
56 |
|
57 /** |
|
58 @publishedPartner |
|
59 @released |
|
60 destructor |
|
61 */ |
|
62 EXPORT_C CJPEGExifDecoder::~CJPEGExifDecoder() |
|
63 { |
|
64 delete iBody; |
|
65 } |
|
66 |
|
67 /** |
|
68 gets the metadata associated to this instance of the decoder |
|
69 |
|
70 NULL is returned if no metadata was found |
|
71 |
|
72 @return A pointer to the metadata |
|
73 */ |
|
74 EXPORT_C MExifMetadata* CJPEGExifDecoder::ExifMetadata() |
|
75 { |
|
76 return iBody->ExifMetadata(); |
|
77 } |
|
78 |
|
79 //CJPEGExifDecoder::iBody |
|
80 /** |
|
81 create a new body for a defined exif jpeg decoder |
|
82 |
|
83 A leave occurs if there is insufficient memory available. |
|
84 |
|
85 @param aHandle |
|
86 a reference on the exif decoder this body has to be associated to. |
|
87 |
|
88 @return A pointer to the body. |
|
89 */ |
|
90 EXPORT_C CJPEGExifDecoder::CBody* CJPEGExifDecoder::CBody::NewL(CJPEGExifDecoder& aHandle) |
|
91 { |
|
92 CJPEGExifDecoder::CBody* self; |
|
93 self = new (ELeave) CJPEGExifDecoder::CBody(aHandle); |
|
94 return self; |
|
95 } |
|
96 |
|
97 /** |
|
98 constructor |
|
99 |
|
100 instanciates a new body for a defined exif jpeg decoder |
|
101 A leave occurs if there is insufficient memory available. |
|
102 |
|
103 @param aHandle |
|
104 a reference on the exif decoder this body has to be associated to. |
|
105 */ |
|
106 CJPEGExifDecoder::CBody::CBody(CJPEGExifDecoder& aHandle) : iHandle(aHandle) |
|
107 { |
|
108 } |
|
109 |
|
110 /** |
|
111 Gets the metadata associated with this instance of the decoder |
|
112 |
|
113 returns NULL if no metadata was found |
|
114 |
|
115 @return A pointer to the metadata. |
|
116 */ |
|
117 EXPORT_C MExifMetadata* CJPEGExifDecoder::CBody::ExifMetadata() |
|
118 { |
|
119 CJPEGExifDecoderPlugin* plugin; |
|
120 plugin = static_cast<CJPEGExifDecoderPlugin*>(iHandle.Plugin()); |
|
121 return plugin->ExifMetadata(); |
|
122 } |
|
123 |
|
124 |
|
125 //CJPEGExifEncoder |
|
126 /** |
|
127 Constructs a new exif encoder. |
|
128 |
|
129 A leave occurs if there is insufficient memory available. |
|
130 |
|
131 @return A pointer to the new jpeg exif encoder. |
|
132 */ |
|
133 EXPORT_C CJPEGExifEncoder* CJPEGExifEncoder::NewL() |
|
134 { |
|
135 CJPEGExifEncoder* self; |
|
136 self = new (ELeave) CJPEGExifEncoder; |
|
137 CleanupStack::PushL(self); |
|
138 self->ConstructL(); |
|
139 CleanupStack::Pop(self); |
|
140 return self; |
|
141 } |
|
142 |
|
143 /** |
|
144 Initialises an exif encoder. |
|
145 |
|
146 A leave occurs if the associated ICL plugin could not be instanciated |
|
147 */ |
|
148 EXPORT_C void CJPEGExifEncoder::ConstructL() |
|
149 { |
|
150 iBody = CJPEGExifEncoder::CBody::NewL(*this); |
|
151 } |
|
152 |
|
153 /** |
|
154 @publishedPartner |
|
155 @released |
|
156 constructor |
|
157 */ |
|
158 EXPORT_C CJPEGExifEncoder::CJPEGExifEncoder() |
|
159 { |
|
160 } |
|
161 |
|
162 /** |
|
163 @publishedPartner |
|
164 @released |
|
165 destructor |
|
166 */ |
|
167 EXPORT_C CJPEGExifEncoder::~CJPEGExifEncoder() |
|
168 { |
|
169 delete iBody; |
|
170 } |
|
171 |
|
172 /** |
|
173 gets the metadata associated to this instance of the encoder |
|
174 |
|
175 NULL is returned if no metadata was found |
|
176 |
|
177 @return A pointer to the metadata |
|
178 */ |
|
179 EXPORT_C MExifMetadata* CJPEGExifEncoder::ExifMetadata() |
|
180 { |
|
181 return iBody->ExifMetadata(); |
|
182 } |
|
183 |
|
184 //CJPEGExifEncoder::iBody |
|
185 /** |
|
186 create a new body for a defined exif jpeg encoder |
|
187 |
|
188 A leave occurs if there is insufficient memory available. |
|
189 |
|
190 @param aHandle |
|
191 a reference on the exif encoder this body has to be associated to. |
|
192 |
|
193 @return A pointer to the body. |
|
194 */ |
|
195 EXPORT_C CJPEGExifEncoder::CBody* CJPEGExifEncoder::CBody::NewL(CJPEGExifEncoder& aHandle) |
|
196 { |
|
197 CJPEGExifEncoder::CBody* self; |
|
198 self = new (ELeave) CJPEGExifEncoder::CBody(aHandle); |
|
199 return self; |
|
200 } |
|
201 |
|
202 /** |
|
203 constructor |
|
204 |
|
205 instanciates a new body for a defined exif jpeg encoder |
|
206 A leave occurs if there is insufficient memory available. |
|
207 |
|
208 @param aHandle |
|
209 a reference on the exif decoder this body has to be associated to. |
|
210 */ |
|
211 CJPEGExifEncoder::CBody::CBody(CJPEGExifEncoder& aHandle) : iHandle(aHandle) |
|
212 { |
|
213 } |
|
214 |
|
215 /** |
|
216 Gets the metadata associated with this instance of the decoder |
|
217 |
|
218 returns NULL if no metadata was found |
|
219 |
|
220 @return A pointer to the metadata. |
|
221 */ |
|
222 EXPORT_C MExifMetadata* CJPEGExifEncoder::CBody::ExifMetadata() |
|
223 { |
|
224 CJPEGExifEncoderPlugin* plugin; |
|
225 plugin = static_cast<CJPEGExifEncoderPlugin*>(iHandle.Plugin()); |
|
226 return plugin->ExifMetadata(); |
|
227 } |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 /** |
|
233 Gets the metadata associated with this instance of the exif transform |
|
234 |
|
235 returns NULL if no metadata was found |
|
236 |
|
237 @return A pointer to the metadata. |
|
238 */ |
|
239 EXPORT_C MExifMetadata* CJPEGExifTransformExtension::ExifMetadata() |
|
240 { |
|
241 return NULL; |
|
242 } |
|
243 |
|
244 |