|
1 /* |
|
2 * Copyright (c) 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 the License "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: HG VOD class for handling thumbnail loading* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef VCXHGVODTHUMBNAILMANAGER_H |
|
21 #define VCXHGVODTHUMBNAILMANAGER_H |
|
22 |
|
23 #include <coemain.h> |
|
24 |
|
25 #include "vcxnsimageconverterobserver.h" |
|
26 |
|
27 class CVcxNsImageConverter; |
|
28 class MVcxHgVodThumbnailObserver; |
|
29 class CVcxHgVodThumbnailRequest; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * Utility class for handling thumbnail loading |
|
34 * |
|
35 * @lib vcxhgvodui.lib |
|
36 * @since S60 v5.0 |
|
37 */ |
|
38 NONSHARABLE_CLASS( CVcxHgVodThumbnailManager ): public CBase, |
|
39 public MVcxNsImageConverterObserver |
|
40 { |
|
41 public: |
|
42 |
|
43 static CVcxHgVodThumbnailManager* NewL( RFs& aFsSession ); |
|
44 |
|
45 static CVcxHgVodThumbnailManager* NewLC( RFs& aFsSession ); |
|
46 |
|
47 virtual ~CVcxHgVodThumbnailManager(); |
|
48 |
|
49 /** |
|
50 * Resets the thumbnail fetching buffer from all clients. Ok, as we should have |
|
51 * only one client that actually matters (ie. displays thumbnails on screen). |
|
52 */ |
|
53 void Reset(); |
|
54 |
|
55 /** |
|
56 * Adds a new thumbnail fetching request to buffer. |
|
57 * |
|
58 * @param aObserver Observer which is notified when thumbnail is ready. |
|
59 * @param aThumbnailPath Path to the thumbnail file. |
|
60 * @param aRequestedSize Size of the needed thumbnail. |
|
61 * @param aClientId Client specific unique id for the thumbnail. |
|
62 */ |
|
63 void AddThumbnailRequestL( MVcxHgVodThumbnailObserver& aObserver, |
|
64 const TDesC& aThumbnailPath, TSize aRequestedSize, TInt64 aClientId ); |
|
65 |
|
66 /** |
|
67 * From MVcxNsImageConverterObserver |
|
68 * Notify about completed image conversion. |
|
69 * |
|
70 * @param aError Error code. |
|
71 * @param aIcon Pointer to the created icon, ownership is transferred. |
|
72 * NULL if conversion failed with error. |
|
73 */ |
|
74 void ImageConversionCompletedL( TInt aError, CGulIcon* aIcon ); |
|
75 |
|
76 private: |
|
77 |
|
78 CVcxHgVodThumbnailManager(); |
|
79 |
|
80 void ConstructL( RFs& aFsSession ); |
|
81 |
|
82 private: // data |
|
83 |
|
84 /** |
|
85 * Converts the images to requested size. |
|
86 * Own. |
|
87 */ |
|
88 CVcxNsImageConverter* iImageConverter; |
|
89 |
|
90 /** |
|
91 * Buffer for thumbnail requests. Owns items in array. |
|
92 */ |
|
93 RPointerArray<CVcxHgVodThumbnailRequest> iRequestBuffer; |
|
94 |
|
95 }; |
|
96 |
|
97 #endif // VCXHGVODTHUMBNAILMANAGER_H |