|
1 /* |
|
2 * Copyright (c) 2008-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: Makes the Decision to Create Thumbnail Texture or Icon Texture |
|
15 * Considering Drm Validity and Thumbnail Availabilty |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef _GLXTHUMBNAILVARIANTTYPE_H_ |
|
23 #define _GLXTHUMBNAILVARIANTTYPE_H_ |
|
24 |
|
25 #include <e32base.h> // Container Base Class |
|
26 #include <mul/mulvarianttype.h> // Observer interface used to be notified when texture content changes |
|
27 #include "mglxtextureobserver.h" // Observer interface used to be notified when texture content changes |
|
28 #include <glximageviewermanager.h> |
|
29 |
|
30 class TGlxMedia; // Reference to a media item in the item pool. |
|
31 class CGlxUiUtility; // Alf utils ; lib glxalfutils.lib |
|
32 class TSize; // Stores a two-dimensional size as a width and a height value |
|
33 class CGlxDRMUtility; |
|
34 class CGlxMedia; |
|
35 /** |
|
36 * |
|
37 */ |
|
38 NONSHARABLE_CLASS( GlxThumbnailVariantType ) : public CBase, public |
|
39 Alf::MulVariantType, public MGlxTextureObserver |
|
40 { |
|
41 public: |
|
42 |
|
43 static GlxThumbnailVariantType* NewL( const TGlxMedia& aMedia, const TSize& aSize, |
|
44 TBool aIsFocused = EFalse, TInt aTextureId = KErrNotFound ); |
|
45 |
|
46 static GlxThumbnailVariantType* NewLC( const TGlxMedia& aMedia, const TSize& aSize, |
|
47 TBool aIsFocused = EFalse, TInt aTextureId = KErrNotFound); |
|
48 |
|
49 void ConstructL( const TGlxMedia& aMedia, const TSize& aSize, TBool |
|
50 aIsFocused = EFalse, TInt aTextureId = KErrNotFound); |
|
51 |
|
52 /** constructor |
|
53 * Create via new (EMM) ... */ |
|
54 GlxThumbnailVariantType( const TGlxMedia& aMedia, const TSize& aSize, |
|
55 TBool aIsFocused = EFalse, TInt aTextureId = KErrNotFound); |
|
56 /** destructor */ |
|
57 ~GlxThumbnailVariantType(); |
|
58 |
|
59 void TextureContentChangedL( TBool aHasContent, CAlfTexture* aNewTexture ); |
|
60 |
|
61 Alf::IMulVariantType::TMulType Type() const ; |
|
62 int integer() const ; |
|
63 |
|
64 private: |
|
65 |
|
66 TSize ThumbnailSize(const CGlxMedia* aMedia); |
|
67 |
|
68 /** |
|
69 * Determine if DRM rights need to be consuned based on thumbnail |
|
70 * or visual size |
|
71 * @param aImageSize size of image |
|
72 * @param aBitmapSize bitmap size |
|
73 * @return ETrue if rights are to be consumed |
|
74 */ |
|
75 TBool ConsumeRightsBasedOnSize( TSize aImageSize, |
|
76 TSize aBitmapSize); |
|
77 |
|
78 /** |
|
79 * Determine if the relevant thumbnail is available. |
|
80 * @param aMedia The media item. |
|
81 * @param aSize Size of the Thumbnail. |
|
82 * @return ETrue if the requested size thumbnail present. |
|
83 */ |
|
84 TBool HasRelevantThumbnail(const TGlxMedia& aMedia, |
|
85 const TSize& aSize); |
|
86 /** |
|
87 * Create Image Viewer manager Instance |
|
88 */ |
|
89 void CreateImageViewerInstanceL(); |
|
90 |
|
91 /** |
|
92 * Delete Image Viewer manager Instance |
|
93 */ |
|
94 void DeleteImageViewerInstance(); |
|
95 |
|
96 |
|
97 private: |
|
98 int mTextureId; |
|
99 CGlxUiUtility* iUiUtility; |
|
100 /** Poniter to instance of DRM utility (owned) */ |
|
101 CGlxDRMUtility* iDrmUtility; |
|
102 /** For image viewer, not own */ |
|
103 CGlxImageViewerManager* iImageViewerInstance; |
|
104 }; |
|
105 |
|
106 /** |
|
107 * |
|
108 */ |
|
109 NONSHARABLE_CLASS( GlxIconVariantType ) : public CBase, public Alf::MulVariantType |
|
110 { |
|
111 public: |
|
112 |
|
113 static GlxIconVariantType* NewL( TInt aIconId, TFileName aFileName, const TSize& aSize ); |
|
114 |
|
115 static GlxIconVariantType* NewLC( TInt aIconId, TFileName aFileName, const TSize& aSize ); |
|
116 |
|
117 void ConstructL( TInt aIconId, TFileName aFileName, const TSize& aSize ); |
|
118 |
|
119 /** constructor |
|
120 * Create via new (EMM) ... */ |
|
121 GlxIconVariantType( TInt aIconId, TFileName aFileName, const TSize& aSize ); |
|
122 /** destructor */ |
|
123 ~GlxIconVariantType(); |
|
124 Alf::IMulVariantType::TMulType Type() const ; |
|
125 int integer() const ; |
|
126 |
|
127 private: |
|
128 int mIconId; |
|
129 CGlxUiUtility* iUiUtility; |
|
130 }; |
|
131 #endif // _GLXTHUMBNAILVARIANTTYPE_H_ |