24 #include <f32file.h> |
24 #include <f32file.h> |
25 #include <caf/manager.h> |
25 #include <caf/manager.h> |
26 #include <caf/content.h> |
26 #include <caf/content.h> |
27 #include <driveinfo.h> |
27 #include <driveinfo.h> |
28 #include <coeutils.h> |
28 #include <coeutils.h> |
|
29 #include <coemain.h> |
29 |
30 |
30 _LIT( KPrivateFolder, "\\Private\\" ); |
31 _LIT( KPrivateFolder, "\\Private\\" ); |
31 _LIT( KGifFileMime, "image/gif" ); |
32 _LIT( KGifFileMime, "image/gif" ); |
32 _LIT( KMbmFileExt, "image/x-epoc-mbm"); |
33 _LIT( KMbmFileExt, "image/x-epoc-mbm"); |
33 _LIT( KTempFilePath, "?:\\data\\images\\" ); |
34 _LIT( KTempFilePath, "?:\\data\\images\\" ); |
119 if (aFileName.Length() == 0) |
120 if (aFileName.Length() == 0) |
120 { |
121 { |
121 User::Leave(KErrNotSupported); |
122 User::Leave(KErrNotSupported); |
122 } |
123 } |
123 iImageUri = aFileName.AllocL(); |
124 iImageUri = aFileName.AllocL(); |
|
125 CreateImageDecoderL(); |
124 } |
126 } |
125 |
127 |
126 // --------------------------------------------------------------------------- |
128 // --------------------------------------------------------------------------- |
127 // Reset |
129 // Reset |
128 // --------------------------------------------------------------------------- |
130 // --------------------------------------------------------------------------- |
206 iIsPrivateGif = ETrue; |
210 iIsPrivateGif = ETrue; |
207 } |
211 } |
208 } |
212 } |
209 SetImageUriL( filePath ); |
213 SetImageUriL( filePath ); |
210 } |
214 } |
|
215 |
|
216 // --------------------------------------------------------------------------- |
|
217 // CloseImageDecoder |
|
218 // --------------------------------------------------------------------------- |
|
219 // |
|
220 EXPORT_C void CGlxImageViewerManager::CloseImageDecoder() |
|
221 { |
|
222 TRACER("void CGlxImageViewerManager::CloseImageDecoder()"); |
|
223 if (iImageDecoder) |
|
224 { |
|
225 delete iImageDecoder; |
|
226 iImageDecoder = NULL; |
|
227 } |
|
228 } |
|
229 |
|
230 // --------------------------------------------------------------------------- |
|
231 // CreateImageDecoderL |
|
232 // --------------------------------------------------------------------------- |
|
233 // |
|
234 EXPORT_C void CGlxImageViewerManager::CreateImageDecoderL() |
|
235 { |
|
236 TRACER("void CGlxImageViewerManager::CreateImageDecoderL()"); |
|
237 |
|
238 CloseImageDecoder(); |
|
239 |
|
240 TInt err = KErrNone; |
|
241 if (IsPrivate()) |
|
242 { |
|
243 if (&ImageFileHandle()) |
|
244 { |
|
245 GLX_DEBUG1("CGlxImageViewerManager::CreateImageDecoderL() FH"); |
|
246 TRAP(err, iImageDecoder = CImageDecoder::FileNewL( |
|
247 ImageFileHandle(), ContentAccess::EPeek)); |
|
248 } |
|
249 } |
|
250 else |
|
251 { |
|
252 if (ImageUri()) |
|
253 { |
|
254 GLX_DEBUG1("CGlxImageViewerManager::CreateImageDecoderL() FN"); |
|
255 TRAP(err, iImageDecoder = CImageDecoder::FileNewL( |
|
256 CCoeEnv::Static()->FsSession(), ImageUri()->Des())); |
|
257 } |
|
258 } |
|
259 |
|
260 GLX_DEBUG2("CGlxImageViewerManager::CreateImageDecoderL() err(%d)", err); |
|
261 User::LeaveIfError(err); |
|
262 } |