author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 20:54:53 +0300 | |
branch | RCL_3 |
changeset 21 | 9da50d567e3c |
parent 20 | f4a778e096c2 |
permissions | -rw-r--r-- |
20 | 1 |
/* |
2 |
* Copyright (c) 2009-2009 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: Implementation of MyCard image loader |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef CCAPPMYCARDIMAGELOADER_H |
|
19 |
#define CCAPPMYCARDIMAGELOADER_H |
|
20 |
||
21
9da50d567e3c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
20
diff
changeset
|
21 |
#include <ccappimagedecoding.h> |
20 | 22 |
|
23 |
class MVPbkStoreContact; |
|
24 |
class CCCAppImageDecoding; |
|
25 |
class CFbsBitmap; |
|
26 |
||
27 |
/** |
|
28 |
* MyCard image loading observer class |
|
29 |
*/ |
|
30 |
class MMyCardImageLoaderObserver |
|
31 |
{ |
|
32 |
public: |
|
33 |
||
34 |
/** |
|
35 |
* Notification method to report loaded images to observer. |
|
36 |
* |
|
37 |
* @param aThumbnail loaded contact thumbnail. Ownership transferred to |
|
38 |
* observer. |
|
39 |
*/ |
|
40 |
virtual void ThumbnailReady( CFbsBitmap* aThumbnail ) = 0; |
|
41 |
||
42 |
/** |
|
43 |
* Notification method to report failed load requests |
|
44 |
* |
|
45 |
* @param aError Generic symbian error code |
|
46 |
*/ |
|
47 |
virtual void ThumbnailLoadError( TInt aError ) = 0; |
|
48 |
||
49 |
protected: |
|
50 |
virtual ~MMyCardImageLoaderObserver() {} |
|
51 |
}; |
|
52 |
||
53 |
/** |
|
54 |
* Contact image loader |
|
55 |
* |
|
56 |
* @lib ccappmycardplugin.dll |
|
57 |
* @since S60 9.2 |
|
58 |
*/ |
|
59 |
NONSHARABLE_CLASS( CCCAppMyCardImageLoader ) : |
|
60 |
public CBase, |
|
61 |
public MCCAppImageDecodingObserver |
|
62 |
{ |
|
63 |
||
64 |
public: |
|
65 |
||
66 |
/** |
|
67 |
* Two-phased constructor. |
|
68 |
*/ |
|
69 |
static CCCAppMyCardImageLoader* NewL( |
|
70 |
MMyCardImageLoaderObserver& aObserver ); |
|
71 |
||
72 |
/** |
|
73 |
* Destructor. |
|
74 |
*/ |
|
75 |
~CCCAppMyCardImageLoader(); |
|
76 |
||
77 |
||
78 |
public: // Interface |
|
79 |
||
80 |
/** |
|
81 |
* Start loading contacts image. Will cancel any previous requests. |
|
82 |
* Once loading is complete the new image is delivered to observer |
|
83 |
* with a call to MMyCardImageLoaderObserver::ThumbnailReady. |
|
84 |
* |
|
85 |
* @param aContact source contact for the image |
|
86 |
*/ |
|
87 |
void LoadContactImageL( |
|
88 |
MVPbkStoreContact& aContact, |
|
89 |
const TSize& aThumbnailSize ); |
|
90 |
||
91 |
/** |
|
92 |
* Start loading contacts image. Will cancel any previous requests. |
|
93 |
* Once loading is complete the new image is delivered to observer |
|
94 |
* with a call to MMyCardImageLoaderObserver::ThumbnailReady. |
|
95 |
* |
|
96 |
* @param aImageData source data for the image |
|
97 |
* @param aImageFileName filename of the image |
|
98 |
*/ |
|
99 |
void LoadImageL( |
|
100 |
const TDesC8& aImageData, |
|
101 |
const TDesC& aImageFileName, |
|
102 |
const TSize& aThumbnailSize ); |
|
103 |
||
104 |
void ResizeImageL( const TSize& aThumbnailSize ); |
|
105 |
||
106 |
private: // From MCCAppImageDecodingObserver |
|
107 |
void BitmapReadyL( CFbsBitmap* aBitmap ); |
|
108 |
||
109 |
private: // constructors |
|
110 |
||
111 |
/** |
|
112 |
* Constructor |
|
113 |
*/ |
|
114 |
inline CCCAppMyCardImageLoader( |
|
115 |
MMyCardImageLoaderObserver& aObserver ); |
|
116 |
||
117 |
private: // data |
|
118 |
||
119 |
/// Not own. Observer |
|
120 |
MMyCardImageLoaderObserver& iObserver; |
|
121 |
||
122 |
/// Own. |
|
123 |
HBufC8* iImageBuffer; |
|
124 |
||
125 |
/// Own. |
|
126 |
HBufC* iImageFileName; |
|
127 |
||
128 |
/// Own |
|
129 |
CCCAppImageDecoding* iImageDecoding; |
|
130 |
}; |
|
131 |
||
132 |
#endif // CCAPPMYCARDIMAGELOADER_H |
|
133 |
||
134 |
// End of File |