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: Implementation of Grid view control |
|
15 |
* |
|
16 |
*/ |
|
17 |
#include <AknUtils.h> // For AknLayoutUtils to calculate rect |
|
18 |
#include <glxtracer.h> |
|
19 |
#include <StringLoader.h> |
|
20 |
#include <AknsBasicBackgroundControlContext.h> |
|
21 |
#include <caf/caferr.h> |
|
22 |
#include <eikcolib.h> |
|
23 |
// Ganes Headers |
|
24 |
#include <gulicon.h> // Gul Icons |
|
25 |
#include <ganes/HgItem.h> // HG Items |
|
26 |
#include <ganes/HgGrid.h> // Hg Grid Widget |
|
27 |
||
28 |
// Framework |
|
29 |
#include <data_caging_path_literals.hrh> |
|
30 |
#include <glxcommandhandlers.hrh> // For EGlxCmdFullScreenBack |
|
31 |
#include <glxcollectionpluginall.hrh> // All item collection plugin id |
|
32 |
||
33 |
||
34 |
#include <glxnavigationalstate.h> // For Navigational State |
|
35 |
#include <mglxmedialist.h> // MGlxMediaList, CMPXCollectionPath |
|
36 |
#include <glxuiutility.h> // For UiUtility instance |
|
37 |
#include <glxdrmutility.h> // DRM utility class to provide DRM-related functionality |
|
38 |
#include <glxerrormanager.h> // For CGlxErrormanager |
|
39 |
#include <glxthumbnailattributeinfo.h> // KGlxMediaIdThumbnail |
|
40 |
#include <glxgridviewdata.rsg> // Gridview resource |
|
41 |
#include <glxicons.mbg> // For Corrupted and not created icons |
|
42 |
||
43 |
#include "glxgridviewcontainer.h" |
|
44 |
#include "glxgridviewimp.h" |
|
45 |
#include "glxgridviewmlobserver.h" // medialist observer for Hg Grid |
|
46 |
||
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
47 |
const TInt KNoOfPages(3); |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
48 |
const TInt KBufferTresholdSize(3); // in rows |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
49 |
|
60 | 50 |
// ======== MEMBER FUNCTIONS ======== |
51 |
||
52 |
// --------------------------------------------------------------------------- |
|
53 |
// Two-phased constructor. |
|
54 |
// --------------------------------------------------------------------------- |
|
55 |
// |
|
56 |
CGlxGridViewContainer* CGlxGridViewContainer::NewL(MGlxMediaList *aMediaList, |
|
57 |
CGlxUiUtility* aUiUtility, MGlxGridEventObserver& aObserver, |
|
58 |
CAknToolbar* aToolbar) |
|
59 |
{ |
|
60 |
TRACER("CGlxGridViewContainer::NewL"); |
|
61 |
CGlxGridViewContainer* self = CGlxGridViewContainer::NewLC(aMediaList, |
|
62 |
aUiUtility, aObserver, aToolbar); |
|
63 |
CleanupStack::Pop(self); |
|
64 |
return self; |
|
65 |
} |
|
66 |
||
67 |
// --------------------------------------------------------------------------- |
|
68 |
// Two-phased constructor. |
|
69 |
// --------------------------------------------------------------------------- |
|
70 |
// |
|
71 |
CGlxGridViewContainer* CGlxGridViewContainer::NewLC( |
|
72 |
MGlxMediaList *aMediaList, CGlxUiUtility* aUiUtility, |
|
73 |
MGlxGridEventObserver& aObserver, CAknToolbar* aToolbar) |
|
74 |
{ |
|
75 |
TRACER("CGlxGridViewContainer::NewLC"); |
|
76 |
CGlxGridViewContainer* self = new (ELeave) CGlxGridViewContainer( |
|
77 |
aMediaList, aUiUtility, aObserver, aToolbar); |
|
78 |
CleanupStack::PushL(self); |
|
79 |
self->ConstructL(); |
|
80 |
return self; |
|
81 |
} |
|
82 |
||
83 |
// --------------------------------------------------------------------------- |
|
84 |
// Destructor |
|
85 |
// --------------------------------------------------------------------------- |
|
86 |
// |
|
87 |
CGlxGridViewContainer::~CGlxGridViewContainer() |
|
88 |
{ |
|
89 |
TRACER("CGlxGridViewContainer::~CGlxGridViewContainer"); |
|
90 |
delete iMMCNotifier; |
|
91 |
iMMCNotifier = NULL; |
|
92 |
||
93 |
if(iBgContext) |
|
94 |
{ |
|
95 |
delete iBgContext; |
|
96 |
} |
|
97 |
if(iDRMUtility) |
|
98 |
{ |
|
99 |
iDRMUtility->Close(); |
|
100 |
} |
|
101 |
if (iGlxGridMLObserver) |
|
102 |
{ |
|
103 |
delete iGlxGridMLObserver; |
|
104 |
iGlxGridMLObserver = NULL; |
|
105 |
} |
|
106 |
if (iMediaList) |
|
107 |
{ |
|
108 |
iMediaList->RemoveContext(iThumbnailContext); |
|
109 |
delete iThumbnailContext; |
|
110 |
} |
|
111 |
if(iNavigationalstate) |
|
112 |
{ |
|
113 |
iNavigationalstate->Close(); |
|
114 |
} |
|
115 |
if (iHgGrid) |
|
116 |
{ |
|
117 |
delete iHgGrid; |
|
118 |
iHgGrid = NULL; |
|
119 |
} |
|
120 |
//reset the flag |
|
121 |
iBackwardActivation = EFalse; |
|
122 |
} |
|
123 |
||
124 |
// --------------------------------------------------------------------------- |
|
125 |
// C++ default constructor can NOT contain any code, that |
|
126 |
// might leave. |
|
127 |
// --------------------------------------------------------------------------- |
|
128 |
// |
|
129 |
CGlxGridViewContainer::CGlxGridViewContainer(MGlxMediaList *aMediaList, |
|
130 |
CGlxUiUtility* aUiUtility, MGlxGridEventObserver& aObserver, |
|
131 |
CAknToolbar* aToolbar) : |
|
132 |
iMediaList(aMediaList), iUiUtility(aUiUtility), iGlxGridViewObserver( |
|
133 |
aObserver), iToolbar(aToolbar) |
|
134 |
{ |
|
135 |
TRACER("CGlxGridViewContainer::CGlxGridViewContainer"); |
|
136 |
} |
|
137 |
||
138 |
// --------------------------------------------------------------------------- |
|
139 |
// Symbian 2nd phase constructor can leave. |
|
140 |
// --------------------------------------------------------------------------- |
|
141 |
// |
|
142 |
void CGlxGridViewContainer::ConstructL() |
|
143 |
{ |
|
144 |
TRACER("CGlxGridViewContainer::ConstructL()"); |
|
145 |
//create the container window. |
|
146 |
CreateWindowL(); |
|
147 |
||
148 |
// Making the default FSActivation as false |
|
149 |
iFullscreenViewActivated = EFalse; |
|
150 |
||
151 |
iNavigationalstate = CGlxNavigationalState::InstanceL(); |
|
152 |
||
153 |
//check the navigational direction |
|
154 |
if (iUiUtility->ViewNavigationDirection ()== EGlxNavigationBackwards) |
|
155 |
{ |
|
156 |
iBackwardActivation = ETrue; |
|
157 |
} |
|
158 |
||
159 |
// making the default mode of marking as false |
|
160 |
iMultipleMarkingActive = EFalse; |
|
161 |
||
162 |
iGridIconSize = iUiUtility->GetGridIconSize(); |
|
163 |
||
164 |
iItemsPerPage = iUiUtility->VisibleItemsInPageGranularityL(); |
|
165 |
||
166 |
// For DRM Utility |
|
167 |
iDRMUtility = CGlxDRMUtility::InstanceL(); |
|
168 |
||
169 |
//Clear the last uri for which DRM Rights were consumed |
|
170 |
//since the GridView::Activate() and FullScreen::DeActivate() |
|
171 |
//can be called in any order, this call is being made to be on safer side |
|
172 |
iDRMUtility->ClearLastConsumedItemUriL(); |
|
173 |
||
174 |
// background Skin Context for the skin support |
|
175 |
TRect apRect = iEikonEnv->EikAppUi()->ApplicationRect(); |
|
176 |
iBgContext = CAknsBasicBackgroundControlContext::NewL( |
|
177 |
KAknsIIDQsnBgScreen,apRect,ETrue); |
|
178 |
||
179 |
iQualityTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, |
|
180 |
GlxFullThumbnailAttributeId( ETrue, iGridIconSize.iWidth, |
|
181 |
iGridIconSize.iHeight ) ); |
|
182 |
||
183 |
iSpeedTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, |
|
184 |
GlxFullThumbnailAttributeId( EFalse, iGridIconSize.iWidth, |
|
185 |
iGridIconSize.iHeight ) ); |
|
186 |
CreateGridL(); |
|
187 |
||
188 |
iIsDialogLaunched = EFalse; |
|
189 |
iIsMMCRemoved = EFalse; |
|
190 |
||
191 |
iMMCNotifier = CGlxMMCNotifier::NewL(*this); |
|
192 |
} |
|
193 |
||
194 |
// --------------------------------------------------------------------------- |
|
195 |
// From OfferKeyEventL |
|
196 |
// Default implementation, |
|
197 |
// --------------------------------------------------------------------------- |
|
198 |
// |
|
199 |
TKeyResponse CGlxGridViewContainer::OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType) |
|
200 |
{ |
|
201 |
TRACER("CGlxGridViewContainer::OfferKeyEventL()"); |
|
202 |
TKeyResponse response = EKeyWasNotConsumed; |
|
203 |
CCoeControl::OfferKeyEventL(aKeyEvent,aType); |
|
204 |
if(aType == EEventKey) |
|
205 |
{ |
|
206 |
switch(aKeyEvent.iCode) |
|
207 |
{ |
|
208 |
case EKeyBackspace: |
|
209 |
{ |
|
210 |
iGlxGridViewObserver.HandleGridEventsL(EGlxCmdDelete); |
|
211 |
response = EKeyWasConsumed; |
|
212 |
break; |
|
213 |
} |
|
214 |
default: |
|
215 |
response = EKeyWasNotConsumed; |
|
216 |
break; |
|
217 |
} |
|
218 |
} |
|
219 |
||
220 |
//send the unconsumed events from grid container to hg-grid to handle related key events |
|
221 |
if(response == EKeyWasNotConsumed) |
|
222 |
{ |
|
223 |
response = iHgGrid->OfferKeyEventL(aKeyEvent,aType); |
|
224 |
} |
|
225 |
return response ; |
|
226 |
} |
|
227 |
||
228 |
// --------------------------------------------------------------------------- |
|
229 |
// Release |
|
230 |
// --------------------------------------------------------------------------- |
|
231 |
// |
|
232 |
void CGlxGridViewContainer::Release(TInt /*aBufferStart*/, TInt/* aBufferEnd*/) |
|
233 |
{ |
|
234 |
TRACER("CGlxGridViewContainer::Release()"); |
|
235 |
// This has to do nothing on default |
|
236 |
} |
|
237 |
||
238 |
// --------------------------------------------------------------------------- |
|
239 |
// Request |
|
240 |
// --------------------------------------------------------------------------- |
|
241 |
// |
|
242 |
void CGlxGridViewContainer::Request(TInt aRequestStart, TInt aRequestEnd, |
|
243 |
THgScrollDirection /*aDirection*/) |
|
244 |
{ |
|
245 |
TRACER("CGlxGridViewContainer::Request()"); |
|
246 |
RequestL(aRequestStart, aRequestEnd); |
|
247 |
} |
|
248 |
||
249 |
// --------------------------------------------------------------------------- |
|
250 |
// RequestL |
|
251 |
// --------------------------------------------------------------------------- |
|
252 |
// |
|
253 |
void CGlxGridViewContainer::RequestL(TInt aRequestStart, TInt aRequestEnd) |
|
254 |
{ |
|
255 |
TRACER("CGlxGridViewContainer::RequestL()"); |
|
256 |
TInt visIndex = 0; |
|
257 |
TInt mediaCount = iMediaList->Count(); |
|
258 |
aRequestStart = (aRequestStart<0 ? 0 : aRequestStart) ; |
|
259 |
aRequestEnd = (aRequestEnd>=mediaCount? (mediaCount-1) : aRequestEnd); |
|
260 |
||
261 |
GLX_LOG_INFO3("CGlxGridViewContainer::RequestL - aRequestStart(%d), " |
|
262 |
"aRequestEnd(%d), FirstIndexOnScreen(%d)", aRequestStart, |
|
263 |
aRequestEnd, iHgGrid->FirstIndexOnScreen()); |
|
264 |
GLX_LOG_INFO1("CGlxGridViewContainer::Request - mediaCount(%d)",mediaCount); |
|
265 |
||
266 |
visIndex = iHgGrid->FirstIndexOnScreen(); |
|
267 |
||
268 |
if(visIndex >= mediaCount ) |
|
269 |
{ |
|
270 |
visIndex = mediaCount-1; |
|
271 |
} |
|
272 |
if(visIndex<0 || mediaCount<=0) |
|
273 |
{ |
|
274 |
visIndex = 0; |
|
275 |
} |
|
276 |
GLX_LOG_INFO1("CGlxGridViewContainer::Request - SetVisibleWindowIndex" |
|
277 |
" visIndex(%d)", visIndex); |
|
278 |
iMediaList->SetVisibleWindowIndexL(visIndex); |
|
279 |
||
280 |
if(mediaCount>0) |
|
281 |
{ |
|
282 |
//Set the icons and refresh the screen only when the items are present |
|
283 |
for (TInt i=aRequestStart; i<= aRequestEnd; i++) |
|
284 |
{ |
|
285 |
SetIconsL(i); |
|
286 |
TInt firstIndex = iHgGrid->FirstIndexOnScreen(); |
|
287 |
firstIndex = (firstIndex<0 ? 0 : firstIndex); |
|
288 |
TInt lastOnScreen = firstIndex + iHgGrid->ItemsOnScreen() - 1; |
|
289 |
lastOnScreen = (lastOnScreen >mediaCount-1? mediaCount-1:lastOnScreen); |
|
290 |
if (i == lastOnScreen || (i == aRequestEnd && i < lastOnScreen)) |
|
291 |
{ |
|
292 |
if (HasRelevantThumbnail(i)) |
|
293 |
{ |
|
294 |
GLX_LOG_INFO1("CGlxGridViewContainer::Request - RefreshScreen" |
|
295 |
" lastOnScreen / aRequestEnd i(%d)", i); |
|
296 |
iHgGrid->RefreshScreen(i); |
|
297 |
} |
|
298 |
} |
|
299 |
} |
|
300 |
} |
|
301 |
} |
|
302 |
||
303 |
// ---------------------------------------------------------------------------- |
|
304 |
// HasRelevantThumbnail |
|
305 |
// ---------------------------------------------------------------------------- |
|
306 |
// |
|
307 |
TBool CGlxGridViewContainer::HasRelevantThumbnail(TInt aIndex) |
|
308 |
{ |
|
309 |
TRACER("CGlxGridViewContainer::HasRelevantThumbnail()"); |
|
310 |
const TGlxMedia& item = iMediaList->Item( aIndex ); |
|
311 |
const CGlxThumbnailAttribute* qualityTn = item.ThumbnailAttribute( |
|
312 |
iQualityTnAttrib ); |
|
313 |
const CGlxThumbnailAttribute* speedTn = item.ThumbnailAttribute( |
|
314 |
iSpeedTnAttrib ); |
|
315 |
if ( qualityTn || speedTn ) |
|
316 |
{ |
|
317 |
GLX_LOG_INFO("CGlxGridViewContainer::HasRelevantThumbnail() - TN avail"); |
|
318 |
return ETrue; |
|
319 |
} |
|
320 |
return EFalse; |
|
321 |
} |
|
322 |
||
323 |
// --------------------------------------------------------------------------- |
|
324 |
// HandleSelectL |
|
325 |
// --------------------------------------------------------------------------- |
|
326 |
// |
|
327 |
void CGlxGridViewContainer::HandleSelectL( TInt aIndex ) |
|
328 |
{ |
|
329 |
TRACER("CGlxGridViewContainer::HandleSelectL()"); |
|
330 |
// Map the index of HG Grid and Medialist |
|
331 |
// Make sure that the Selection Index is inside medialist count |
|
332 |
if (aIndex <iMediaList->Count() && aIndex >=0) |
|
333 |
{ |
|
334 |
iMediaList->SetFocusL(NGlxListDefs::EAbsolute, aIndex); |
|
335 |
} |
|
336 |
} |
|
337 |
||
338 |
// --------------------------------------------------------------------------- |
|
339 |
// HandleOpenL |
|
340 |
// --------------------------------------------------------------------------- |
|
341 |
// |
|
342 |
void CGlxGridViewContainer::HandleOpenL( TInt aIndex ) |
|
343 |
{ |
|
344 |
TRACER("CGlxGridViewContainer::HandleOpenL()"); |
|
345 |
// Make sure that the Selection Index is inside medialist count |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
346 |
if (aIndex <iMediaList->Count() && aIndex >=0) |
60 | 347 |
{ |
348 |
if (!(iHgGrid->Flags() && CHgScroller::EHgScrollerSelectionMode)) |
|
349 |
{ |
|
350 |
// If not in marking mode, then open FS view |
|
351 |
iUiUtility->SetViewNavigationDirection(EGlxNavigationForwards); |
|
352 |
//Navigate to the next view |
|
353 |
//Item is selected, go to next view |
|
354 |
HandleEnterKeyEventL((TInt)EAknCmdOpen); |
|
355 |
} |
|
356 |
} |
|
357 |
} |
|
358 |
||
359 |
// ----------------------------------------------------------------------------- |
|
360 |
// HandleEnterKeyEventL |
|
361 |
// ----------------------------------------------------------------------------- |
|
362 |
// |
|
363 |
void CGlxGridViewContainer::HandleEnterKeyEventL(TInt aCommand) |
|
364 |
{ |
|
365 |
TRACER("CGlxGridViewContainer::HandleEnterKeyEventL()"); |
|
366 |
HandleViewCommandL(aCommand); |
|
367 |
} |
|
368 |
||
369 |
// --------------------------------------------------------------------------- |
|
370 |
// HandleMarkingL |
|
371 |
// --------------------------------------------------------------------------- |
|
372 |
// |
|
373 |
void CGlxGridViewContainer::HandleMarkingL( TInt aIndex, TBool aMarked ) |
|
374 |
{ |
|
375 |
TRACER("CGlxGridViewContainer::HandleMarkingL()"); |
|
376 |
HandleMultipleMarkingL(aIndex,aMarked); |
|
377 |
} |
|
378 |
||
379 |
// --------------------------------------------------------------------------- |
|
380 |
// CreateHgGridWidgetL |
|
381 |
// --------------------------------------------------------------------------- |
|
382 |
// |
|
383 |
void CGlxGridViewContainer::CreateHgGridWidgetL() |
|
384 |
{ |
|
385 |
TRACER("CGlxGridViewContainer::CreateHgGridWidgetL()"); |
|
386 |
TInt mediaCount = iMediaList->Count(); |
|
387 |
GLX_DEBUG2("GlxGrid: CHgGrid::CreateHgGridWidgetL() " |
|
388 |
"mediaCount(%d)", mediaCount); |
|
389 |
if (!iHgGrid) |
|
390 |
{ |
|
391 |
iHgGridImageSize = CHgGrid::PreferredImageSize(); |
|
392 |
GLX_DEBUG3("GlxGrid: CHgGrid::PreferredImageSize() w(%d) h(%d)", |
|
393 |
iHgGridImageSize.iWidth, iHgGridImageSize.iHeight); |
|
394 |
iIconsFileName.Append(KDC_APP_BITMAP_DIR); |
|
395 |
iIconsFileName.Append(KGlxIconsFilename); |
|
396 |
||
397 |
// Create Hg grid object |
|
398 |
if (mediaCount) |
|
399 |
{ |
|
400 |
CFbsBitmap* bitmap = NULL; |
|
401 |
CFbsBitmap* mask = NULL; |
|
402 |
AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone, |
|
403 |
bitmap, mask, iIconsFileName, |
|
404 |
EMbmGlxiconsQgn_prop_image_notcreated, |
|
405 |
EMbmGlxiconsQgn_prop_image_notcreated_mask); |
|
406 |
__ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer)); |
|
407 |
__ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer)); |
|
408 |
||
409 |
AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize(), |
|
410 |
EAspectRatioPreservedAndUnusedSpaceRemoved); |
|
411 |
AknIconUtils::SetSize(mask, CHgGrid::PreferredImageSize(), |
|
412 |
EAspectRatioPreservedAndUnusedSpaceRemoved); |
|
413 |
||
414 |
iHgGrid = CHgGrid::NewL(GetHgGridRect(), mediaCount, |
|
415 |
CGulIcon::NewL(bitmap, mask)); |
|
416 |
CleanupStack::Pop(mask); |
|
417 |
CleanupStack::Pop(bitmap); |
|
418 |
||
419 |
for (TInt index=0; index<mediaCount; index++) |
|
420 |
{ |
|
421 |
SetIconsL(index); |
|
422 |
} |
|
423 |
} |
|
424 |
else |
|
425 |
{ |
|
426 |
iHgGrid = CHgGrid::NewL(GetHgGridRect(), mediaCount); |
|
427 |
} |
|
428 |
} |
|
429 |
||
430 |
// Setting to MopParent to update background skin |
|
431 |
iHgGrid->SetMopParent(this); |
|
432 |
// Setting Selction observer for getting callback on key event change |
|
433 |
iHgGrid->SetSelectionObserver(*this); |
|
434 |
||
435 |
// This Displays the scrollbar at the opening of the Grid view |
|
436 |
iHgGrid->SetScrollBarTypeL(CHgScroller::EHgScrollerTimeStrip ); |
|
437 |
||
438 |
// Enable Buffer support |
|
439 |
iHgGrid->EnableScrollBufferL(*this, (KNoOfPages * iItemsPerPage), |
|
440 |
KBufferTresholdSize); |
|
441 |
||
442 |
// Enable Marking support |
|
443 |
iHgGrid->SetMarkingObserver(*this); |
|
444 |
iHgGrid->SetFocus(ETrue); |
|
445 |
/* |
|
446 |
* note: don't push hggrid to the control stack |
|
447 |
*/ |
|
448 |
} |
|
449 |
// --------------------------------------------------------------------------- |
|
450 |
// GetHgGridRect |
|
451 |
// --------------------------------------------------------------------------- |
|
452 |
// |
|
453 |
TRect CGlxGridViewContainer::GetHgGridRect() |
|
454 |
{ |
|
455 |
TRACER("CGlxGridViewContainer::GetHgGridRect()"); |
|
456 |
TRect clientrect = iEikonEnv->EikAppUi()->ClientRect(); |
|
457 |
TRect apprect = iEikonEnv->EikAppUi()->ApplicationRect(); |
|
458 |
if (apprect.Height() > apprect.Width()) |
|
459 |
{ |
|
460 |
//portrait: |
|
461 |
//height : apprect height - (status pane height + toolbar height + cba height) |
|
462 |
//width remains 360. |
|
463 |
clientrect.SetHeight(apprect.Height() - ((clientrect.iTl.iY) |
|
464 |
+ (iToolbar->Size().iHeight) |
|
465 |
+ (iEikonEnv->AppUiFactory()->Cba()->Rect().Height()))); |
|
466 |
} |
|
467 |
else |
|
468 |
{ |
|
469 |
//Landscape: |
|
470 |
//height : apprect - (status pane height + cba height) |
|
471 |
//width : apprect width - toolbarwidth. |
|
472 |
clientrect.SetHeight(apprect.Height() - ((clientrect.iTl.iY) |
|
473 |
+ (iEikonEnv->AppUiFactory()->Cba()->Rect().Height()))); |
|
474 |
clientrect.SetWidth(apprect.Width() - iToolbar->Size().iWidth); |
|
475 |
} |
|
476 |
return clientrect; |
|
477 |
} |
|
478 |
// --------------------------------------------------------------------------- |
|
479 |
// CreateGridL |
|
480 |
// --------------------------------------------------------------------------- |
|
481 |
// |
|
482 |
void CGlxGridViewContainer::CreateGridL() |
|
483 |
{ |
|
484 |
TRACER("CGlxGridViewContainer::CreateGridL()"); |
|
485 |
#ifdef _DEBUG |
|
486 |
TTime startTime; |
|
487 |
GLX_LOG_INFO("CGlxGridViewContainer::CreateGridL(+)"); |
|
488 |
startTime.HomeTime(); |
|
489 |
#endif |
|
490 |
// Set the Grid thumbnail context and iterator |
|
491 |
SetGridThumbnailContextL(); |
|
492 |
// Create HG Grid widget |
|
493 |
CreateHgGridWidgetL(); |
|
494 |
// Create an observer and pass MediaList and HGGrid objects |
|
495 |
CreateGridMediaListObserverL(); |
|
496 |
// Create Grid once again after returning from FS as No calls for handleItem added. |
|
497 |
CreateGridAfterFSDeactivatedL(); |
|
498 |
#ifdef _DEBUG |
|
499 |
TTime stopTime; |
|
500 |
stopTime.HomeTime(); |
|
501 |
GLX_DEBUG2("CGlxGridViewContainer::CreateGridL(-) took <%d> us", |
|
502 |
(TInt)stopTime.MicroSecondsFrom(startTime).Int64()); |
|
503 |
#endif |
|
504 |
} |
|
505 |
||
506 |
// --------------------------------------------------------------------------- |
|
507 |
// SetGridThumbnailContextL |
|
508 |
// --------------------------------------------------------------------------- |
|
509 |
// |
|
510 |
void CGlxGridViewContainer::SetGridThumbnailContextL() |
|
511 |
{ |
|
512 |
TRACER("CGlxGridViewContainer::SetGridThumbnailContextL()"); |
|
513 |
// show static items again |
|
514 |
iMediaList->SetStaticItemsEnabled(ETrue); |
|
515 |
||
516 |
iThumbnailContext = CGlxThumbnailContext::NewL( &iBlockyIterator ); // set the thumbnail context |
|
517 |
iThumbnailContext->SetDefaultSpec( iGridIconSize.iWidth,iGridIconSize.iHeight ); |
|
518 |
iMediaList->AddContextL(iThumbnailContext, KGlxFetchContextPriorityNormal ); |
|
519 |
} |
|
520 |
||
521 |
// --------------------------------------------------------------------------- |
|
522 |
// CreateGridMediaListObserverL |
|
523 |
// --------------------------------------------------------------------------- |
|
524 |
// |
|
525 |
void CGlxGridViewContainer::CreateGridMediaListObserverL() |
|
526 |
{ |
|
527 |
TRACER("CGlxGridViewContainer::CreateGridMediaListObserverL()"); |
|
528 |
// Creating the Medialist observer for HG Grid |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
529 |
iGlxGridMLObserver = CGlxGridViewMLObserver::NewL(*iMediaList, iHgGrid); |
60 | 530 |
} |
531 |
||
532 |
// --------------------------------------------------------------------------- |
|
533 |
// CreateGridAfterFSDeactivatedL |
|
534 |
// On Returning from the FS View, There is no calls to the handle attribut available, |
|
535 |
// So repeating the code to view Grid on FS return |
|
536 |
// --------------------------------------------------------------------------- |
|
537 |
// |
|
538 |
void CGlxGridViewContainer::CreateGridAfterFSDeactivatedL() |
|
539 |
{ |
|
540 |
TRACER("CGlxGridViewContainer::CreateGridAfterFSDeactivatedL()"); |
|
541 |
TInt focusIndex = iMediaList->FocusIndex(); |
|
542 |
GLX_LOG_INFO1("CreateGridAfterFSDeactivatedL() focusIndex=%d", focusIndex); |
|
543 |
||
544 |
if (iBackwardActivation) |
|
545 |
{ |
|
546 |
TInt mlCount = iMediaList->Count(); |
|
547 |
GLX_LOG_INFO1("CreateGridAfterFSDeactivatedL() mlCount=%d", mlCount); |
|
548 |
||
549 |
// Setting the Empty Text |
|
550 |
HBufC* emptyText = |
|
551 |
StringLoader::LoadLC(R_GRID_EMPTY_VIEW_TEXT); |
|
552 |
iHgGrid->SetEmptyTextL(*emptyText); |
|
553 |
CleanupStack::PopAndDestroy(emptyText); |
|
554 |
||
555 |
if (mlCount <= 0) |
|
556 |
{ |
|
557 |
GLX_LOG_INFO("CreateGridAfterFSDeactivatedL() - SetEmptyTextL()"); |
|
558 |
iHgGrid->DrawNow(); |
|
559 |
} |
|
560 |
} |
|
561 |
||
562 |
if (focusIndex != KErrNotFound) |
|
563 |
{ |
|
564 |
iHgGrid->SetSelectedIndex(focusIndex); |
|
565 |
iHgGrid->RefreshScreen(focusIndex); |
|
566 |
} |
|
567 |
iBackwardActivation = EFalse; |
|
568 |
} |
|
569 |
||
570 |
// --------------------------------------------------------------------------- |
|
571 |
// SetIconsL |
|
572 |
// --------------------------------------------------------------------------- |
|
573 |
// |
|
574 |
void CGlxGridViewContainer::SetIconsL(TInt index) |
|
575 |
{ |
|
576 |
TRACER("CGlxGridViewContainer::SetIconsL()"); |
|
577 |
const TGlxMedia& item = iMediaList->Item(index); |
|
578 |
TInt tnError = GlxErrorManager::HasAttributeErrorL( |
|
579 |
item.Properties(), KGlxMediaIdThumbnail ); |
|
580 |
||
581 |
const CGlxThumbnailAttribute* qualityTn = item.ThumbnailAttribute( iQualityTnAttrib ); |
|
582 |
const CGlxThumbnailAttribute* speedTn = item.ThumbnailAttribute( iSpeedTnAttrib ); |
|
583 |
||
584 |
if (qualityTn) |
|
585 |
{ |
|
586 |
CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
|
587 |
bitmap->Duplicate( qualityTn->iBitmap->Handle()); |
|
588 |
iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap)); |
|
589 |
GLX_LOG_INFO1("### CGlxGridViewContainer::SetIconsL qualityTn-Index is %d",index); |
|
590 |
} |
|
591 |
else if (speedTn) |
|
592 |
{ |
|
593 |
CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; |
|
594 |
bitmap->Duplicate( speedTn->iBitmap->Handle()); |
|
595 |
iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap)); |
|
596 |
GLX_LOG_INFO1("### CGlxGridViewContainer::SetIconsL speedTn-Index is %d",index); |
|
597 |
} |
|
598 |
else if ((KErrCANoRights ==tnError) || (KErrDiskFull ==tnError) |
|
599 |
|| (item.Category() == EMPXVideo && KErrNone != tnError)) |
|
600 |
{ |
|
601 |
/* |
|
602 |
* this is a safe code added to show default |
|
603 |
* TNM returns -17452 in case SD DRM files |
|
604 |
* this code is added as coming from other view to |
|
605 |
* gridview,it draws broken TN then the callback goes to |
|
606 |
* glxgridviewobserver and redraws a not-created TN. |
|
607 |
* with this part of code that TN swich will not be visible |
|
608 |
* |
|
609 |
* The same thing is needs to be done for the case when there is no |
|
610 |
* disk space for the thumbnails to be created. |
|
611 |
* In such a case we need to show default thumbnails instead of corrupted. |
|
612 |
* |
|
613 |
*/ |
|
614 |
GLX_LOG_INFO2( |
|
615 |
"CGlxGridViewContainer::SetIconsL - image_defaultthumbnail tnError(%d), i(%d)", |
|
616 |
tnError, index); |
|
617 |
SetIconL(index, EMbmGlxiconsQgn_prop_image_notcreated, |
|
618 |
EMbmGlxiconsQgn_prop_image_notcreated_mask); |
|
619 |
} |
|
620 |
else if(KErrNone != tnError) |
|
621 |
{ |
|
622 |
GLX_LOG_INFO2( |
|
623 |
"CGlxGridViewContainer::SetIconsL - image_corrupted tnError(%d), i(%d)", |
|
624 |
tnError, index); |
|
625 |
SetIconL(index, EMbmGlxiconsQgn_prop_image_corrupted, |
|
626 |
EMbmGlxiconsQgn_prop_image_corrupted_mask); |
|
627 |
} |
|
628 |
||
629 |
if (item.IsDrmProtected()) |
|
630 |
{ |
|
631 |
const TDesC& uri = item.Uri(); |
|
632 |
if( uri.Length() > 0) |
|
633 |
{ |
|
634 |
if(iDRMUtility->IsForwardLockedL(uri)) |
|
635 |
{ |
|
636 |
/* |
|
637 |
* fix for EABI-7RKHDG |
|
638 |
* to show the invalid DRM icon |
|
639 |
*/ |
|
640 |
TMPXGeneralCategory cat = item.Category(); |
|
641 |
TBool checkViewRights = (cat==EMPXImage); |
|
642 |
||
643 |
if(iDRMUtility->ItemRightsValidityCheckL(uri, checkViewRights)) |
|
644 |
{ |
|
645 |
iHgGrid->ItemL(index).SetFlags(CHgItem::EHgItemFlagsDrmRightsValid); |
|
646 |
} |
|
647 |
else |
|
648 |
{ |
|
649 |
iHgGrid->ItemL(index).SetFlags(CHgItem::EHgItemFlagsDrmRightsExpired); |
|
650 |
} |
|
651 |
} |
|
652 |
else |
|
653 |
{ |
|
654 |
TMPXGeneralCategory cat = item.Category(); |
|
655 |
TBool checkViewRights = (cat==EMPXImage); |
|
656 |
||
657 |
if(iDRMUtility->ItemRightsValidityCheckL(uri, checkViewRights)) |
|
658 |
{ |
|
659 |
iHgGrid->ItemL(index).SetFlags(CHgItem::EHgItemFlagsDrmRightsValid); |
|
660 |
} |
|
661 |
else |
|
662 |
{ |
|
663 |
iHgGrid->ItemL(index).SetFlags(CHgItem::EHgItemFlagsDrmRightsExpired); |
|
664 |
} |
|
665 |
} |
|
666 |
} |
|
667 |
} |
|
668 |
TTime time(0); |
|
669 |
if (item.GetDate(time)) |
|
670 |
{ |
|
671 |
iHgGrid->ItemL(index).SetTime(time); |
|
672 |
} |
|
673 |
||
674 |
if (item.Category() == EMPXVideo) |
|
675 |
{ |
|
676 |
iHgGrid->ItemL(index).SetFlags(CHgItem::EHgItemFlagsVideo); |
|
677 |
} |
|
678 |
} |
|
679 |
||
680 |
// ---------------------------------------------------------------------------- |
|
681 |
// SetIconL |
|
682 |
// ---------------------------------------------------------------------------- |
|
683 |
// |
|
684 |
void CGlxGridViewContainer::SetIconL(TInt aItemIndex, TInt aBitmapId, |
|
685 |
TInt aMaskId) |
|
686 |
{ |
|
687 |
TRACER("CGlxGridViewContainer::SetIconL()"); |
|
688 |
CFbsBitmap* bitmap = NULL; |
|
689 |
CFbsBitmap* mask = NULL; |
|
690 |
TSize setSize = CHgGrid::PreferredImageSize(); |
|
691 |
AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone, bitmap, |
|
692 |
mask, iIconsFileName, aBitmapId, aMaskId); |
|
693 |
__ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer)); |
|
694 |
__ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer)); |
|
695 |
||
696 |
AknIconUtils::SetSize(bitmap, setSize, |
|
697 |
EAspectRatioPreservedAndUnusedSpaceRemoved); |
|
698 |
AknIconUtils::SetSize(mask, setSize, |
|
699 |
EAspectRatioPreservedAndUnusedSpaceRemoved); |
|
700 |
||
701 |
iHgGrid->ItemL(aItemIndex).SetIcon(CGulIcon::NewL(bitmap, mask)); |
|
702 |
CleanupStack::Pop(mask); |
|
703 |
CleanupStack::Pop(bitmap); |
|
704 |
} |
|
705 |
||
706 |
// ----------------------------------------------------------------------------- |
|
707 |
// MopSupplyObject |
|
708 |
// To handle Skin support |
|
709 |
// ----------------------------------------------------------------------------- |
|
710 |
// |
|
711 |
TTypeUid::Ptr CGlxGridViewContainer::MopSupplyObject(TTypeUid aId) |
|
712 |
{ |
|
713 |
TRACER("CGlxGridViewContainer::MopSupplyObject()"); |
|
714 |
if (iBgContext) |
|
715 |
{ |
|
716 |
return MAknsControlContext::SupplyMopObject(aId, iBgContext ); |
|
717 |
} |
|
718 |
return CCoeControl::MopSupplyObject( aId ); |
|
719 |
} |
|
720 |
||
721 |
// --------------------------------------------------------------------------- |
|
722 |
// HandleMultipleMarkingL |
|
723 |
// --------------------------------------------------------------------------- |
|
724 |
// |
|
725 |
void CGlxGridViewContainer::HandleMultipleMarkingL(TInt aIndex , TBool aMarked ) |
|
726 |
{ |
|
727 |
TRACER("CGlxGridViewContainer::HandleMultipleMarkingL()"); |
|
728 |
//@ fix for EIZU-7RE43S |
|
729 |
if(!iMediaList->Item(aIndex).IsStatic() && iHgGrid) |
|
730 |
{ |
|
731 |
if(aMarked) |
|
732 |
{ |
|
733 |
iGlxGridViewObserver.HandleGridEventsL(EAknCmdMark) ; |
|
734 |
||
735 |
} |
|
736 |
else |
|
737 |
{ |
|
738 |
iGlxGridViewObserver.HandleGridEventsL(EAknCmdUnmark) ; |
|
739 |
||
740 |
} |
|
741 |
} |
|
742 |
||
743 |
// This check is only implicated when multiple marking mode and we mark static items |
|
744 |
// As Hg Grid marks the items on the screen, we have to unmark the same. |
|
745 |
if (iMediaList->Item(aIndex).IsStatic()) |
|
746 |
{ |
|
747 |
iHgGrid->UnMark(aIndex); |
|
748 |
} |
|
749 |
} |
|
750 |
||
751 |
// --------------------------------------------------------------------------- |
|
752 |
// HandleViewCommandL |
|
753 |
// Command handling function. |
|
754 |
// --------------------------------------------------------------------------- |
|
755 |
TBool CGlxGridViewContainer::HandleViewCommandL(TInt aCommand) |
|
756 |
{ |
|
757 |
TRACER("CGlxGridViewContainer::HandleViewCommandL()"); |
|
758 |
GLX_LOG_INFO1( "CGlxGridViewContainer::HandleViewCommandL(%x) entering", aCommand ); |
|
759 |
||
760 |
TBool retVal = EFalse; |
|
761 |
TInt focusIndex = iMediaList->FocusIndex(); |
|
762 |
switch (aCommand) |
|
763 |
{ |
|
764 |
case EAknCmdOpen: |
|
765 |
{ |
|
766 |
GLX_LOG_INFO( "EAknCmdOpen" ); |
|
767 |
// Activate Fullscreen |
|
768 |
GLX_LOG_INFO("CGlxGridViewContainer::HandleViewCommandL - EAKnCmdOpen received"); |
|
769 |
if ( !iFullscreenViewActivated && !iMultipleMarkingActive && |
|
770 |
focusIndex != KErrNotFound) |
|
771 |
{ |
|
772 |
const TGlxMedia& item = iMediaList->Item(focusIndex); |
|
773 |
const TDesC& uri = item.Uri(); |
|
774 |
||
775 |
if ( item.IsStatic() ) |
|
776 |
{ |
|
777 |
TInt cmd = 0; |
|
778 |
if( item.GetStaticItemCommand(cmd) ) |
|
779 |
{ |
|
780 |
iGlxGridViewObserver.HandleGridEventsL(cmd) ; |
|
781 |
} |
|
782 |
} |
|
783 |
else if(item.Category() == EMPXVideo) |
|
784 |
{ |
|
785 |
//Fix for ESLM-7U58CG - here since we get |
|
786 |
//multiple HandleOpen( ) event on multiple tap |
|
787 |
//we need to guard the event by a flag. |
|
788 |
if(!iIsFSVideoViewActivating) |
|
789 |
{ |
|
790 |
iIsFSVideoViewActivating = ETrue; |
|
791 |
iFullscreenViewActivated = ETrue; |
|
792 |
iGlxGridViewObserver.HandleGridEventsL(EGlxCmdPlay) ; |
|
793 |
iIsFSVideoViewActivating = EFalse; |
|
794 |
} |
|
795 |
} |
|
796 |
else |
|
797 |
{ |
|
798 |
iFullscreenViewActivated = ETrue; |
|
799 |
iNavigationalstate->SetToViewMode(); |
|
800 |
} |
|
801 |
} |
|
802 |
||
803 |
//@ fix for EIZU-7RE43S |
|
804 |
if(iMultipleMarkingActive) |
|
805 |
{ |
|
806 |
//If in marking mode Mark/Unmark the item |
|
807 |
//appropriately. |
|
808 |
if(iMediaList->IsSelected(focusIndex)) |
|
809 |
{ |
|
810 |
iGlxGridViewObserver.HandleGridEventsL(EAknCmdUnmark) ; |
|
811 |
} |
|
812 |
else |
|
813 |
{ |
|
814 |
iGlxGridViewObserver.HandleGridEventsL(EAknCmdMark) ; |
|
815 |
} |
|
816 |
} |
|
817 |
retVal = ETrue; |
|
818 |
break; |
|
819 |
} |
|
820 |
||
821 |
case EAknCmdMark: |
|
822 |
{ |
|
823 |
iHgGrid->SetFlags( CHgScroller::EHgScrollerSelectionMode ); |
|
824 |
//Start Marking mode on grid. |
|
825 |
iMultipleMarkingActive = ETrue; |
|
826 |
//@ fix for EIZU-7RE43S |
|
827 |
iHgGrid->Mark(focusIndex); |
|
828 |
iHgGrid->RefreshScreen(focusIndex); |
|
829 |
retVal = ETrue; |
|
830 |
break; |
|
831 |
} |
|
832 |
||
833 |
case EAknCmdUnmark: |
|
834 |
{ |
|
835 |
//@ fix for EIZU-7RE43S |
|
836 |
iHgGrid->UnMark(focusIndex); |
|
837 |
iHgGrid->RefreshScreen(focusIndex); |
|
838 |
retVal = ETrue; |
|
839 |
break; |
|
840 |
} |
|
841 |
||
842 |
case EAknMarkAll: |
|
843 |
{ |
|
844 |
//Start Marking mode on grid. |
|
845 |
iMultipleMarkingActive = ETrue; |
|
846 |
iHgGrid->SetFlags( CHgScroller::EHgScrollerSelectionMode ); |
|
847 |
iHgGrid->MarkAll(); |
|
848 |
||
849 |
// If the 0th item is static, then it must be downloads, |
|
850 |
// so unmark 0th and 1st item |
|
851 |
// corresponding to image and vieo icons |
|
852 |
const TGlxMedia& item = iMediaList->Item(0); |
|
853 |
if (item.IsStatic()) |
|
854 |
{ |
|
855 |
// Assuming that the first two items are static |
|
856 |
iHgGrid->UnMark(0); |
|
857 |
iHgGrid->UnMark(1); |
|
858 |
} |
|
859 |
// When mark all after some item is marked using toolbar |
|
860 |
// it directly goes to commandhandler, so it returns not |
|
861 |
// consumed after marking medialist |
|
862 |
// and view marks on the display |
|
863 |
// The Check prevents looping from view to mark and vice versa |
|
864 |
// @ fix for ESLM-7TQGMP |
|
865 |
if (iMediaList->SelectionCount() < 1) |
|
866 |
{ |
|
867 |
iGlxGridViewObserver.HandleGridEventsL(aCommand) ; |
|
868 |
} |
|
869 |
retVal = ETrue; |
|
870 |
break; |
|
871 |
} |
|
872 |
||
873 |
case EAknUnmarkAll: |
|
874 |
{ |
|
875 |
if(iHgGrid) |
|
876 |
{ |
|
877 |
iHgGrid->UnMarkAll(); |
|
878 |
iHgGrid->RefreshScreen(iMediaList->Count()-1); |
|
879 |
if (!iMultipleMarkingActive) |
|
880 |
{ |
|
881 |
iHgGrid->ClearFlags( CHgScroller::EHgScrollerSelectionMode ); |
|
882 |
} |
|
883 |
iGlxGridViewObserver.HandleLatchToolbar(); |
|
884 |
iGlxGridViewObserver.HandleGridEventsL(EGlxCmdEndMultipleMarking); |
|
885 |
} |
|
886 |
break; |
|
887 |
} |
|
888 |
||
889 |
case EGlxCmdEndMultipleMarking: |
|
890 |
{ |
|
891 |
iMultipleMarkingActive = EFalse; |
|
892 |
iHgGrid->ClearFlags( CHgScroller::EHgScrollerSelectionMode ); |
|
893 |
// Turn off the marking mode only if the event is from toolbar marking button. |
|
894 |
//Unlatch the mark toolbar button upon exiting the marking mode |
|
895 |
if(iEikonEnv->AppUiFactory()->ToolBar()) |
|
896 |
{ |
|
897 |
// This will unmark the items after adding an album/tag |
|
898 |
// Have to find a better solution and unmark only the items |
|
899 |
// marked and not all, might be a perf hit |
|
900 |
if(iHgGrid) |
|
901 |
{ |
|
902 |
iHgGrid->UnMarkAll(); |
|
903 |
} |
|
904 |
iGlxGridViewObserver.HandleLatchToolbar(); |
|
905 |
} |
|
906 |
retVal = ETrue; |
|
907 |
break; |
|
908 |
} |
|
909 |
||
910 |
case EGlxCmdStartMultipleMarking: |
|
911 |
{ |
|
912 |
if( iHgGrid->Flags() & CHgScroller::EHgScrollerSelectionMode ) |
|
913 |
{ |
|
914 |
iHgGrid->ClearFlags( CHgScroller::EHgScrollerSelectionMode ); |
|
915 |
// Refreshing the items selected after unmark |
|
916 |
for (TInt i= 0;i<iMediaList->SelectionCount();i++) |
|
917 |
{ |
|
918 |
TInt selectedItemIndex = iMediaList->SelectedItemIndex(i); |
|
919 |
iHgGrid->UnMark(selectedItemIndex); |
|
920 |
iHgGrid->RefreshScreen(selectedItemIndex); |
|
921 |
} |
|
922 |
iGlxGridViewObserver.HandleGridEventsL(EGlxCmdEndMultipleMarking) ; |
|
923 |
} |
|
924 |
else |
|
925 |
{ |
|
926 |
//Start Marking mode on grid. |
|
927 |
iMultipleMarkingActive = ETrue; |
|
928 |
iHgGrid->SetFlags(CHgScroller::EHgScrollerSelectionMode); |
|
929 |
} |
|
930 |
retVal = ETrue; |
|
931 |
break; |
|
932 |
} |
|
933 |
||
934 |
case EAknSoftkeyCancel: |
|
935 |
{ |
|
936 |
//@ fix for EIZU-7RE43S |
|
937 |
if( iHgGrid->Flags() & CHgScroller::EHgScrollerSelectionMode ) |
|
938 |
{ |
|
939 |
iGlxGridViewObserver.HandleGridEventsL(EGlxCmdEndMultipleMarking) ; |
|
940 |
} |
|
941 |
retVal = ETrue; |
|
942 |
break; |
|
943 |
||
944 |
} |
|
945 |
case EGlxCmdResetView: |
|
946 |
{ |
|
947 |
//@ fix for ESLM-7VRGKH |
|
948 |
if(iHgGrid) |
|
949 |
{ |
|
950 |
iHgGrid->InitScreenL(GetHgGridRect()); |
|
951 |
} |
|
952 |
if (iIsDialogLaunched && iIsMMCRemoved) |
|
953 |
{ |
|
954 |
iGlxGridViewObserver.HandleGridEventsL(EAknSoftkeyExit); |
|
955 |
} |
|
956 |
retVal = ETrue; |
|
957 |
iIsDialogLaunched = EFalse; |
|
958 |
break; |
|
959 |
} |
|
960 |
case EGlxCmdDialogLaunched: |
|
961 |
{ |
|
962 |
iIsDialogLaunched = ETrue; |
|
963 |
break; |
|
964 |
} |
|
965 |
default: |
|
966 |
break; |
|
967 |
} |
|
968 |
GLX_LOG_INFO("CGlxGridViewContainer::HandleViewCommandL() exiting"); |
|
969 |
return retVal; |
|
970 |
} |
|
971 |
||
972 |
// --------------------------------------------------------------------------- |
|
973 |
// HandleResourceChange |
|
974 |
// Handle BG screen context && Hg grid orientaion |
|
975 |
// --------------------------------------------------------------------------- |
|
976 |
// |
|
977 |
void CGlxGridViewContainer::HandleResourceChange(TInt aId) |
|
978 |
{ |
|
979 |
TRACER("CGlxGridViewContainer::HandleResourceChange()"); |
|
980 |
CCoeControl::HandleResourceChange(aId); |
|
981 |
switch (aId) |
|
982 |
{ |
|
983 |
case KEikDynamicLayoutVariantSwitch: |
|
984 |
{ |
|
985 |
if ( iBgContext ) |
|
986 |
{ |
|
987 |
TRect apRect = iEikonEnv->EikAppUi()->ApplicationRect(); |
|
988 |
iBgContext->SetRect( apRect ); |
|
989 |
} |
|
990 |
if(iHgGrid) |
|
991 |
{ |
|
992 |
TRAP_IGNORE (iHgGrid->InitScreenL(GetHgGridRect());) |
|
993 |
} |
|
994 |
break; |
|
995 |
} |
|
996 |
default: |
|
997 |
break; |
|
998 |
} |
|
999 |
} |
|
1000 |
||
1001 |
// --------------------------------------------------------------------------- |
|
1002 |
// HandleMMCInsertionL |
|
1003 |
// |
|
1004 |
// --------------------------------------------------------------------------- |
|
1005 |
void CGlxGridViewContainer::HandleMMCInsertionL() |
|
1006 |
{ |
|
1007 |
TRACER("CGlxGridViewContainer::HandleMMCInsertionL()"); |
|
1008 |
iGlxGridViewObserver.HandleGridEventsL(EAknSoftkeyClose); |
|
1009 |
} |
|
1010 |
||
1011 |
// --------------------------------------------------------------------------- |
|
1012 |
// HandleMMCRemovalL |
|
1013 |
// |
|
1014 |
// --------------------------------------------------------------------------- |
|
1015 |
void CGlxGridViewContainer::HandleMMCRemovalL() |
|
1016 |
{ |
|
1017 |
TRACER("CGlxGridViewContainer::HandleMMCRemovalL()"); |
|
1018 |
iIsMMCRemoved = ETrue; |
|
1019 |
if(!iIsDialogLaunched) |
|
1020 |
{ |
|
1021 |
iGlxGridViewObserver.HandleGridEventsL(EAknSoftkeyExit); |
|
1022 |
} |
|
1023 |
} |
|
1024 |
//end of file |