26
|
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: Header for class to implement Single line metapane
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef GLXMETADATACONTROL_H_
|
|
19 |
#define GLXMETADATACONTROL_H_
|
|
20 |
|
|
21 |
#include <alf/alfControl.h>
|
|
22 |
#include <mglxmedialistobserver.h>
|
|
23 |
|
|
24 |
#include "glxfullscreenviewimp.h"
|
|
25 |
|
|
26 |
enum TGlxControlGroupId
|
|
27 |
{
|
|
28 |
//List View
|
|
29 |
EMetaOrinentaionPortrait = 10,
|
|
30 |
EMetaOrinentaionLandscape = 20
|
|
31 |
};
|
|
32 |
|
|
33 |
// Forward decleartion
|
|
34 |
class CAlfEnv;
|
|
35 |
class CAlfAnchorLayout;
|
|
36 |
class CAlfGridLayout;
|
|
37 |
class CAlfDeckLayout;
|
|
38 |
class CAlfImageVisual;
|
|
39 |
class CAlfTextVisual;
|
|
40 |
class CAlfImageBrush;
|
|
41 |
class CAlfBorderBrush;
|
|
42 |
class MGlxMediaList;
|
|
43 |
class CGlxDefaultAttributeContext;
|
|
44 |
class CGlxUiUtility;
|
|
45 |
class TGlxMedia;
|
|
46 |
class CGlxTextureManager;
|
|
47 |
class CGlxSLMPFavMLObserver;
|
|
48 |
|
|
49 |
/*
|
|
50 |
* This is an observer class to observe the favourites attribute change and pass it back to the metapane
|
|
51 |
* for updating its favourite icon
|
|
52 |
*/
|
|
53 |
class MGlxSLMPObserver
|
|
54 |
{
|
|
55 |
public:
|
|
56 |
virtual void HandleUpdateIconL(TBool aModify) = 0;
|
|
57 |
|
|
58 |
};
|
|
59 |
|
|
60 |
|
|
61 |
/*
|
|
62 |
* For craeting and maintaining the Single Line metapane
|
|
63 |
*/
|
|
64 |
class CGlxSingleLineMetaPane: public CAlfControl,
|
|
65 |
public MGlxMediaListObserver,
|
|
66 |
public MGlxSLMPObserver
|
|
67 |
{
|
|
68 |
public:
|
|
69 |
/*
|
|
70 |
* NewL()
|
|
71 |
*/
|
|
72 |
static CGlxSingleLineMetaPane* NewL( CGlxFullScreenViewImp& aFullscreenView,
|
|
73 |
MGlxMediaList& aMediaList, CGlxUiUtility& aUiUtility);
|
|
74 |
|
|
75 |
/*
|
|
76 |
* destructor
|
|
77 |
*/
|
|
78 |
~CGlxSingleLineMetaPane();
|
|
79 |
|
|
80 |
/*
|
|
81 |
* Show/Hide the Metapane
|
|
82 |
*/
|
|
83 |
void ShowMetaPane(TBool aShow);
|
|
84 |
|
|
85 |
public://frm CAlControl
|
|
86 |
TBool OfferEventL(const TAlfEvent &aEvent);
|
|
87 |
|
|
88 |
void VisualLayoutUpdated(CAlfVisual& aVisual);
|
|
89 |
|
|
90 |
public: // from MGlxMediaListObserver
|
|
91 |
void HandleItemAddedL( TInt /*aStartIndex*/, TInt /*aEndIndex*/, MGlxMediaList* /*aList*/ );
|
|
92 |
void HandleItemRemovedL( TInt /*aStartIndex*/, TInt /*aEndIndex*/, MGlxMediaList* /*aList*/);
|
|
93 |
void HandleAttributesAvailableL( TInt aItemIndex,
|
|
94 |
const RArray<TMPXAttribute>& /*aAttributes*/, MGlxMediaList* aList );
|
|
95 |
void HandleFocusChangedL( NGlxListDefs::TFocusChangeType /*aType*/,
|
|
96 |
TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList );
|
|
97 |
void HandleItemSelectedL(TInt /*aIndex*/, TBool /*aSelected*/, MGlxMediaList* /*aList*/ );
|
|
98 |
void HandleMessageL( const CMPXMessage& /*aMessage*/, MGlxMediaList* /*aList*/ );
|
|
99 |
void HandleError( TInt /*aError*/ );
|
|
100 |
void HandleCommandCompleteL( CMPXCommand* /*aCommandResult*/, TInt /*aError*/,
|
|
101 |
MGlxMediaList* /*aList*/ );
|
|
102 |
void HandleMediaL( TInt /*aListIndex*/, MGlxMediaList* /*aList*/ );
|
|
103 |
void HandleItemModifiedL( const RArray<TInt>& /*aItemIndexes*/, MGlxMediaList* /*aList*/ );
|
|
104 |
|
|
105 |
public:// MGlxSLMPObserver
|
|
106 |
virtual void HandleUpdateIconL(TBool aModify);
|
|
107 |
|
|
108 |
private:
|
|
109 |
/*
|
|
110 |
* Constructor
|
|
111 |
*/
|
|
112 |
CGlxSingleLineMetaPane(CGlxFullScreenViewImp& aFullscreenView,
|
|
113 |
MGlxMediaList& aMediaList,CGlxUiUtility& aUiUtility);
|
|
114 |
|
|
115 |
/*
|
|
116 |
* ConstructL()
|
|
117 |
*/
|
|
118 |
void ConstructL();
|
|
119 |
|
|
120 |
/*
|
|
121 |
* Creating the grid
|
|
122 |
*/
|
|
123 |
void CreateGridL();
|
|
124 |
|
|
125 |
/*
|
|
126 |
* Update position
|
|
127 |
*/
|
|
128 |
void UpdatePosition();
|
|
129 |
|
|
130 |
/*
|
|
131 |
* Determines the orientation of the view
|
|
132 |
*/
|
|
133 |
TInt DetermineOrientation(TRect aRect);
|
|
134 |
|
|
135 |
/*
|
|
136 |
* This is called from handleattributes available, it updtates the
|
|
137 |
* metapane values for each item
|
|
138 |
*/
|
|
139 |
void UpdateAttributesInMetaPane(TMPXAttribute aAtrribute,
|
|
140 |
TInt aFocusIndex, const TGlxMedia& item);
|
|
141 |
|
|
142 |
/*
|
|
143 |
* This is called from handleattributes available and focus changed, it updtates the
|
|
144 |
* metapane values for focus item
|
|
145 |
*/
|
|
146 |
void UpdateMetaPaneL(TInt aFocusIndex, MGlxMediaList* aList,
|
|
147 |
TBool aUpdateFavIcon = EFalse);
|
|
148 |
|
|
149 |
/*
|
|
150 |
* This creates the icons for Favourites and Location Icon and then
|
|
151 |
* updates the respective image visuals
|
|
152 |
*/
|
|
153 |
void CreateIconTextureAndUpdateVisualsL();
|
|
154 |
|
|
155 |
TRect GetScreenSize();
|
|
156 |
|
|
157 |
private:
|
|
158 |
CGlxFullScreenViewImp& iFullscreenView; // Fullscreenview
|
|
159 |
MGlxMediaList& iMediaList; // MGlxMedialist passed from FS view
|
|
160 |
CGlxUiUtility& iUiUtility; // CGlxUiUtility passed from FS view
|
|
161 |
CGlxDefaultAttributeContext* iAttribContext; // CGlxDefaultAttributeContext
|
|
162 |
|
|
163 |
CAlfEnv* iEnv; // Alf Env
|
|
164 |
CAlfDisplay* iDisplay; // Alf Display
|
|
165 |
CAlfAnchorLayout* iMainVisual; // Anchor Layout
|
|
166 |
CAlfGridLayout* iGridVisual; // Grid layout
|
|
167 |
CAlfGridLayout* iLocationGridVisual; // Grid layout
|
|
168 |
|
|
169 |
CGlxSLMPFavMLObserver* iSLMPFavMLObserver; // Single line metapane medialist observer
|
|
170 |
|
|
171 |
CAlfImageVisual* iBackgroundBorderImageVisual; // Background Image Visual
|
|
172 |
|
|
173 |
CAlfTextVisual* iDateTextVisual; // Date Text
|
|
174 |
CAlfImageVisual* iFavIconImageVisual; // Location Icon
|
|
175 |
CAlfImageVisual* iLocIconImageVisual; // Size Text
|
|
176 |
CAlfTextVisual* iLocationTextVisual; // Location Text
|
|
177 |
|
|
178 |
CAlfTexture* iFavAddedIconTexture; // Fav Added Icon Texture ( Yellow Icon )
|
|
179 |
CAlfTexture* iFavNotAddedIconTexture; // Fav Not Added Icon Texture ( Black Icon )
|
|
180 |
CAlfBorderBrush* iBorderBrush; // Border brush for background image visual
|
|
181 |
|
|
182 |
TRect iScreenSize; // To store the screen size
|
|
183 |
TBool iFavIconStatus; // ETrue when the item is in favourites else EFalse
|
|
184 |
};
|
|
185 |
|
|
186 |
|
|
187 |
#endif /* GLXMETADATACONTROL_H_ */
|