author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:32:09 +0300 | |
branch | RCL_3 |
changeset 75 | 01504893d9cb |
parent 60 | 5b3385a43d68 |
permissions | -rw-r--r-- |
60 | 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 |
#include <glxfiltergeneraldefs.h> |
|
25 |
||
26 |
// FORWARD DECLARATIONS |
|
27 |
class CGlxMediaList; |
|
28 |
class CHgGrid; |
|
29 |
class CGlxDRMUtility; |
|
30 |
//class CHgContextUtility; |
|
31 |
||
32 |
// CLASS DECLARATION |
|
33 |
class CGlxGridViewMLObserver: public CBase, |
|
34 |
public MGlxMediaListObserver |
|
35 |
||
36 |
{ |
|
37 |
public: |
|
38 |
||
39 |
/** |
|
40 |
* Two-phased constructor. |
|
41 |
* |
|
42 |
* @return Pointer to newly created object. |
|
43 |
*/ |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
44 |
IMPORT_C static CGlxGridViewMLObserver* NewL(MGlxMediaList& aMediaList, |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
45 |
CHgGrid* aHgGrid, TGlxFilterItemType aFilterType = |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
46 |
EGlxFilterVideoAndImages); |
60 | 47 |
|
48 |
/** |
|
49 |
* Destructor. |
|
50 |
*/ |
|
51 |
virtual ~CGlxGridViewMLObserver(); |
|
52 |
||
53 |
public: // from MGlxMediaListObserver |
|
54 |
void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); |
|
55 |
void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList*/* aList */); |
|
56 |
void HandleAttributesAvailableL( TInt aItemIndex, |
|
57 |
const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList ); |
|
58 |
void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, |
|
59 |
TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList ); |
|
60 |
void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList ); |
|
61 |
void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList ); |
|
62 |
void HandleError( TInt aError ); |
|
63 |
void HandleCommandCompleteL( CMPXCommand* aCommandResult, TInt aError, |
|
64 |
MGlxMediaList* aList ); |
|
65 |
void HandleMediaL( TInt aListIndex, MGlxMediaList* aList ); |
|
66 |
void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList ); |
|
67 |
void HandlePopulatedL( MGlxMediaList* aList ); |
|
68 |
||
69 |
private: |
|
70 |
||
71 |
/** |
|
72 |
* C++ default constructor. |
|
73 |
*/ |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
74 |
CGlxGridViewMLObserver(MGlxMediaList& aMediaList, CHgGrid* aHgGrid, |
60 | 75 |
TGlxFilterItemType aFilterType); |
76 |
||
77 |
/** |
|
78 |
* By default Symbian 2nd phase constructor is private. |
|
79 |
*/ |
|
80 |
void ConstructL(); |
|
81 |
||
82 |
/** |
|
83 |
* HandleErrorL is added to make the compiler happy by reducing codescanner warnings |
|
84 |
* No extra purpose |
|
85 |
*/ |
|
86 |
void HandleErrorL(); |
|
87 |
||
88 |
/** |
|
89 |
* Checks the availability of relevant thumbnail(Quality or Speed) attribute |
|
90 |
* @param aIndex Media index to check the thumbnail attribute |
|
91 |
* @return ETrue if relevant thumbnail available |
|
92 |
* EFalse if relevant thumbnail not available |
|
93 |
*/ |
|
94 |
TBool HasRelevantThumbnail(TInt aIndex); |
|
95 |
||
96 |
/** |
|
97 |
* RefreshScreenL - Refreshes the Hg Grid based on the attributes available index |
|
98 |
* |
|
99 |
*/ |
|
100 |
void RefreshScreenL(TInt aItemIndex,const RArray<TMPXAttribute>& aAttributes); |
|
101 |
||
102 |
/** |
|
103 |
* UpdateItemsL - Update the items with the DRM/video icon and date/time |
|
104 |
* |
|
105 |
*/ |
|
106 |
void UpdateItemsL (TInt aItemIndex,const RArray<TMPXAttribute>& aAttributes); |
|
107 |
||
108 |
/** |
|
109 |
* DisplayErrorNoteL - Show an error note based on input parameter |
|
110 |
* @param aError The error based on which the error note is to be shown. |
|
111 |
*/ |
|
112 |
void DisplayErrorNoteL(TInt aError); |
|
113 |
||
114 |
/** |
|
115 |
* SetDefaultIconL - Sets the default icon for grid. |
|
116 |
* @param aTransparent - ETrue to set transparent icon; EFalse to set default icon. |
|
117 |
*/ |
|
118 |
void SetDefaultIconL(TBool aTransparent); |
|
119 |
||
120 |
/** |
|
121 |
* SetIconL - Sets the grid cell icon with the given parameters |
|
122 |
* @param aItemIndex - The grid cell index |
|
123 |
* @param aBitmapId - The bitmap id |
|
124 |
* @param aMaskId - The mask id |
|
125 |
* @param aFlags - The indicator flags |
|
126 |
*/ |
|
127 |
void SetIconL(TInt aItemIndex, TInt aBitmapId, TInt aMaskId, TInt aFlags); |
|
128 |
||
129 |
private: |
|
130 |
||
131 |
MGlxMediaList& iMediaList; |
|
132 |
||
133 |
// Instance of HG Grid |
|
134 |
CHgGrid* iHgGrid; |
|
135 |
||
136 |
// Provides DRM related functionality |
|
137 |
CGlxDRMUtility* iDRMUtility; |
|
138 |
||
139 |
TSize iGridIconSize; |
|
140 |
||
141 |
// The Resource file name from which icons to be read |
|
142 |
TFileName iIconsFileName; |
|
143 |
||
144 |
//No of visible items in a page/view |
|
145 |
TInt iItemsPerPage; |
|
146 |
||
147 |
//Flag to indicate the grid default icon set status |
|
148 |
TBool iIsDefaultIconSet; |
|
149 |
||
150 |
// Variable to check if the error in disk (e.g disk error) has been shown to the user. |
|
151 |
// If a disk is full the user should not be intimated everytime over and over again. |
|
152 |
TInt iDiskErrorIntimated; |
|
153 |
||
154 |
// Modified Indexes array to refresh the screen |
|
155 |
RArray<TInt> iModifiedIndexes; |
|
156 |
||
157 |
//Grid Thumbnail Attribs |
|
158 |
TMPXAttribute iQualityTnAttrib; |
|
159 |
TMPXAttribute iSpeedTnAttrib; |
|
160 |
// Filtertype, Image / Video |
|
161 |
TGlxFilterItemType iFilterType; |
|
162 |
}; |
|
163 |
#endif //GLXGRIDVIEWMLOBSERVER_H_ |