|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Image thumbnail decoderv2. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef THUMBNAILIMAGEDECODERV2_H |
|
20 #define THUMBNAILIMAGEDECODERV2_H |
|
21 |
|
22 #include "thumbnailprovider.h" |
|
23 |
|
24 class CImageDecoder; |
|
25 class CFbsBitmap; |
|
26 |
|
27 /** |
|
28 * Image thumbnail decoder. |
|
29 * |
|
30 * @since S60 v5.0 |
|
31 */ |
|
32 class CThumbnailImageDecoderv2: public CActive |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * C++ default constructor |
|
38 * |
|
39 * @since S60 v5.0 |
|
40 * @param aFs File server session |
|
41 * @return New image thumbnail decoder instance. |
|
42 */ |
|
43 CThumbnailImageDecoderv2( RFs& aFs); |
|
44 |
|
45 /** |
|
46 * Destructor |
|
47 * |
|
48 * @since S60 v5.0 |
|
49 */ |
|
50 virtual ~CThumbnailImageDecoderv2(); |
|
51 |
|
52 /** |
|
53 * Creates a decoder from the given image buffer and gets image |
|
54 * information |
|
55 * |
|
56 * @since S60 v5.0 |
|
57 * @param aBuffer Source image buffer. |
|
58 * @param aObserver Observer to relay notifications about completed |
|
59 * operations. |
|
60 */ |
|
61 void CreateL(TDesC8& aBuffer, MThumbnailProviderObserver& aObserver); |
|
62 |
|
63 /** |
|
64 * Decode image. |
|
65 * |
|
66 * @since S60 v5.0 |
|
67 * @param aDisplayMode Preferred display mode. |
|
68 */ |
|
69 void DecodeL(); |
|
70 |
|
71 private: |
|
72 /** |
|
73 * Used to release reserved resources. |
|
74 * |
|
75 * @since S60 v5.0 |
|
76 */ |
|
77 void Release(); |
|
78 |
|
79 /** |
|
80 * Implements cancellation of an outstanding request. |
|
81 * |
|
82 * @since S60 v5.0 |
|
83 */ |
|
84 void DoCancel(); |
|
85 |
|
86 /** |
|
87 * Handles an active object's request completion event. |
|
88 * |
|
89 * @since S60 v5.0 |
|
90 */ |
|
91 void RunL(); |
|
92 |
|
93 /** |
|
94 * Creates image decoder to be used. |
|
95 * |
|
96 * @since S60 v5.0 |
|
97 */ |
|
98 void CreateDecoderL(); |
|
99 |
|
100 private: |
|
101 // data |
|
102 |
|
103 /** |
|
104 * Image decoder. |
|
105 * Own. |
|
106 */ |
|
107 CImageDecoder* iDecoder; |
|
108 |
|
109 /** |
|
110 * Original size of the image in pixels. |
|
111 */ |
|
112 TSize iOriginalSize; |
|
113 |
|
114 /** |
|
115 * Decoded bitmap. |
|
116 * Own. |
|
117 */ |
|
118 CFbsBitmap* iBitmap; |
|
119 |
|
120 /** |
|
121 * Used fileserver. |
|
122 */ |
|
123 RFs& iFs; |
|
124 |
|
125 /** |
|
126 * Buffer from which thumbnail is to be created. |
|
127 */ |
|
128 TDesC8* iBuffer; |
|
129 |
|
130 /** |
|
131 * Observer. |
|
132 */ |
|
133 MThumbnailProviderObserver* iObserver; // not own |
|
134 }; |
|
135 |
|
136 #endif // THUMBNAILIMAGEDECODERV2_H |