|
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 control class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CGLXGRIDVIEWCONTROL_H |
|
22 #define CGLXGRIDVIEWCONTROL_H |
|
23 |
|
24 #include <coecntrl.h> |
|
25 // Ganes observerers |
|
26 #include <ganes/HgScrollBufferObserverIface.h> |
|
27 #include <ganes/HgSelectionObserverIface.h> |
|
28 #include <ganes/HgMarkingObserverIface.h> |
|
29 |
|
30 // Photos Headers |
|
31 #include <mglxmedialistprovider.h> |
|
32 #include <glxmedialistiterator.h> // Interface for going through items in |
|
33 #include <glxmedialistfactory.h> // MGlxMediaListFactory |
|
34 |
|
35 #include <glxthumbnailcontext.h> |
|
36 #include <glxuistd.h> |
|
37 #include "glxgridvieweventobserver.h" |
|
38 |
|
39 class CHgGrid; |
|
40 class CGlxUiUtility; |
|
41 class CGlxGridViewMLObserver; |
|
42 class CGlxActiveMediaListRegistry; |
|
43 class CGlxThumbnailContext; |
|
44 class CGlxDRMUtility; |
|
45 class CAknsBasicBackgroundControlContext; |
|
46 class CGlxNavigationalState; |
|
47 |
|
48 //class declaration |
|
49 |
|
50 class CGlxGridViewContainer : public CCoeControl, |
|
51 public MHgScrollBufferObserver, |
|
52 public MHgSelectionObserver, |
|
53 public MHgMarkingObserver |
|
54 { |
|
55 public: |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * |
|
59 * @since 3.0 |
|
60 * @return Pointer to newly created object. |
|
61 */ |
|
62 static CGlxGridViewContainer *NewL(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver ); |
|
63 |
|
64 /** |
|
65 * Two-phased constructor. |
|
66 * |
|
67 * @since 3.0 |
|
68 * @return Pointer to newly created object. |
|
69 */ |
|
70 static CGlxGridViewContainer *NewLC(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver); |
|
71 |
|
72 //destructor |
|
73 ~CGlxGridViewContainer(); |
|
74 |
|
75 |
|
76 TBool HandleViewCommandL(TInt aCommand); |
|
77 protected: // from MHgScrollBufferObserver |
|
78 void Request(TInt aRequestStart, TInt aRequestEnd, THgScrollDirection aDirection); |
|
79 void Release(TInt aReleaseStart, TInt aReleaseEnd); |
|
80 |
|
81 protected: // from MHgSelectionObserver |
|
82 void HandleSelectL( TInt aIndex ); |
|
83 void HandleOpenL( TInt aIndex ); |
|
84 |
|
85 protected: // from MHgMarkingObserver |
|
86 |
|
87 void HandleMarkingL( TInt aIndex, TBool aMarked ); |
|
88 |
|
89 public: // From CCoeControl |
|
90 |
|
91 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
92 TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType); |
|
93 |
|
94 //handle orientaion realted changes |
|
95 void HandleResourceChange(TInt aType); |
|
96 private: |
|
97 /** |
|
98 * C++ default constructor. |
|
99 */ |
|
100 CGlxGridViewContainer(MGlxMediaList *aMediaList,CGlxUiUtility* aUiUtility,MGlxGridEventObserver& aObserver); |
|
101 /** |
|
102 * By default Symbian 2nd phase constructor is private. |
|
103 */ |
|
104 void ConstructL(); |
|
105 |
|
106 void RequestL(TInt aRequestStart, TInt aRequestEnd); |
|
107 |
|
108 //create grid |
|
109 void CreateGridL(); |
|
110 |
|
111 /** |
|
112 * Set grid thumbnail context with BlokyIterator to fetch |
|
113 * grid thumbnails |
|
114 */ |
|
115 void SetGridThumbnailContextL(); |
|
116 |
|
117 // Create HG Grid widget |
|
118 void CreateHgGridWidgetL(); |
|
119 |
|
120 // Create an observer and pass MediaList and HGGrid objects |
|
121 void CreateGridMediaListObserverL(); |
|
122 |
|
123 // Create Grid once again after returning from FS as No calls for handleItem added. |
|
124 void CreateGridAfterFSDeactivatedL(); |
|
125 /** |
|
126 * Set FS thumbnail context with FromFocusOutwardIterator |
|
127 * for FS thumbnails |
|
128 */ |
|
129 void FetchFSThumbnailL(); |
|
130 /** |
|
131 * Set the Time stamp for Scrollbar Time Strip |
|
132 */ |
|
133 void SetDownloadLinksTimeL(); |
|
134 /** |
|
135 * Removes the thumbnail contexts for FS |
|
136 */ |
|
137 void RemoveFSThumbnailContext(); |
|
138 /** |
|
139 * Handle Multiple marking |
|
140 */ |
|
141 void HandleMultipleMarkingL(TInt aIndex , TBool aMarked ); |
|
142 /** |
|
143 * Set the Icons |
|
144 */ |
|
145 void SetIconsL(TInt index); |
|
146 |
|
147 //handle enterkey realted events |
|
148 void HandleEnterKeyEventL(TInt aCommand); |
|
149 |
|
150 /** |
|
151 * Checks the availability of relevant thumbnail(Quality or Speed) attribute |
|
152 * @param aIndex Media index to check the thumbnail attribute |
|
153 * @return ETrue if relevant thumbnail available |
|
154 * EFalse if relevant thumbnail not available |
|
155 */ |
|
156 TBool HasRelevantThumbnail(TInt aIndex); |
|
157 |
|
158 private: |
|
159 //medialist |
|
160 MGlxMediaList* iMediaList; // MGlxMedialist , to Create MediaList |
|
161 |
|
162 //Drmutility |
|
163 CGlxUiUtility* iUiUtility; |
|
164 |
|
165 //No of visible items in a page/view |
|
166 TInt iItemsPerPage; |
|
167 |
|
168 // HG Grid instance |
|
169 CHgGrid* iHgGrid; |
|
170 |
|
171 // Medialist observer for Grid view |
|
172 CGlxGridViewMLObserver* iGlxGridMLObserver; |
|
173 |
|
174 /// Active media list registry stores the pointer to the active media list |
|
175 /// Allows UPnP to know when list has changed |
|
176 CGlxActiveMediaListRegistry* iActiveMediaListRegistry; |
|
177 |
|
178 // Thumbnail context |
|
179 CGlxThumbnailContext* iThumbnailContext; |
|
180 |
|
181 // FS thumbnail context |
|
182 CGlxThumbnailContext* iFsThumbnailContext; |
|
183 |
|
184 // Iterators for Grid and FS |
|
185 TGlxFromManualIndexBlockyIterator iBlockyIterator; |
|
186 TGlxFromFocusOutwardIterator iFsFromFocusOutwardIterator; |
|
187 |
|
188 // Grid Icon size from FS view |
|
189 TSize iGridIconSize; |
|
190 |
|
191 // Flag to indicate the downloads plugin |
|
192 TBool iDownloadsPlugin; |
|
193 |
|
194 // Bool to check backward navigation |
|
195 TBool iBackwardActivation; |
|
196 |
|
197 // Provides DRM related functionality |
|
198 CGlxDRMUtility* iDRMUtility; |
|
199 |
|
200 // Background context for the themes to be used in MopSupplyObject |
|
201 CAknsBasicBackgroundControlContext* iBgContext; //Own |
|
202 |
|
203 //Grid Thumbnail Attribs |
|
204 TMPXAttribute iQualityTnAttrib; |
|
205 TMPXAttribute iSpeedTnAttrib; |
|
206 |
|
207 // Making the default FSActivation as false |
|
208 TBool iFullscreenViewActivated; |
|
209 |
|
210 // Navigational state need to be changed while launching fullscreen |
|
211 CGlxNavigationalState* iNavigationalstate; |
|
212 |
|
213 // making the default mode of marking as false |
|
214 TBool iMultipleMarkingActive ; |
|
215 |
|
216 //flag to prevent call to HandleOpen( ) on multiple tap for video |
|
217 TBool iIsFSVideoViewActivating; |
|
218 |
|
219 //observer |
|
220 MGlxGridEventObserver& iGlxGridViewObserver; |
|
221 }; |
|
222 |
|
223 #endif // CGLXGRIDVIEWCONTROL_H |
|
224 |