|
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 : Grid view Observers |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GLXGRIDVIEWMLOBSERVER_H_ |
|
20 #define GLXGRIDVIEWMLOBSERVER_H_ |
|
21 |
|
22 // Photos Headers |
|
23 #include <mglxmedialistobserver.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CGlxMediaList; |
|
27 class CHgGrid; |
|
28 class CGlxDRMUtility; |
|
29 //class CHgContextUtility; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 class CGlxGridViewMLObserver: public CBase, |
|
33 public MGlxMediaListObserver |
|
34 |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 * |
|
41 * @return Pointer to newly created object. |
|
42 */ |
|
43 IMPORT_C static CGlxGridViewMLObserver* NewL(MGlxMediaList& aMediaList, |
|
44 CHgGrid* aHgGrid); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CGlxGridViewMLObserver(); |
|
50 |
|
51 public: // from MGlxMediaListObserver |
|
52 void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); |
|
53 void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList*/* aList */); |
|
54 void HandleAttributesAvailableL( TInt aItemIndex, |
|
55 const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList ); |
|
56 void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, |
|
57 TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList ); |
|
58 void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList ); |
|
59 void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList ); |
|
60 void HandleError( TInt aError ); |
|
61 void HandleCommandCompleteL( CMPXCommand* aCommandResult, TInt aError, |
|
62 MGlxMediaList* aList ); |
|
63 void HandleMediaL( TInt aListIndex, MGlxMediaList* aList ); |
|
64 void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList ); |
|
65 void HandlePopulatedL( MGlxMediaList* aList ); |
|
66 |
|
67 private: |
|
68 |
|
69 /** |
|
70 * C++ default constructor. |
|
71 */ |
|
72 CGlxGridViewMLObserver(MGlxMediaList& aMediaList,CHgGrid* aHgGrid); |
|
73 |
|
74 /** |
|
75 * By default Symbian 2nd phase constructor is private. |
|
76 */ |
|
77 void ConstructL(); |
|
78 |
|
79 /** |
|
80 * HandleErrorL is added to make the compiler happy by reducing codescanner warnings |
|
81 * No extra purpose |
|
82 */ |
|
83 void HandleErrorL(); |
|
84 |
|
85 /** |
|
86 * Checks the availability of relevant thumbnail(Quality or Speed) attribute |
|
87 * @param aIndex Media index to check the thumbnail attribute |
|
88 * @return ETrue if relevant thumbnail available |
|
89 * EFalse if relevant thumbnail not available |
|
90 */ |
|
91 TBool HasRelevantThumbnail(TInt aIndex); |
|
92 |
|
93 /** |
|
94 * RefreshScreen - Refreshes the Hg Grid based on the attributes available index |
|
95 * |
|
96 */ |
|
97 void RefreshScreen(TInt aItemIndex,const RArray<TMPXAttribute>& aAttributes); |
|
98 |
|
99 /** |
|
100 * UpdateItemsL - Update the items with the DRM/video icon and date/time |
|
101 * |
|
102 */ |
|
103 void UpdateItemsL (TInt aItemIndex,const RArray<TMPXAttribute>& aAttributes); |
|
104 |
|
105 private: |
|
106 |
|
107 MGlxMediaList& iMediaList; |
|
108 |
|
109 // Instance of HG Grid |
|
110 CHgGrid* iHgGrid; |
|
111 |
|
112 // Provides DRM related functionality |
|
113 CGlxDRMUtility* iDRMUtility; |
|
114 |
|
115 TSize iGridIconSize; |
|
116 |
|
117 //No of visible items in a page/view |
|
118 TInt iItemsPerPage; |
|
119 |
|
120 // Flag to indicate the downloads plugin |
|
121 TBool iDownloadsPlugin; |
|
122 |
|
123 // Modified Indexes array to refresh the screen |
|
124 RArray<TInt> iModifiedIndexes; |
|
125 |
|
126 // CHgContextUtility* iContextUtility; |
|
127 |
|
128 //Grid Thumbnail Attribs |
|
129 TMPXAttribute iQualityTnAttrib; |
|
130 TMPXAttribute iSpeedTnAttrib; |
|
131 }; |
|
132 #endif //GLXGRIDVIEWMLOBSERVER_H_ |