|
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 Single Line metapane for Fulscreen view |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // Avkon Headers |
|
20 #include <stringloader.h> // String loader |
|
21 #include <data_caging_path_literals.hrh> // KDC_APP_RESOURCE_DIR |
|
22 #include <pathinfo.h> // For Path info |
|
23 #include <driveinfo.h> // Added for DriveInfo class |
|
24 #include <avkon.rsg> // Added for R_QTN_DATE_USUAL_WITH_ZERO |
|
25 #include <akntoolbar.h> |
|
26 |
|
27 // Alf Headers |
|
28 #include <alf/alfenv.h> |
|
29 #include <alf/alfgridlayout.h> |
|
30 #include <alf/alfanchorlayout.h> |
|
31 #include <alf/alfcontrolgroup.h> |
|
32 #include <alf/alfroster.h> |
|
33 #include <alf/alftexture.h> |
|
34 #include <alf/alfimage.h> |
|
35 #include <alf/alfimagevisual.h> |
|
36 #include <alf/alftextvisual.h> |
|
37 #include <alf/alflinevisual.h> |
|
38 #include <alf/alfutil.h> |
|
39 #include <alf/alfevent.h> |
|
40 #include <alf/alfbrusharray.h> |
|
41 #include <alf/alfborderbrush.h> |
|
42 |
|
43 // Photos Headers |
|
44 #include <glxtracer.h> // Tracer logs |
|
45 #include <glxlog.h> // Glx logs |
|
46 #include <mglxmedialist.h> // CGlxMedialist |
|
47 #include <glxustringconverter.h> // Converts the symbian types to UString type |
|
48 #include <glxattributecontext.h> // Attribute context |
|
49 #include <glxuistd.h> // Attribute fetch priority |
|
50 #include <glxuiutility.h> // UiUtility Singleton |
|
51 #include <glxfullscreenviewdata.rsg> // FS resource |
|
52 #include <glxicons.mbg> // icons |
|
53 #include <glxtexturemanager.h> // Texturemanager |
|
54 #include <glxcommandhandlers.hrh> // Commandhandlers |
|
55 #include <glxgeneraluiutilities.h> // General utilties class definition |
|
56 #include <glxslmpfavmlobserver.h> |
|
57 |
|
58 // User Includes |
|
59 #include <glxsinglelinemetapanecontrol.h> // User include |
|
60 |
|
61 // Contants and Literals |
|
62 const TInt KGlxFullScreenControlGrpId =0x113; // This is the same control grp id used in FS view |
|
63 const TInt KGridColoumns = 4; |
|
64 const TInt KGridRows = 1; |
|
65 const TReal KOpacityOpaque = 1.0; |
|
66 const TReal KOpacityTransparent = 0.0; |
|
67 |
|
68 _LIT(KEmptyText, ""); |
|
69 _LIT(KFormat, " "); |
|
70 _LIT8(KTagLoc, "Loc"); |
|
71 _LIT8(KTagFav, "Fav"); |
|
72 |
|
73 // --------------------------------------------------------------------------- |
|
74 // NewL |
|
75 // --------------------------------------------------------------------------- |
|
76 // |
|
77 CGlxSingleLineMetaPane* CGlxSingleLineMetaPane::NewL(CGlxFullScreenViewImp& aFullscreenView, |
|
78 MGlxMediaList& aMediaList, CGlxUiUtility& aUiUtility) |
|
79 { |
|
80 TRACER("CGlxSingleLineMetaPane* CGlxSingleLineMetaPane::NewL()"); |
|
81 CGlxSingleLineMetaPane* self = new (ELeave) CGlxSingleLineMetaPane(aFullscreenView, |
|
82 aMediaList, aUiUtility); |
|
83 CleanupStack::PushL(self); |
|
84 self->ConstructL(); |
|
85 CleanupStack::Pop(self); |
|
86 return self; |
|
87 } |
|
88 |
|
89 // --------------------------------------------------------------------------- |
|
90 // CGlxSingleLineMetaPane() constructor |
|
91 // --------------------------------------------------------------------------- |
|
92 // |
|
93 CGlxSingleLineMetaPane::CGlxSingleLineMetaPane(CGlxFullScreenViewImp& aFullscreenView, |
|
94 MGlxMediaList& aMediaList, CGlxUiUtility& aUiUtility) :iFullscreenView(aFullscreenView), |
|
95 iMediaList(aMediaList), iUiUtility(aUiUtility) |
|
96 { |
|
97 TRACER("CGlxSingleLineMetaPane* CGlxSingleLineMetaPane::NewL()"); |
|
98 // No Implementation |
|
99 } |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // ConstructL |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 void CGlxSingleLineMetaPane::ConstructL() |
|
106 { |
|
107 TRACER("CGlxSingleLineMetaPane::ConstructL()"); |
|
108 // Construct the base class. |
|
109 // Get the icon file |
|
110 TFileName resFile(KDC_APP_BITMAP_DIR); |
|
111 resFile.Append(KGlxIconsFilename); |
|
112 |
|
113 iEnv = iUiUtility.Env(); |
|
114 CAlfControl::ConstructL(*iEnv); |
|
115 |
|
116 CAlfTexture& backgroundTexture = iUiUtility.GlxTextureManager().CreateIconTextureL( |
|
117 EMbmGlxiconsQgn_lgal_bg, resFile ) ; |
|
118 //----------------------- LAYOUT HIERARCHY ------------------------------- |
|
119 // |
|
120 // ->iDateTextVisual |
|
121 // | |
|
122 // | |
|
123 // |->iFavIconImageVisual |
|
124 // | |
|
125 // iMainVisual-->iGridVisual-> |
|
126 // |->iMapIconImageVisual |
|
127 // | |
|
128 // | |
|
129 // ->iLocationTextVisual |
|
130 //------------------------------------------------------------------------- |
|
131 |
|
132 iMainVisual = CAlfAnchorLayout::AddNewL(*this); |
|
133 |
|
134 // BackGround Border Image Visual |
|
135 iBackgroundBorderImageVisual = CAlfImageVisual::AddNewL(*this,iMainVisual); |
|
136 iBackgroundBorderImageVisual->EnableBrushesL(); |
|
137 iBackgroundBorderImageVisual->SetImage(TAlfImage(backgroundTexture)); |
|
138 |
|
139 iBackgroundBorderImageVisual->SetOpacity( 0.6 ); |
|
140 |
|
141 iGridVisual = CAlfGridLayout::AddNewL(*this, KGridColoumns, KGridRows, iMainVisual); |
|
142 CAlfControlGroup* group =&iEnv->ControlGroup(KGlxFullScreenControlGrpId); |
|
143 group->AppendL(this); |
|
144 |
|
145 // Create a 1 pixel Border brush and append it to the background visual |
|
146 CAlfBorderBrush* borderBrush= CAlfBorderBrush::NewLC(*iEnv, 1, 1, 0, 0); |
|
147 borderBrush->SetColor(KRgbWhite); |
|
148 iBackgroundBorderImageVisual->Brushes()->AppendL(borderBrush, EAlfHasOwnership); |
|
149 CleanupStack::Pop(borderBrush); |
|
150 |
|
151 iMediaList.AddMediaListObserverL( this ); |
|
152 // Set up and add the context |
|
153 iAttribContext = CGlxDefaultAttributeContext::NewL(); |
|
154 // add all the attributes needed in handleattributes available |
|
155 // this is because even |
|
156 iAttribContext->AddAttributeL( KMPXMediaGeneralDate ); |
|
157 iAttribContext->AddAttributeL( KGlxMediaGeneralLocation ); |
|
158 |
|
159 // Using priority as same as UMP view's album pane |
|
160 iMediaList.AddContextL( iAttribContext, KGlxFetchContextPriorityLow ); |
|
161 |
|
162 // Hide the Metapane at the initial start up, to avoid flicker |
|
163 ShowMetaPane(EFalse); |
|
164 |
|
165 CreateGridL(); |
|
166 |
|
167 iMainVisual->SetFlag(EAlfVisualFlagManualLayout); |
|
168 |
|
169 // Update the pos and size of the visual |
|
170 UpdatePosition(); |
|
171 |
|
172 // Create the Metapane |
|
173 iSLMPFavMLObserver = CGlxSLMPFavMLObserver::NewL(*this, iMediaList.FocusIndex(), &iMediaList); |
|
174 |
|
175 // Update the Grid Visuals with initial Data |
|
176 UpdateMetaPaneL(iMediaList.FocusIndex(), &iMediaList, ETrue); |
|
177 // Setting the Flag to get layout change notifications |
|
178 iMainVisual->SetFlag ( EAlfVisualFlagLayoutUpdateNotification); |
|
179 |
|
180 // Store the Current Screensize |
|
181 iScreenSize = GetScreenSize(); |
|
182 } |
|
183 |
|
184 // --------------------------------------------------------------------------- |
|
185 // ~CGlxSingleLineMetaPane Destructor |
|
186 // --------------------------------------------------------------------------- |
|
187 // |
|
188 CGlxSingleLineMetaPane::~CGlxSingleLineMetaPane() |
|
189 { |
|
190 TRACER("CGlxSingleLineMetaPane::~CGlxSingleLineMetaPane()"); |
|
191 iMediaList.RemoveMediaListObserver(this); |
|
192 if( iAttribContext ) |
|
193 { |
|
194 iMediaList.RemoveContext( iAttribContext ); |
|
195 delete iAttribContext; |
|
196 } |
|
197 if (iMainVisual) |
|
198 { |
|
199 iMainVisual->RemoveAndDestroyAllD(); |
|
200 iMainVisual = NULL; |
|
201 } |
|
202 if (iSLMPFavMLObserver) |
|
203 { |
|
204 delete iSLMPFavMLObserver; |
|
205 iSLMPFavMLObserver= NULL; |
|
206 } |
|
207 } |
|
208 |
|
209 // --------------------------------------------------------------------------- |
|
210 // CreateIconTextureAndUpdateVisualsL |
|
211 // --------------------------------------------------------------------------- |
|
212 // |
|
213 void CGlxSingleLineMetaPane::CreateIconTextureAndUpdateVisualsL() |
|
214 { |
|
215 TRACER("CGlxSingleLineMetaPane::CreateIconTextureAndUpdateVisualsL()"); |
|
216 // Get the icon file |
|
217 TFileName resFile(KDC_APP_BITMAP_DIR); |
|
218 resFile.Append(KGlxIconsFilename); |
|
219 CGlxTextureManager& tm = (iUiUtility.GlxTextureManager()); |
|
220 //Create the texture for broken thumbnail |
|
221 iFavNotAddedIconTexture = &(tm.CreateIconTextureL( |
|
222 EMbmGlxiconsQgn_lgal_fav2, resFile ) ) ; |
|
223 iFavAddedIconTexture = &(tm.CreateIconTextureL( |
|
224 EMbmGlxiconsQgn_lgal_fav1, resFile ) ); |
|
225 CAlfTexture& locIconTexture = tm.CreateIconTextureL( |
|
226 EMbmGlxiconsQgn_menu_maps, resFile ) ; |
|
227 iLocIconImageVisual->SetImage(TAlfImage(locIconTexture)); |
|
228 } |
|
229 |
|
230 // --------------------------------------------------------------------------- |
|
231 // CreateGridL |
|
232 // @bug :tapadar :major :This function is using magic numbers, would be corrected with updated LAF docs |
|
233 // --------------------------------------------------------------------------- |
|
234 // |
|
235 void CGlxSingleLineMetaPane::CreateGridL() |
|
236 { |
|
237 TRACER("CGlxSingleLineMetaPane::CreateGridL()"); |
|
238 |
|
239 iGridVisual->SetPadding(TPoint(1,1)); |
|
240 iGridVisual->SetInnerPadding( TPoint(1,1) ); |
|
241 RArray<TInt> weights; |
|
242 CleanupClosePushL(weights); |
|
243 |
|
244 User::LeaveIfError(weights.Append(2)); |
|
245 User::LeaveIfError(weights.Append(1)); |
|
246 User::LeaveIfError(weights.Append(1)); |
|
247 User::LeaveIfError(weights.Append(5)); |
|
248 |
|
249 iGridVisual->SetColumnsL(weights); |
|
250 CleanupStack::PopAndDestroy(&weights); |
|
251 |
|
252 iDateTextVisual = CAlfTextVisual::AddNewL(*this,iGridVisual); |
|
253 iDateTextVisual->SetStyle( EAlfTextStyleSmall, EAlfBackgroundTypeDark ); |
|
254 iDateTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); |
|
255 iDateTextVisual->SetTextL( KEmptyText ); |
|
256 iDateTextVisual->SetAlign(EAlfAlignHLocale, EAlfAlignVCenter); |
|
257 |
|
258 iFavIconImageVisual= CAlfImageVisual::AddNewL(*this,iGridVisual); |
|
259 iFavIconImageVisual->SetScaleMode(CAlfImageVisual::EScaleFitInside); |
|
260 iFavIconImageVisual->SetTagL(KTagFav); |
|
261 CAlfBorderBrush* borderBrush= CAlfBorderBrush::NewLC(*iEnv, 1, 1, 0, 0); |
|
262 borderBrush->SetColor(KRgbWhite); |
|
263 borderBrush->SetOpacity(0.35f); |
|
264 iFavIconImageVisual->EnableBrushesL(); |
|
265 iFavIconImageVisual->Brushes()->AppendL(borderBrush, EAlfHasOwnership); |
|
266 CleanupStack::Pop(borderBrush); |
|
267 |
|
268 iLocIconImageVisual = CAlfImageVisual::AddNewL(*this,iGridVisual); |
|
269 iLocIconImageVisual->SetScaleMode(CAlfImageVisual::EScaleFitInside); |
|
270 |
|
271 // Creates the Icon Textures and Updates the Favourite and Loc Icon Visuals |
|
272 CreateIconTextureAndUpdateVisualsL(); |
|
273 |
|
274 iLocationTextVisual = CAlfTextVisual::AddNewL(*this,iGridVisual); |
|
275 iLocationTextVisual->SetStyle( EAlfTextStyleSmall, EAlfBackgroundTypeDark ); |
|
276 iLocationTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); |
|
277 HBufC* noLocationInfo = |
|
278 StringLoader::LoadLC(R_FULLSCREEN_NO_LOCATION_INFO); |
|
279 iLocationTextVisual->SetTextL(*noLocationInfo); |
|
280 CleanupStack::PopAndDestroy(noLocationInfo ); |
|
281 iLocationTextVisual->SetTagL(KTagLoc); |
|
282 iLocationTextVisual->SetAlign(EAlfAlignHLocale, EAlfAlignVCenter); |
|
283 } |
|
284 |
|
285 // --------------------------------------------------------------------------- |
|
286 // ShowMetaPane |
|
287 // --------------------------------------------------------------------------- |
|
288 // |
|
289 void CGlxSingleLineMetaPane::ShowMetaPane(TBool aShow) |
|
290 { |
|
291 TRACER("CGlxSingleLineMetaPane::ShowMetaPane()"); |
|
292 GLX_LOG_INFO1("CGlxSingleLineMetaPane::ShowMetaPane() value %d",aShow); |
|
293 if(aShow) |
|
294 { |
|
295 iMainVisual->SetOpacity(KOpacityOpaque); |
|
296 } |
|
297 else |
|
298 { |
|
299 iMainVisual->SetOpacity(KOpacityTransparent); |
|
300 } |
|
301 } |
|
302 |
|
303 // --------------------------------------------------------------------------- |
|
304 // OfferEventL |
|
305 // --------------------------------------------------------------------------- |
|
306 // |
|
307 TBool CGlxSingleLineMetaPane::OfferEventL(const TAlfEvent &aEvent) |
|
308 { |
|
309 TRACER("CGlxSingleLineMetaPane::OfferEventL()"); |
|
310 TBool consumed = EFalse; |
|
311 |
|
312 if (aEvent.IsKeyEvent()) |
|
313 { |
|
314 GLX_LOG_INFO( "CGlxSingleLineMetaPane::OfferEventL::KeyEvent"); |
|
315 } |
|
316 |
|
317 // Dont handle if not visible. [HACK ALERT]: This might probably be a hack. |
|
318 // Further investigation needed. |
|
319 if (KOpacityTransparent == iMainVisual->Opacity().ValueNow()) |
|
320 { |
|
321 return consumed; |
|
322 } |
|
323 |
|
324 if(aEvent.IsPointerEvent() && aEvent.PointerDown() ) |
|
325 { |
|
326 GLX_LOG_INFO( "CGlxSingleLineMetaPane::OfferEventL::PointerEvent"); |
|
327 CAlfVisual* onVisual = NULL; |
|
328 onVisual = aEvent.Visual(); |
|
329 if(AlfUtil::TagMatches(onVisual->Tag(), KTagFav)) |
|
330 { |
|
331 GLX_LOG_INFO( "CGlxSingleLineMetaPane::OfferEventL::PointerEvent - KTagFav"); |
|
332 if (iFavIconStatus) |
|
333 { |
|
334 GLX_LOG_INFO( "CGlxSingleLineMetaPane::OfferEventL::PointerEvent - Already Fav"); |
|
335 iFullscreenView.HandleCommandL(EGlxCmdRemoveFromFavourites,this); |
|
336 } |
|
337 else |
|
338 { |
|
339 GLX_LOG_INFO( "CGlxSingleLineMetaPane::OfferEventL::PointerEvent - Add to Fav"); |
|
340 iFullscreenView.HandleCommandL(EGlxCmdAddToFavourites,this); |
|
341 } |
|
342 consumed = ETrue; |
|
343 } |
|
344 else if (AlfUtil::TagMatches(onVisual->Tag(), KTagLoc)) |
|
345 { |
|
346 GLX_LOG_INFO( "CGlxSingleLineMetaPane::OfferEventL::PointerEvent - KTagLoc , Location info present"); |
|
347 iFullscreenView.HandleCommandL(KGlxCmdMnShowMap,this); |
|
348 consumed = ETrue; |
|
349 } |
|
350 } |
|
351 return consumed; |
|
352 } |
|
353 |
|
354 // --------------------------------------------------------------------------- |
|
355 // VisualLayoutUpdated |
|
356 // --------------------------------------------------------------------------- |
|
357 // |
|
358 void CGlxSingleLineMetaPane::VisualLayoutUpdated(CAlfVisual&/* aVisual*/) |
|
359 { |
|
360 TRACER("CGlxSingleLineMetaPane::VisualLayoutUpdated()"); |
|
361 // Update the Screen positions only if the layout has changed. |
|
362 // For performace improvement |
|
363 TRect presentScreenSize = GetScreenSize(); |
|
364 if (iScreenSize.Width() != presentScreenSize.Width()) |
|
365 { |
|
366 UpdatePosition(); |
|
367 iScreenSize = presentScreenSize; |
|
368 } |
|
369 } |
|
370 |
|
371 // --------------------------------------------------------------------------- |
|
372 // DetermineOrientation |
|
373 // --------------------------------------------------------------------------- |
|
374 // |
|
375 TInt CGlxSingleLineMetaPane::DetermineOrientation(TRect aRect) |
|
376 { |
|
377 TRACER("CGlxSingleLineMetaPane::DetermineOrientation()"); |
|
378 TInt orientationValue = (aRect.Width()>aRect.Height()?EMetaOrinentaionLandscape: |
|
379 EMetaOrinentaionPortrait); |
|
380 return orientationValue; |
|
381 } |
|
382 |
|
383 // --------------------------------------------------------------------------- |
|
384 // GetScreenSize |
|
385 // --------------------------------------------------------------------------- |
|
386 // |
|
387 TRect CGlxSingleLineMetaPane::GetScreenSize() |
|
388 { |
|
389 TRACER("CGlxSingleLineMetaPane::GetScreenSize()"); |
|
390 return AlfUtil::ScreenSize(); |
|
391 } |
|
392 // --------------------------------------------------------------------------- |
|
393 // UpdatePosition |
|
394 // @bug :tapadar :major :This function is using magic numbers, would be corrected with updated LAF docs |
|
395 // @bug :tapadar :major :This function needs to be worked upon across corrolla and ivalo once LAF present |
|
396 // --------------------------------------------------------------------------- |
|
397 // |
|
398 void CGlxSingleLineMetaPane::UpdatePosition() |
|
399 { |
|
400 TRACER("CGlxSingleLineMetaPane::UpdatePosition()"); |
|
401 TRect rect = GetScreenSize(); |
|
402 TInt screenWidth = rect.Width(); |
|
403 TInt screenHeight = rect.Height(); |
|
404 TInt orientation = DetermineOrientation(rect); |
|
405 // Switch off the Flag for layout update notification, else a change in size/pos |
|
406 // will call VisualLayoutUpdated multiple times. |
|
407 iMainVisual->ClearFlag( EAlfVisualFlagLayoutUpdateNotification); |
|
408 if (EMetaOrinentaionPortrait == orientation) |
|
409 { |
|
410 GLX_LOG_INFO("CGlxSingleLineMetaPane::UpdatePosition - EMetaOrinentaionPortrait Orientation"); |
|
411 CAknToolbar* toolbar = iAvkonAppUi->CurrentFixedToolbar(); |
|
412 |
|
413 if (toolbar->IsToolbarDisabled()) |
|
414 { |
|
415 //set the control size |
|
416 iMainVisual->SetSize(TSize(screenWidth-6,45)); |
|
417 iMainVisual->SetPos(TAlfRealPoint(3,screenHeight-100)); |
|
418 } |
|
419 else |
|
420 { |
|
421 //set the control size |
|
422 iMainVisual->SetSize(TSize(screenWidth-6,45)); |
|
423 iMainVisual->SetPos(TAlfRealPoint(3,screenHeight-160)); |
|
424 } |
|
425 } |
|
426 else if(EMetaOrinentaionLandscape == orientation) |
|
427 { |
|
428 GLX_LOG_INFO("CGlxSingleLineMetaPane::UpdatePosition - EMetaOrinentaionLandscape Orientation"); |
|
429 //set the control size |
|
430 iMainVisual->SetSize(TSize(screenWidth-100,45)); |
|
431 iMainVisual->SetPos(TAlfRealPoint(3,screenHeight-45)); |
|
432 } |
|
433 else |
|
434 { |
|
435 GLX_LOG_INFO("CGlxSingleLineMetaPane::UpdatePosition - Wrong Orientation"); |
|
436 } |
|
437 iMainVisual->SetFlag ( EAlfVisualFlagLayoutUpdateNotification); |
|
438 } |
|
439 |
|
440 // --------------------------------------------------------------------------- |
|
441 // UpdateMetaPaneL |
|
442 // --------------------------------------------------------------------------- |
|
443 // |
|
444 void CGlxSingleLineMetaPane::UpdateMetaPaneL(TInt aFocusIndex, MGlxMediaList* aList, |
|
445 TBool aUpdateFavIcon) |
|
446 { |
|
447 TRACER("CGlxSingleLineMetaPane::UpdateMetaPaneL()"); |
|
448 |
|
449 const TGlxMedia& item = aList->Item(aFocusIndex); |
|
450 const CGlxMedia* media = item.Properties(); |
|
451 CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL(); |
|
452 CleanupStack::PushL(stringConverter ); |
|
453 HBufC* dataString = NULL; |
|
454 |
|
455 if (media->IsSupported(KMPXMediaGeneralDate)) |
|
456 { |
|
457 // R_QTN_DATE_USUAL is for the Date of format 08/02/1982 type |
|
458 stringConverter->AsStringL( item, KMPXMediaGeneralDate,R_QTN_DATE_USUAL, |
|
459 dataString ); |
|
460 if (dataString) |
|
461 { |
|
462 iDateTextVisual->SetTextL(*dataString); |
|
463 } |
|
464 } |
|
465 if (media->IsSupported(KGlxMediaGeneralLocation)) |
|
466 { |
|
467 stringConverter->AsStringL( item, KGlxMediaGeneralLocation,0, dataString ); |
|
468 if (dataString->Compare(KFormat) != 0) |
|
469 { |
|
470 iLocationTextVisual->SetTextL(*dataString); |
|
471 } |
|
472 } |
|
473 else |
|
474 { |
|
475 HBufC* noLocationInfo = |
|
476 StringLoader::LoadLC(R_FULLSCREEN_NO_LOCATION_INFO); |
|
477 iLocationTextVisual->SetTextL(*noLocationInfo); |
|
478 CleanupStack::PopAndDestroy(noLocationInfo ); |
|
479 } |
|
480 delete dataString; |
|
481 dataString = NULL; |
|
482 CleanupStack::PopAndDestroy(stringConverter ); |
|
483 |
|
484 // Setting the not created icon to the FavIcon initially, would update it once available |
|
485 // through HandleObjectChangeL |
|
486 if (aUpdateFavIcon) |
|
487 { |
|
488 iFavIconStatus = EFalse; |
|
489 iFavIconImageVisual->SetImage(TAlfImage(*iFavNotAddedIconTexture)); |
|
490 } |
|
491 } |
|
492 |
|
493 // --------------------------------------------------------------------------- |
|
494 // HandleUpdateIconL |
|
495 // --------------------------------------------------------------------------- |
|
496 // |
|
497 void CGlxSingleLineMetaPane::HandleUpdateIconL(TBool aModify) |
|
498 { |
|
499 TRACER("CGlxSingleLineMetaPane::HandleUpdateIconL()"); |
|
500 // Check if the item is added to favourites already |
|
501 if (aModify) |
|
502 { |
|
503 iFavIconStatus = ETrue; |
|
504 iFavIconImageVisual->SetImage(TAlfImage(*iFavAddedIconTexture)); |
|
505 } |
|
506 else |
|
507 { |
|
508 iFavIconStatus = EFalse; |
|
509 iFavIconImageVisual->SetImage(TAlfImage(*iFavNotAddedIconTexture)); |
|
510 } |
|
511 } |
|
512 |
|
513 // --------------------------------------------------------------------------- |
|
514 // HandleItemAddedL |
|
515 // --------------------------------------------------------------------------- |
|
516 // |
|
517 void CGlxSingleLineMetaPane::HandleItemAddedL( TInt /*aStartIndex*/, TInt /*aEndIndex*/, |
|
518 MGlxMediaList* /*aList*/ ) |
|
519 { |
|
520 TRACER("CGlxSingleLineMetaPane::HandleItemAddedL()"); |
|
521 // No Implementation |
|
522 } |
|
523 |
|
524 // --------------------------------------------------------------------------- |
|
525 // HandleItemRemovedL |
|
526 // --------------------------------------------------------------------------- |
|
527 // |
|
528 void CGlxSingleLineMetaPane::HandleItemRemovedL( TInt/* aStartIndex*/, |
|
529 TInt/* aEndIndex*/, MGlxMediaList*/* aList */) |
|
530 { |
|
531 TRACER("CGlxSingleLineMetaPane::HandleItemRemovedL()"); |
|
532 // No Implementation |
|
533 } |
|
534 |
|
535 // --------------------------------------------------------------------------- |
|
536 // HandleAttributesAvailableL |
|
537 // --------------------------------------------------------------------------- |
|
538 // |
|
539 void CGlxSingleLineMetaPane::HandleAttributesAvailableL( TInt aItemIndex, |
|
540 const RArray<TMPXAttribute>& /*aAttributes*/, MGlxMediaList* aList ) |
|
541 { |
|
542 TRACER("CGlxSingleLineMetaPane::HandleAttributesAvailableL()"); |
|
543 |
|
544 TInt focusIndex = iMediaList.FocusIndex(); |
|
545 GLX_LOG_INFO2("CGlxSingleLineMetaPane::HandleAttributesAvailableL FocusIndex is : %d and ItemIdex is : %d", |
|
546 focusIndex, aItemIndex); |
|
547 |
|
548 // Update the metapane only for the focus Index, do not make unnecessary calls. |
|
549 // for focus change, we would get calls to HandleFocusChange and thus would update |
|
550 // metapane from there. |
|
551 if (aItemIndex == focusIndex) |
|
552 { |
|
553 UpdateMetaPaneL(focusIndex, aList); |
|
554 } |
|
555 } |
|
556 |
|
557 // --------------------------------------------------------------------------- |
|
558 // HandleFocusChangedL |
|
559 // --------------------------------------------------------------------------- |
|
560 // |
|
561 void CGlxSingleLineMetaPane::HandleFocusChangedL( NGlxListDefs::TFocusChangeType /*aType*/, |
|
562 TInt aNewIndex, TInt /*aOldIndex*/, MGlxMediaList* aList ) |
|
563 { |
|
564 TRACER("CGlxSingleLineMetaPane::HandleFocusChangedL()"); |
|
565 // Check the count here to ensure the medialist is present |
|
566 // this case may be occurred when the last item of the Fs view is deleted and it |
|
567 // wants to go back to the grid view |
|
568 if (aList->Count()) |
|
569 { |
|
570 if (iSLMPFavMLObserver) |
|
571 { |
|
572 delete iSLMPFavMLObserver; |
|
573 iSLMPFavMLObserver= NULL; |
|
574 iSLMPFavMLObserver = CGlxSLMPFavMLObserver::NewL(*this, aList->FocusIndex(), aList); |
|
575 } |
|
576 // Update the Metapane on Focus change |
|
577 UpdateMetaPaneL(aNewIndex, aList, ETrue); |
|
578 } |
|
579 } |
|
580 |
|
581 // --------------------------------------------------------------------------- |
|
582 // HandleItemSelectedL |
|
583 // --------------------------------------------------------------------------- |
|
584 // |
|
585 void CGlxSingleLineMetaPane::HandleItemSelectedL(TInt/* aIndex*/, TBool/* aSelected*/, |
|
586 MGlxMediaList* /*aList*/ ) |
|
587 { |
|
588 TRACER("CGlxSingleLineMetaPane::HandleItemSelectedL()"); |
|
589 // No Implementation |
|
590 } |
|
591 |
|
592 // --------------------------------------------------------------------------- |
|
593 // HandleMessageL |
|
594 // --------------------------------------------------------------------------- |
|
595 // |
|
596 void CGlxSingleLineMetaPane::HandleMessageL( const CMPXMessage& /*aMessage*/, |
|
597 MGlxMediaList*/* aList */) |
|
598 { |
|
599 TRACER("CGlxSingleLineMetaPane::HandleMessageL()"); |
|
600 // No Implementation |
|
601 } |
|
602 |
|
603 // --------------------------------------------------------------------------- |
|
604 // HandleError |
|
605 // --------------------------------------------------------------------------- |
|
606 // |
|
607 void CGlxSingleLineMetaPane::HandleError( TInt /*aError*/ ) |
|
608 { |
|
609 TRACER("CGlxSingleLineMetaPane::HandleError()"); |
|
610 // No Implementation |
|
611 } |
|
612 |
|
613 // --------------------------------------------------------------------------- |
|
614 // HandleCommandCompleteL |
|
615 // --------------------------------------------------------------------------- |
|
616 // |
|
617 void CGlxSingleLineMetaPane::HandleCommandCompleteL( CMPXCommand* /*aCommandResult*/, |
|
618 TInt /*aError*/, MGlxMediaList*/* aList */) |
|
619 { |
|
620 TRACER("CGlxSingleLineMetaPane::HandleCommandCompleteL()"); |
|
621 // No Implementation |
|
622 } |
|
623 |
|
624 // --------------------------------------------------------------------------- |
|
625 // HandleMediaL |
|
626 // --------------------------------------------------------------------------- |
|
627 // |
|
628 void CGlxSingleLineMetaPane::HandleMediaL( TInt /*aListIndex*/, MGlxMediaList*/* aList */) |
|
629 { |
|
630 TRACER("CGlxSingleLineMetaPane::HandleMediaL()"); |
|
631 // No Implementation |
|
632 } |
|
633 |
|
634 // --------------------------------------------------------------------------- |
|
635 // HandleItemModifiedL |
|
636 // --------------------------------------------------------------------------- |
|
637 // |
|
638 void CGlxSingleLineMetaPane::HandleItemModifiedL( const RArray<TInt>& /*aItemIndexes*/, |
|
639 MGlxMediaList*/* aList */) |
|
640 { |
|
641 TRACER("CGlxSingleLineMetaPane::HandleItemModifiedL()"); |
|
642 // No Implementation |
|
643 } |
|
644 |