photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp
branchRCL_3
changeset 75 01504893d9cb
parent 64 34937ec34dac
equal deleted inserted replaced
68:5b238bc8ffb6 75:01504893d9cb
    42 #include <glxlog.h>			// For Logs
    42 #include <glxlog.h>			// For Logs
    43 #include <glxtracer.h>			// For Logs
    43 #include <glxtracer.h>			// For Logs
    44 #include <glxattributecontext.h> //attribute context
    44 #include <glxattributecontext.h> //attribute context
    45 #include <mglxmedialist.h> //for medialist
    45 #include <mglxmedialist.h> //for medialist
    46 
    46 
       
    47 #include "glxcontainerinfobubble.h" //intelligent class for data of infobubble
    47 #include "glxcloudview.hrh"
    48 #include "glxcloudview.hrh"
    48 #include "mglxcloudviewmskobserver.h" // For Msk Observer
    49 #include "mglxcloudviewmskobserver.h" // For Msk Observer
    49 #include "mglxenterkeyeventobserver.h" // For enterkey observer
    50 #include "mglxenterkeyeventobserver.h" // For enterkey observer
    50 #include "mglxcloudviewlayoutobserver.h"
    51 #include "mglxcloudviewlayoutobserver.h"
    51 #include "glxtagscontextmenucontrol.h"
    52 #include "glxtagscontextmenucontrol.h"
    59 const TInt KFontLarger = 40;
    60 const TInt KFontLarger = 40;
    60 const TInt KFontLargest = 44;
    61 const TInt KFontLargest = 44;
    61 const TInt KRowHeight = 72;
    62 const TInt KRowHeight = 72;
    62 const TInt KLeftMargin = 10;
    63 const TInt KLeftMargin = 10;
    63 const TInt KNumMinRowSpace = 2;
    64 const TInt KNumMinRowSpace = 2;
    64 const TInt KColSpace = 30;
    65 const TInt KColSpace = 20;
    65 const TInt KRightmargin = 10;//Aligning Right margin
    66 const TInt KRightmargin = 10;//Aligning Right margin
    66 const TInt KMinTagSize = 77;
    67 const TInt KMinTagSize = 77;
    67 const TInt KTagScreenHeight = 460;
    68 const TInt KTagScreenHeight = 460;
    68 const TReal KBoundaryMargin = 0.1; //10% = 10/100 = 0.1 
    69 const TReal KBoundaryMargin = 0.1; //10% = 10/100 = 0.1 
    69 const TInt KFastCloudMovement = 100; //Transition time to move cloud view
    70 const TInt KFastCloudMovement = 100; //Transition time to move cloud view
   196         //get the attributes from Cache
   197         //get the attributes from Cache
   197         FetchAttributeFromCacheL();
   198         FetchAttributeFromCacheL();
   198 
   199 
   199         if ( iLabels.Count ()==listCount && iAttributeContext->RequestCountL (&iMediaList)==0)
   200         if ( iLabels.Count ()==listCount && iAttributeContext->RequestCountL (&iMediaList)==0)
   200             {
   201             {
       
   202             //if we navigate in forward direction, first item should be highlighted.if we are navigating in
       
   203             // backwards direction, index is not necessarily zero, it will be restored.
   201             if ( iUiUtility->ViewNavigationDirection ()== EGlxNavigationForwards && iMediaList.Count ())
   204             if ( iUiUtility->ViewNavigationDirection ()== EGlxNavigationForwards && iMediaList.Count ())
   202                 {
   205                 {
   203                 iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0);
   206                 iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0);
   204                 }
   207                 }
   205             UpdateRowDataL ();
   208             UpdateRowDataL ();
   207         }
   210         }
   208     //get touch feedback instance
   211     //get touch feedback instance
   209     iTouchFeedback = MTouchFeedback::Instance(); 
   212     iTouchFeedback = MTouchFeedback::Instance(); 
   210     iPhysics = CAknPhysics::NewL(*this, NULL);
   213     iPhysics = CAknPhysics::NewL(*this, NULL);
   211     InitPhysicsL();
   214     InitPhysicsL();
   212     iShowFocus = EFalse;
       
   213     }
   215     }
   214 
   216 
   215 
   217 
   216 // ---------------------------------------------------------------------------
   218 // ---------------------------------------------------------------------------
   217 //VisualLayoutUpdated()
   219 //VisualLayoutUpdated()
   238 // --------------------------------------------------------------------------- 
   240 // --------------------------------------------------------------------------- 
   239 // Destructor
   241 // Destructor
   240 // --------------------------------------------------------------------------- 
   242 // --------------------------------------------------------------------------- 
   241 //
   243 //
   242 CGlxCloudViewControl::~CGlxCloudViewControl()
   244 CGlxCloudViewControl::~CGlxCloudViewControl()
       
   245 
   243     {
   246     {
   244     TRACER("GLX_CLOUD::CGlxCloudViewControl::~CGlxCloudViewControl");
   247     TRACER("GLX_CLOUD::CGlxCloudViewControl::~CGlxCloudViewControl");
   245     iCloudInfo.Close ();
   248     iCloudInfo.Close ();
   246     iLabels.Close();
   249     iLabels.Close();
   247     iMediaList.RemoveContext (iAttributeContext);
   250     iMediaList.RemoveContext (iAttributeContext);
   267 // --------------------------------------------------------------------------- 
   270 // --------------------------------------------------------------------------- 
   268 //
   271 //
   269 TInt CGlxCloudViewControl::LayoutVisibleRows(TPoint aStartPoint,TInt aRowStartIndex
   272 TInt CGlxCloudViewControl::LayoutVisibleRows(TPoint aStartPoint,TInt aRowStartIndex
   270         , TInt aRowEndIndex)
   273         , TInt aRowEndIndex)
   271     {
   274     {
   272     TRACER("CGlxCloudViewControl::LayoutVisibleRows");
   275     TRACER("GLX_CLOUD::CGlxCloudViewControl::DrawRow");
   273     TSize vsize;
   276     TSize vsize;
   274     TPoint tl, br;
   277     TPoint tl, br;
   275     tl = aStartPoint;
   278     tl = aStartPoint;
   276     br.iX = 0;
       
   277     br.iY = tl.iY + KRowHeight;
   279     br.iY = tl.iY + KRowHeight;
   278     const TInt KMaxScreenWidth = iTagScreenWidth - iScrollPaneHandle.iW;
       
   279     //drawing in reverse for arabic hebrew support
   280     //drawing in reverse for arabic hebrew support
   280     if ( GlxGeneralUiUtilities::LayoutIsMirrored ())
   281     if ( GlxGeneralUiUtilities::LayoutIsMirrored ())
   281         {
   282         {
   282 		GLX_LOG_INFO("Mirrorred Layout");
   283         br.iX =  aStartPoint.iX; 
   283 		//In Mirrored layout, 'BottomRight' considers scrollpane width for each row
   284         const TInt KMaxScreenWidth = iTagScreenWidth - iScrollPaneHandle.iW;
   284         br.iX =  aStartPoint.iX  - iScrollPaneHandle.iW;
       
   285         //Set the positions of tags in a row.
   285         //Set the positions of tags in a row.
   286         for (TInt j = aRowStartIndex; j <= aRowEndIndex; j++)
   286         for (TInt j = aRowStartIndex; j <= aRowEndIndex; j++)
   287             {
   287             {
   288             vsize = iLabels[j]->TextExtents();
   288             vsize = iLabels[j]->TextExtents ();
   289             if ( vsize.iWidth < KMinTagSize )
   289             if ( vsize.iWidth < KMinTagSize )
   290                 {
   290                 {
   291                 vsize.iWidth = KMinTagSize;
   291                 vsize.iWidth = KMinTagSize;
   292                 }
   292                 }
   293             //If the size of the tag is more than the screen size then wrap it
   293             //If the size of the tag is more than the screen size then wrap it
   294             if (vsize.iWidth > KMaxScreenWidth)
   294             if (vsize.iWidth > KMaxScreenWidth)
   295                 {
   295                 {
   296                 TAlfRealSize tagSize( KMaxScreenWidth, br.iY );
   296                 TAlfRealSize tagSize( KMaxScreenWidth, br.iY );
   297                 iLabels[j]->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
   297                 iLabels[j]->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
       
   298                 vsize = iLabels[j]->TextExtents ();
   298                 tl.iX -= aStartPoint.iX;
   299                 tl.iX -= aStartPoint.iX;
   299                 tl.iY = aStartPoint.iY;
   300                 tl.iY = aStartPoint.iY;
   300                 br.iX = tagSize.iWidth;              
   301                 br.iX = tagSize.iWidth;              
   301                 }
   302                 }
   302             else
   303             else
   303                 {
   304                 {
   304 				tl.iX = br.iX - vsize.iWidth;
   305                 tl.iX -= (vsize.iWidth + KColSpace);
   305                 }
   306                 }
   306             
       
   307             //Set the anchor points for the tags 	            	        
   307             //Set the anchor points for the tags 	            	        
   308             iLayout->SetAnchor (EAlfAnchorTopLeft, iLayoutIndex,
   308             iLayout->SetAnchor (EAlfAnchorTopLeft, iLayoutIndex,
   309                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   309                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   310                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   310                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   311                     TAlfTimedPoint (tl.iX, tl.iY));
   311                     TAlfTimedPoint (tl.iX, tl.iY));
   312             iLayout->SetAnchor (EAlfAnchorBottomRight, iLayoutIndex,
   312             iLayout->SetAnchor (EAlfAnchorBottomRight, iLayoutIndex,
   313                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   313                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   314                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   314                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   315                     TAlfTimedPoint (br.iX, br.iY));
   315                     TAlfTimedPoint (br.iX, br.iY));
   316             //Bottom-Right corner for next tag in same row
       
   317             br.iX -= (vsize.iWidth + KColSpace); 
   316             br.iX -= (vsize.iWidth + KColSpace); 
   318             iLayoutIndex += 1;
   317             iLayoutIndex += 1;
   319             }
   318             }
       
   319 
   320         }
   320         }
   321     else
   321     else
   322         {
   322         {
   323 		GLX_LOG_INFO("NOT Mirrorred Layout");
   323         const TInt KMaxScreenWidth = iTagScreenWidth - iScrollPaneHandle.iW;
   324         for (TInt j = aRowStartIndex; j <= aRowEndIndex; j++)
   324         for (TInt j = aRowStartIndex; j <= aRowEndIndex; j++)
   325             {
   325             {
   326             vsize = iLabels[j]->TextExtents();
   326             vsize = iLabels[j]->TextExtents ();
   327             if( vsize.iWidth < KMinTagSize )
   327             if( vsize.iWidth < KMinTagSize )
   328                 {
   328                 {
   329                 vsize.iWidth = KMinTagSize;
   329                 vsize.iWidth = KMinTagSize;
   330                 }
   330                 }
   331             if (vsize.iWidth > KMaxScreenWidth)
   331             if (vsize.iWidth > KMaxScreenWidth)
   332                 {
   332                 {
   333                 TAlfRealSize tagSize( KMaxScreenWidth, br.iY );
   333                 TAlfRealSize tagSize( KMaxScreenWidth, br.iY );
       
   334                 TAlfRealPoint startPos( aStartPoint.iX, 0 );
   334                 iLabels[j]->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
   335                 iLabels[j]->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
   335                 tl.iX = aStartPoint.iX;
   336                 tl.iX = aStartPoint.iX;
   336                 tl.iY = aStartPoint.iY;
   337                 tl.iY = aStartPoint.iY;
   337                 br.iX = tagSize.iWidth;
   338                 br.iX = tagSize.iWidth;
   338                 }
   339                 }
   339             else
   340             else
   340                 {
   341                 {
   341                 br.iX = tl.iX + vsize.iWidth;
   342                 br.iX += vsize.iWidth + KColSpace;
   342                 }
   343                 }
   343             
       
   344             iLayout->SetAnchor (EAlfAnchorTopLeft, iLayoutIndex,
   344             iLayout->SetAnchor (EAlfAnchorTopLeft, iLayoutIndex,
   345                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   345                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   346                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   346                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   347                     TAlfTimedPoint (tl.iX, tl.iY));
   347                     TAlfTimedPoint (tl.iX, tl.iY));
   348             iLayout->SetAnchor (EAlfAnchorBottomRight, iLayoutIndex,
   348             iLayout->SetAnchor (EAlfAnchorBottomRight, iLayoutIndex,
   349                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   349                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
   350                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   350                     EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute,
   351                     TAlfTimedPoint (br.iX, br.iY));
   351                     TAlfTimedPoint (br.iX, br.iY));
   352             //Top-Left Corner for next tag in same row
   352             tl.iX = br.iX;
   353             tl.iX += (vsize.iWidth + KColSpace);
       
   354             iLayoutIndex += 1;
   353             iLayoutIndex += 1;
   355             }
   354             }
   356         }
   355         }
   357     return 0;
   356     return 0;
   358     }
   357     }
       
   358 
       
   359 
       
   360 
   359 
   361 
   360 // --------------------------------------------------------------------------- 
   362 // --------------------------------------------------------------------------- 
   361 // LayoutVisibleArea()
   363 // LayoutVisibleArea()
   362 // 
   364 // 
   363 // ---------------------------------------------------------------------------
   365 // ---------------------------------------------------------------------------
   364 void CGlxCloudViewControl::LayoutVisibleArea()
   366 void CGlxCloudViewControl::LayoutVisibleArea()
   365     {
   367     {
   366 	TRACER("CGlxCloudViewControl::LayoutVisibleArea");
       
   367     //screen height for boundary check:how many rows fit in.
   368     //screen height for boundary check:how many rows fit in.
   368     //find out how many rows can fit in.
   369     //find out how many rows can fit in.
   369     //add upper and lower margin spacing 5 pixels
   370     //add upper and lower margin spacing 5 pixels
   370 
   371 
   371     //draw the row on screens
   372     //draw the row on screens
   374     //If the layout is arabic hebrew then start positioning of tags from end
   375     //If the layout is arabic hebrew then start positioning of tags from end
   375     if ( GlxGeneralUiUtilities::LayoutIsMirrored ())
   376     if ( GlxGeneralUiUtilities::LayoutIsMirrored ())
   376         {
   377         {
   377         startpoint.iX = iTagScreenWidth - KRightmargin;        
   378         startpoint.iX = iTagScreenWidth - KRightmargin;        
   378         }
   379         }
   379     //else start from beginning
   380 
       
   381     //else start from biginning
   380     else
   382     else
   381         {
   383         {
   382         startpoint.iX = KLeftMargin;
   384         startpoint.iX = KLeftMargin;
   383         }
   385         }
   384         startpoint.iY = KNumMinRowSpace;
   386         startpoint.iY = KNumMinRowSpace;
   385     
       
   386     //associate the active visuals with anchor layout
   387     //associate the active visuals with anchor layout
   387     GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Layout reset");
   388     GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Layout reset");
   388     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea layout Count after reset  %d ", iLayout->Count ());
   389     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea layout Count after reset  %d ", iLayout->Count ());
   389     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea iCloudInfo[0].iStartIndex  %d ", iCloudInfo[0].iStartIndex);
   390     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea iCloudInfo[0].iStartIndex  %d ", iCloudInfo[0].iStartIndex);
   390     TInt endindex = iCloudInfo.Count()-1;
   391     TInt endindex = iCloudInfo.Count()-1;
   391 
   392 
   392     for (TInt j = iCloudInfo[0].iStartIndex; j <=iCloudInfo[endindex].iEndIndex; j++)
   393     for (TInt j = iCloudInfo[0].iStartIndex; j <=iCloudInfo[endindex].iEndIndex; j++)
   393         {
   394         {
   394         GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::FindEndRowIndex Entering layout append");
   395         GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::FindEndRowIndex Entering layout append");
   395 
   396 
       
   397 
   396         TAlfTimedValue opacity;
   398         TAlfTimedValue opacity;
   397         opacity.SetValueNow(1.0); // immediate change
   399         opacity.SetValueNow(1.0); // immediate change
   398         iLabels[j]->SetOpacity(opacity);
   400         iLabels[j]->SetOpacity(opacity);
   399         }
   401         }
   400 
   402 
   401     GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Exiting layout append");
   403     GLX_LOG_INFO("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Exiting layout append");
   402     iLayoutIndex = 0;
   404     iLayoutIndex = 0;
   403     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea layout Count realloc  %d ", iLayout->Count ());
   405     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea layout Count realloc  %d ", iLayout->Count ());
   404     TInt totalHeight = 0;
   406     for (TInt j = 0; j <= iEndRowIndex; j++)
   405     for (TInt j = 0; j <= iCloudInfo.Count() - 1; j++)
       
   406         {
   407         {
   407         GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Drawing row started  %d ", j);
   408         GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::::LayoutVisibleArea Drawing row started  %d ", j);
   408         LayoutVisibleRows (startpoint,iCloudInfo[j].iStartIndex, 
   409         LayoutVisibleRows (startpoint,iCloudInfo[j].iStartIndex, 
   409                 iCloudInfo[j].iEndIndex);
   410                 iCloudInfo[j].iEndIndex);
   410         startpoint.iY += KRowHeight + KNumMinRowSpace;		
   411         startpoint.iY += KRowHeight + KNumMinRowSpace;		
   411 
   412         }
       
   413     TInt totalHeight = 0;
       
   414     for (TInt j = 0; j <= iCloudInfo.Count()-1; j++)
       
   415         {
   412         totalHeight+=KRowHeight;
   416         totalHeight+=KRowHeight;
   413         totalHeight+=KNumMinRowSpace;
   417         totalHeight+=KNumMinRowSpace;
   414         }
   418         }
   415 
   419 
   416     //Set the virtual size of viewport to the total size of anchor.	
   420     //Set the virtual size of viewport to the total size of anchor.	
   441         {
   445         {
   442         ((IAlfScrollBarModel *)(iScrollBarWidget->model()))->changeData(iScrollEventData.mSpan,
   446         ((IAlfScrollBarModel *)(iScrollBarWidget->model()))->changeData(iScrollEventData.mSpan,
   443                 iScrollEventData.mViewLength,
   447                 iScrollEventData.mViewLength,
   444                 0);
   448                 0);
   445         DisplayScrollBar();
   449         DisplayScrollBar();
   446         }   	
   450         }
       
   451     //constructing the bubblecontainer
       
   452     CreateBubleContainer();   	
   447 
   453 
   448     iLayout->UpdateChildrenLayout (); //update layout
   454     iLayout->UpdateChildrenLayout (); //update layout
   449 
   455 
   450     HandleLayoutFocusChange ();
   456     HandleLayoutFocusChange ();
   451     
   457     
   452     MoveDownIfRequired();
   458     MoveDownIfRequired();
   453     }
   459     }
   454 
   460 
       
   461 
   455 // --------------------------------------------------------------------------- 
   462 // --------------------------------------------------------------------------- 
   456 // OfferEventL()
   463 // OfferEventL()
   457 // --------------------------------------------------------------------------- 
   464 // --------------------------------------------------------------------------- 
   458 //
   465 //
   459 TBool CGlxCloudViewControl::OfferEventL(const TAlfEvent &aEvent)
   466 TBool CGlxCloudViewControl::OfferEventL(const TAlfEvent &aEvent)
   460     {
   467     {   TRACER("GLX_CLOUD:: CGlxCloudViewControl::OfferEventL");
   461     TRACER("GLX_CLOUD:: CGlxCloudViewControl::OfferEventL");
       
   462 
   468 
   463     //check if key inputs needs handling
   469     //check if key inputs needs handling
   464     TBool consumed = EFalse;
   470     TBool consumed = EFalse;
   465     if (iLabels.Count() == 0)
   471     if ( ( iLabels.Count () == 0 ) ) 
   466         {
   472         {
   467         GLX_LOG_INFO( "GLX_CLOUD ::CGlxCloudViewControl::offerkeyeventL no key press returning  ");
   473         GLX_LOG_INFO( "GLX_CLOUD ::CGlxCloudViewControl::offerkeyeventL no key press returning  ");
   468         return EFalse; //return as no futher processing is required
   474         return EFalse; //return as no futher processing is required
   469         }
   475         }
   470 
   476 
   471     if (aEvent.IsKeyEvent() && iTagsContextMenuControl->ItemMenuVisibility())
       
   472         {
       
   473         // Hide the context menu, if visible
       
   474         ShowContextItemMenuL(EFalse);
       
   475         }
       
   476 
       
   477     if ( aEvent.IsKeyEvent ()&& aEvent.Code() == EEventKey )
   477     if ( aEvent.IsKeyEvent ()&& aEvent.Code() == EEventKey )
   478         {
   478         {
   479         switch (aEvent.KeyEvent().iCode)            
   479         switch (aEvent.KeyEvent().iCode)            
   480             {	
   480             {	
       
   481             //@ EABI-7R7FRU Fute failure: Tag views enter key has no functionality.
   481             case EKeyEnter :
   482             case EKeyEnter :
   482             case EKeyDevice3:
   483             case EKeyDevice3:
   483                 {
   484                 {
   484                 if (iShowFocus)
   485                 iObserverEnterKeyEvent.HandleEnterKeyEventL( (TInt)EAknCmdOpen );
       
   486                 consumed= ETrue;
       
   487                 }
       
   488                 break;
       
   489             case EKeyUpArrow:
       
   490                 {             
       
   491                 if(iCloudInfo.Count() >1 )
   485                     {
   492                     {
   486                     iShowFocus = EFalse;
   493                     HandleKeyUpL ();
   487                     iObserverEnterKeyEvent.HandleEnterKeyEventL(
   494                     consumed = ETrue;
   488                             (TInt) EAknCmdOpen);
   495                     iFocusRowIndex = RowNumber (iMediaList.FocusIndex ()); 
       
   496 
       
   497                     MoveUpIfRequired();                   
       
   498                     }
       
   499                 }
       
   500                 break;
       
   501 
       
   502             case EKeyDownArrow:
       
   503                 {              
       
   504                 if (iCloudInfo.Count() > 1)
       
   505                     {
       
   506                     HandleKeyDownL ();
       
   507                     consumed = ETrue;
       
   508                     iFocusRowIndex = RowNumber (iMediaList.FocusIndex ());
       
   509 
       
   510                     MoveDownIfRequired();                                 
       
   511                     }                  
       
   512                 }
       
   513                 break;
       
   514 
       
   515             case EKeyLeftArrow:
       
   516             case EKeyPrevious:
       
   517                 {
       
   518                 // arabic hebrew change
       
   519                 if ( GlxGeneralUiUtilities::LayoutIsMirrored () )
       
   520                     {
       
   521                     if ( iMediaList.FocusIndex() == iMediaList.Count() - 1 )
       
   522                         {
       
   523                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0);
       
   524                         }
       
   525                     else
       
   526                         {
       
   527                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute,
       
   528                                 iMediaList.FocusIndex ()+ 1);
       
   529                         }
       
   530                     iScrollDirection = 0;
   489                     }
   531                     }
   490                 else
   532                 else
   491                     {
   533                     {
   492                     SetFocusToFirstVisibleItemL();
   534                     if ( iMediaList.FocusIndex ()== 0 )
       
   535                         {
       
   536                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute,
       
   537                                 iMediaList.Count() - 1 );
       
   538                         }
       
   539                     else
       
   540                         {
       
   541                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute,
       
   542                                 iMediaList.FocusIndex ()- 1);
       
   543                         }
       
   544                     iScrollDirection = 1;
   493                     }
   545                     }
   494                 consumed = ETrue;
   546                 consumed = ETrue;
       
   547                 TInt focusRowIndex = RowNumber (iMediaList.FocusIndex ());
       
   548                 if(iFocusRowIndex != focusRowIndex)
       
   549                     {
       
   550                     iFocusRowIndex = focusRowIndex; 
       
   551                     if( iScrollDirection == 0 )
       
   552                         {                      
       
   553                         MoveDownIfRequired();
       
   554                         }
       
   555                     else
       
   556                         {
       
   557                         MoveUpIfRequired();
       
   558                         }
       
   559                     }                
   495                 }
   560                 }
       
   561 
   496                 break;
   562                 break;
   497             case EKeyUpArrow:
   563 
   498                 {
   564             case EKeyRightArrow:
   499                 if (iShowFocus)
   565             case EKeyNext:
       
   566                 {               
       
   567                 // arabic hebrew change
       
   568                 if ( GlxGeneralUiUtilities::LayoutIsMirrored () )
   500                     {
   569                     {
   501                     HandleKeyUpL();
   570                     if ( iMediaList.FocusIndex ()== 0 )
   502                     iFocusRowIndex = RowNumber(iMediaList.FocusIndex());
   571                         {
   503 
   572                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute,
   504                     MoveUpIfRequired();
   573                                 iMediaList.Count() - 1 );
       
   574                         }
       
   575                     else
       
   576                         {
       
   577                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute,
       
   578                                 iMediaList.FocusIndex ()- 1);
       
   579                         }
       
   580                     iScrollDirection = 1;
   505                     }
   581                     }
   506                 else
   582                 else
   507                     {
   583                     {
   508                     SetFocusToFirstVisibleItemL();
   584                     if ( iMediaList.FocusIndex ()== iMediaList.Count() - 1 )
   509                     }
       
   510                 consumed = ETrue;
       
   511                 }
       
   512                 break;
       
   513 
       
   514             case EKeyDownArrow:
       
   515                 {
       
   516                 if (iShowFocus)
       
   517                     {
       
   518                     HandleKeyDownL();
       
   519                     iFocusRowIndex = RowNumber(iMediaList.FocusIndex());
       
   520 
       
   521                     MoveDownIfRequired();
       
   522                     }
       
   523                 else
       
   524                     {
       
   525                     SetFocusToFirstVisibleItemL();
       
   526                     }
       
   527                 consumed = ETrue;
       
   528                 }
       
   529                 break;
       
   530 
       
   531             case EKeyLeftArrow:
       
   532             case EKeyPrevious:
       
   533                 {
       
   534                 if (iShowFocus)
       
   535                     {
       
   536                     // arabic hebrew change
       
   537                     if (GlxGeneralUiUtilities::LayoutIsMirrored())
       
   538                         {
   585                         {
   539                         if (iMediaList.FocusIndex() == iMediaList.Count() - 1)
   586                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0);
   540                             {
       
   541                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute, 0);
       
   542                             }
       
   543                         else
       
   544                             {
       
   545                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute,
       
   546                                     iMediaList.FocusIndex() + 1);
       
   547                             }
       
   548                         iScrollDirection = 0;
       
   549                         }
   587                         }
   550                     else
   588                     else
   551                         {
   589                         {
   552                         if (iMediaList.FocusIndex() == 0)
   590                         iMediaList.SetFocusL (NGlxListDefs::EAbsolute,
   553                             {
   591                                 iMediaList.FocusIndex ()+ 1);
   554                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute,
       
   555                                     iMediaList.Count() - 1);
       
   556                             }
       
   557                         else
       
   558                             {
       
   559                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute,
       
   560                                     iMediaList.FocusIndex() - 1);
       
   561                             }
       
   562                         iScrollDirection = 1;
       
   563                         }
   592                         }
   564                     TInt focusRowIndex = RowNumber(iMediaList.FocusIndex());
   593                     iScrollDirection = 0;
   565                     if (iFocusRowIndex != focusRowIndex)
   594                     }
   566                         {
   595                 TInt focusRowIndex = RowNumber (iMediaList.FocusIndex ());
   567                         iFocusRowIndex = focusRowIndex;
   596 
   568                         if (iScrollDirection == 0)
   597                 if( iFocusRowIndex != focusRowIndex )
   569                             {
   598                     {
   570                             MoveDownIfRequired();
   599                     iFocusRowIndex = focusRowIndex;  
   571                             }
   600                     if( iScrollDirection == 1 )
   572                         else
   601                         {                           
   573                             {
   602                         MoveUpIfRequired();                               
   574                             MoveUpIfRequired();
   603                         }
   575                             }
   604                     else
       
   605                         {                           
       
   606                         MoveDownIfRequired();                               
   576                         }
   607                         }
   577                     }
   608                     }
   578                 else
   609                 }
   579                     {
       
   580                     SetFocusToFirstVisibleItemL();
       
   581                     }
       
   582                 consumed = ETrue;
   610                 consumed = ETrue;
   583                 }
       
   584                 break;
       
   585 
       
   586             case EKeyRightArrow:
       
   587             case EKeyNext:
       
   588                 {
       
   589                 if (iShowFocus)
       
   590                     {
       
   591                     // arabic hebrew change
       
   592                     if (GlxGeneralUiUtilities::LayoutIsMirrored())
       
   593                         {
       
   594                         if (iMediaList.FocusIndex() == 0)
       
   595                             {
       
   596                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute,
       
   597                                     iMediaList.Count() - 1);
       
   598                             }
       
   599                         else
       
   600                             {
       
   601                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute,
       
   602                                     iMediaList.FocusIndex() - 1);
       
   603                             }
       
   604                         iScrollDirection = 1;
       
   605                         }
       
   606                     else
       
   607                         {
       
   608                         if (iMediaList.FocusIndex() == iMediaList.Count() - 1)
       
   609                             {
       
   610                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute, 0);
       
   611                             }
       
   612                         else
       
   613                             {
       
   614                             iMediaList.SetFocusL(NGlxListDefs::EAbsolute,
       
   615                                     iMediaList.FocusIndex() + 1);
       
   616                             }
       
   617                         iScrollDirection = 0;
       
   618                         }
       
   619                     TInt focusRowIndex = RowNumber(iMediaList.FocusIndex());
       
   620 
       
   621                     if (iFocusRowIndex != focusRowIndex)
       
   622                         {
       
   623                         iFocusRowIndex = focusRowIndex;
       
   624                         if (iScrollDirection == 1)
       
   625                             {
       
   626                             MoveUpIfRequired();
       
   627                             }
       
   628                         else
       
   629                             {
       
   630                             MoveDownIfRequired();
       
   631                             }
       
   632                         }
       
   633                     }
       
   634                 else
       
   635                     {
       
   636                     SetFocusToFirstVisibleItemL();
       
   637                     }
       
   638                 consumed = ETrue;
       
   639                 }
       
   640                 break;
   611                 break;
   641 
   612 
   642             default:
   613             default:
   643                 break;
   614                 break;
   644             }
   615             }
   676         }
   647         }
   677 
   648 
   678     iScrollDirection = 1;
   649     iScrollDirection = 1;
   679     }
   650     }
   680 
   651 
       
   652 
   681 // --------------------------------------------------------------------------- 
   653 // --------------------------------------------------------------------------- 
   682 // HandleKeyDown()
   654 // HandleKeyDown()
   683 // --------------------------------------------------------------------------- 
   655 // --------------------------------------------------------------------------- 
   684 //
   656 //
   685 void CGlxCloudViewControl::HandleKeyDownL()
   657 void CGlxCloudViewControl::HandleKeyDownL()
   710 //
   682 //
   711 void CGlxCloudViewControl::HandleLayoutFocusChange()
   683 void CGlxCloudViewControl::HandleLayoutFocusChange()
   712     {
   684     {
   713     TRACER("GLX_CLOUD::CGlxCloudViewControl::HandleLayoutFocusChange");
   685     TRACER("GLX_CLOUD::CGlxCloudViewControl::HandleLayoutFocusChange");
   714 
   686 
   715     if ((iShowFocus || !iUiUtility->IsPenSupported()) && (iLabels.Count() - 1
   687     if ( iLabels.Count()-1 >= iMediaList.FocusIndex())
   716             >= iMediaList.FocusIndex()))
       
   717         {
   688         {
   718         //to highlight focused element 
   689         //to highlight focused element 
   719         SetFocusColor(); 
   690         SetFocusColor(); 
   720         }
   691         }
   721     }
   692     }
       
   693 
   722 
   694 
   723 // --------------------------------------------------------------------------- 
   695 // --------------------------------------------------------------------------- 
   724 // FocusUpdate()
   696 // FocusUpdate()
   725 // --------------------------------------------------------------------------- 
   697 // --------------------------------------------------------------------------- 
   726 //
   698 //
   727 void CGlxCloudViewControl::FocusUpdate()
   699 void CGlxCloudViewControl::FocusUpdate()
   728     {
   700     {
   729     TRACER("GLX_CLOUD::CGlxCloudViewControl::FocusUpdate");
   701     TRACER("GLX_CLOUD::CGlxCloudViewControl::FocusUpdate");
   730     iFocusRowIndex = RowNumber(iMediaList.FocusIndex());
   702     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::FocusUpdate HighLighted RowNum  %d ",iFocusRowIndex);
   731     GLX_LOG_INFO1("GLX_CLOUD::FocusUpdate iFocusRowIndex=%d", 
   703     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::FocusUpdate End RowNumn %d ",iCloudInfo.Count()-1);
   732             iFocusRowIndex);
   704     iFocusRowIndex = RowNumber (iMediaList.FocusIndex ());
       
   705     iEndRowIndex = iCloudInfo.Count()-1;
   733     LayoutVisibleArea();
   706     LayoutVisibleArea();
   734     }
   707     }
       
   708 
   735 
   709 
   736 // --------------------------------------------------------------------------- 
   710 // --------------------------------------------------------------------------- 
   737 // ResetLayout()
   711 // ResetLayout()
   738 // --------------------------------------------------------------------------- 
   712 // --------------------------------------------------------------------------- 
   739 //
   713 //
   747         iLabels[i] = NULL;
   721         iLabels[i] = NULL;
   748         }        
   722         }        
   749     iLabels.Reset();
   723     iLabels.Reset();
   750     }
   724     }
   751 
   725 
       
   726 
   752 // --------------------------------------------------------------------------- 
   727 // --------------------------------------------------------------------------- 
   753 // GetRownum()
   728 // GetRownum()
   754 // --------------------------------------------------------------------------- 
   729 // --------------------------------------------------------------------------- 
   755 //
   730 //
   756 TInt CGlxCloudViewControl::RowNumber(TInt aItemIndex) const
   731 TInt CGlxCloudViewControl::RowNumber(TInt aItemIndex) const
   757 	{
   732 {
   758 	TRACER("GLX_CLOUD::CGlxCloudViewControl::GetRownum");
   733 
   759 	//Get the rownumber of the given item index.
   734 TRACER("GLX_CLOUD::CGlxCloudViewControl::GetRownum");
   760 	TInt i;
   735 //Get the rownumber of the given item index.
   761 	for (i = 0; i < iCloudInfo.Count(); i++)
   736 TInt i;
   762 		{
   737 for (i = 0; i < iCloudInfo.Count (); i++)
   763 		if ((aItemIndex >= iCloudInfo[i].iStartIndex) && (aItemIndex
   738     {
   764 				<= iCloudInfo[i].iEndIndex))
   739     if ( (aItemIndex >= iCloudInfo[i].iStartIndex) && (aItemIndex <=iCloudInfo[i].iEndIndex))
   765 			break;
   740         break;
   766 		}
   741     }
   767 	return i;
   742 return i;
   768 	}
   743 
       
   744 }
   769 
   745 
   770 // --------------------------------------------------------------------------- 
   746 // --------------------------------------------------------------------------- 
   771 // FetchAttributeFromCacheL()
   747 // FetchAttributeFromCacheL()
   772 // --------------------------------------------------------------------------- 
   748 // --------------------------------------------------------------------------- 
   773 //
   749 //
   797         // get the title and set it to the text visual
   773         // get the title and set it to the text visual
   798         iLabels[i]->SetTextL( item.Title() );
   774         iLabels[i]->SetTextL( item.Title() );
   799         }
   775         }
   800     }
   776     }
   801 
   777 
       
   778 
   802 //medialist Observers
   779 //medialist Observers
   803 
   780 
   804 // ---------------------------------------------------------------------------
   781 // ---------------------------------------------------------------------------
   805 // HandleItemAddedL().
   782 // HandleItemAddedL().
   806 // ---------------------------------------------------------------------------
   783 // ---------------------------------------------------------------------------
   826     if (iAttributeContext->RequestCountL(aList) == 0 )
   803     if (iAttributeContext->RequestCountL(aList) == 0 )
   827         {
   804         {
   828         //reset the layout and get the items from cache
   805         //reset the layout and get the items from cache
   829         UpdateLayout(); //remove all the visuals from the layout.layout is empty now.
   806         UpdateLayout(); //remove all the visuals from the layout.layout is empty now.
   830         iCloudInfo.Close (); //row information is reset
   807         iCloudInfo.Close (); //row information is reset
       
   808         //get the new array contents from cache.no need to reset the array as the number
       
   809         //of items in array will remain same.
       
   810         FetchAttributeFromCacheL();
       
   811         UpdateRowDataL (); //updates the row data and reassigns font sizes and draw the layout on screen.
   831         }
   812         }
   832 
   813 
   833     InitPhysicsL();
   814     InitPhysicsL();
   834     }
   815     }
       
   816 
   835 
   817 
   836 // ---------------------------------------------------------------------------
   818 // ---------------------------------------------------------------------------
   837 // HandleMediaL().
   819 // HandleMediaL().
   838 // ---------------------------------------------------------------------------
   820 // ---------------------------------------------------------------------------
   839 //
   821 //
   913         {
   895         {
   914         //get the new array contents from cache.no need to reset the array as the number
   896         //get the new array contents from cache.no need to reset the array as the number
   915         //of items in array will remain same.
   897         //of items in array will remain same.
   916         UpdateLayout(); //remove all the visuals from the layout.layout is empty now.        
   898         UpdateLayout(); //remove all the visuals from the layout.layout is empty now.        
   917         FetchAttributeFromCacheL();
   899         FetchAttributeFromCacheL();
       
   900         //if we navigate in forward direction, first item should be highlighted.if we are navigating in
       
   901         // backwards direction, index is not necessarily zero, it will be restored.
   918         if ( iUiUtility->ViewNavigationDirection ()== EGlxNavigationForwards && iMediaList.Count ())
   902         if ( iUiUtility->ViewNavigationDirection ()== EGlxNavigationForwards && iMediaList.Count ())
   919             {
   903             {
   920             iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0);
   904             iMediaList.SetFocusL (NGlxListDefs::EAbsolute, 0);
   921             }
   905             }
   922         //generate row structures and draw rows on screen
   906         //generate row structures and draw rows on screen
   983 // ---------------------------------------------------------------------------
   967 // ---------------------------------------------------------------------------
   984 //UpdateRowDataL()
   968 //UpdateRowDataL()
   985 // ---------------------------------------------------------------------------
   969 // ---------------------------------------------------------------------------
   986 //
   970 //
   987 void CGlxCloudViewControl::UpdateRowDataL()
   971 void CGlxCloudViewControl::UpdateRowDataL()
       
   972 
   988     {
   973     {
   989     TRACER("GLX_CLOUD::CGlxCloudViewControl::UpdateRowData()");
   974     TRACER("GLX_CLOUD::CGlxCloudViewControl::UpdateRowData()");
   990 
   975 
   991     TInt rowStartingTagIndex = 0;
   976     TInt rowStartingTagIndex = 0;
   992     TInt lastRowStartTagIndex = 0;
   977     TInt lastRowStartTagIndex = 0;
  1004 
   989 
  1005 
   990 
  1006     //Setting the Font Styles based on association counts
   991     //Setting the Font Styles based on association counts
  1007     //Finding the maximum value of image association
   992     //Finding the maximum value of image association
  1008     //Determining the Font(Style) for each visual
   993     //Determining the Font(Style) for each visual
  1009     TInt maxCount = MaxUsageCount (); //Maximum Association count 
   994     TInt maxCount= MaxUsageCount (); //Maximum Association count 
  1010     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  mediaCount %d ", maxCount);
   995     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  mediaCount %d ", maxCount);
  1011     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  iLabels.Count()  %d ",iLabels.Count());
   996     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  iLabels.Count()  %d ",iLabels.Count());
  1012     if ( 0 == maxCount )
   997     if ( 0 == maxCount )
  1013         {
   998         {
  1014         return; //do not proceed if max count is zero
   999         return; //do not proceed if max count is zero
  1043             {
  1028             {
  1044             rowHeight = currentTagSize.iHeight;
  1029             rowHeight = currentTagSize.iHeight;
  1045             }
  1030             }
  1046 
  1031 
  1047         // Current row width will be progressively incremented to fit as many tags as possible
  1032         // Current row width will be progressively incremented to fit as many tags as possible
  1048         rowWidth += currentTagSize.iWidth + KColSpace;
  1033         rowWidth += currentTagSize.iWidth + 10;
  1049         GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData   currentTagSize.iWidth %d ", currentTagSize.iWidth);
  1034         GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData   currentTagSize.iWidth %d ", currentTagSize.iWidth);
  1050         GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  rowWidth %d ", rowWidth);
  1035         GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  rowWidth %d ", rowWidth);
  1051 
  1036 
  1052         // If the tag size crosses the Screen Size, Then wrap it.
  1037         // If the tag size crosses the Screen Size, Then wrap it.
  1053         if ( currentTagSize.iWidth > KMaxScreenWidth )
  1038         if ( currentTagSize.iWidth > KMaxScreenWidth )
  1067 
  1052 
  1068         // If the current row's width is overflowing the screen width
  1053         // If the current row's width is overflowing the screen width
  1069         // then we must fit the current visual into the next row.
  1054         // then we must fit the current visual into the next row.
  1070         // Do that check now and adjust accordingly.
  1055         // Do that check now and adjust accordingly.
  1071         // Fix for EAHN-7BZD78 is to exclude the gap value between the row's tags from the logic
  1056         // Fix for EAHN-7BZD78 is to exclude the gap value between the row's tags from the logic
  1072         else if ( rowWidth - KColSpace > KMaxScreenWidth )
  1057         else if ( rowWidth - 10 > KMaxScreenWidth )
  1073             {
  1058             {
  1074             GLX_LOG_INFO("GLX_CLOUD :: CGlxCloudViewControl::UpdateRowData Row added");
  1059             GLX_LOG_INFO("GLX_CLOUD :: CGlxCloudViewControl::UpdateRowData Row added");
  1075             lastRowStartTagIndex = currentTagIndex - 1;
  1060             lastRowStartTagIndex = currentTagIndex - 1;
  1076             AppendToCloudArrayL( cloudInfo,rowStartingTagIndex, lastRowStartTagIndex );
  1061             AppendToCloudArrayL( cloudInfo,rowStartingTagIndex, lastRowStartTagIndex );
  1077             lastRowStartTagIndex++;
  1062             lastRowStartTagIndex++;
  1095         AppendToCloudArrayL( cloudInfo,lastRowStartTagIndex, KLabelsCount - 1 );
  1080         AppendToCloudArrayL( cloudInfo,lastRowStartTagIndex, KLabelsCount - 1 );
  1096         }
  1081         }
  1097 
  1082 
  1098     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  iCloudInfo.count loop exit  %d ", iCloudInfo.Count());
  1083     GLX_LOG_INFO1("GLX_CLOUD ::CGlxCloudViewControl::UpdateRowData  iCloudInfo.count loop exit  %d ", iCloudInfo.Count());
  1099     FocusUpdate (); //Start screen drawing 
  1084     FocusUpdate (); //Start screen drawing 
       
  1085 
       
  1086     iEndRowIndex = iCloudInfo.Count()-1;
  1100     }
  1087     }
  1101 
  1088 
  1102 // ---------------------------------------------------------------------------
  1089 // ---------------------------------------------------------------------------
  1103 // SetProperties
  1090 // SetProperties
  1104 // ---------------------------------------------------------------------------
  1091 // ---------------------------------------------------------------------------
  1257         }
  1244         }
  1258     return usageCount;
  1245     return usageCount;
  1259     }
  1246     }
  1260 
  1247 
  1261 // ---------------------------------------------------------------------------
  1248 // ---------------------------------------------------------------------------
  1262 // AppendToCloudArrayL()
  1249 // SetFocusColor()
  1263 // ---------------------------------------------------------------------------
  1250 // ---------------------------------------------------------------------------
  1264 //
  1251 //
  1265 void CGlxCloudViewControl::AppendToCloudArrayL(TGlxCloudInfo& aCloudInfo,
  1252 void CGlxCloudViewControl::AppendToCloudArrayL( 
  1266         const TInt& aStartIndex, const TInt& aEndIndex)
  1253         TGlxCloudInfo& aCloudInfo,const TInt& aStartIndex, const TInt& aEndIndex )
  1267     {
  1254     {
  1268     TRACER("GLX_CLOUD::CGlxCloudViewControl::AppendToCloudArrayL");
  1255     TRACER("GLX_CLOUD::CGlxCloudViewControl::AppendToCloudArrayL");
  1269     aCloudInfo.iStartIndex = aStartIndex;
  1256     aCloudInfo.iStartIndex = aStartIndex;
  1270     aCloudInfo.iEndIndex = aEndIndex; 
  1257     aCloudInfo.iEndIndex = aEndIndex; 
  1271     iCloudInfo.AppendL( aCloudInfo );
  1258     iCloudInfo.AppendL( aCloudInfo );
  1273 
  1260 
  1274 // ---------------------------------------------------------------------------
  1261 // ---------------------------------------------------------------------------
  1275 // SetFocusColor()
  1262 // SetFocusColor()
  1276 // ---------------------------------------------------------------------------
  1263 // ---------------------------------------------------------------------------
  1277 //
  1264 //
  1278 void CGlxCloudViewControl::SetFocusColor()
  1265 void  CGlxCloudViewControl::SetFocusColor()
  1279     {
  1266     {
  1280     TRACER("GLX_CLOUD::CGlxCloudViewControl::SetFocusColor");
  1267     iLabels[iMediaList.FocusIndex()]->SetColor (KAknsIIDQsnHighlightColors ,EAknsCIQsnHighlightColorsCG3); 
  1281     if (iMediaList.Count())
  1268     }
  1282         {
  1269 
  1283         iLabels[iMediaList.FocusIndex()]->SetColor(
  1270 
  1284                 KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG3);
  1271 // ---------------------------------------------------------------------------
  1285         }
  1272 // SetBubleMidPoint()
  1286     }
  1273 // ---------------------------------------------------------------------------
  1287 
  1274 //
  1288 // ---------------------------------------------------------------------------
  1275 void  CGlxCloudViewControl::SetBubleMidPoint(TPoint& aMidPoint)
  1289 // ResetFocusColor()
  1276     {
  1290 // ---------------------------------------------------------------------------
  1277     TRACER("GLX_CLOUD::CGlxCloudViewControl::SetBubleMidPoint");
  1291 //
  1278     //Substract the viewport position so as to set the buble at the right position on the screen     
  1292 void CGlxCloudViewControl::ResetFocusColor()
  1279     aMidPoint.iX-=iViewPortPosition.iX;
  1293     {
  1280     aMidPoint.iY-=iViewPortPosition.iY;
  1294     TRACER("GLX_CLOUD::CGlxCloudViewControl::ResetFocusColor");
  1281     }
  1295     if (iMediaList.Count())
  1282 
  1296         {
  1283 // ---------------------------------------------------------------------------
  1297         iLabels[iMediaList.FocusIndex()]->SetColor(KAknsIIDQsnTextColors,
  1284 // CreateBubleContainer()
  1298                 EAknsCIQsnTextColorsCG6);
  1285 // ---------------------------------------------------------------------------
  1299         }
  1286 //   
       
  1287 void CGlxCloudViewControl::CreateBubleContainer()
       
  1288     {   
  1300     }
  1289     }
  1301 
  1290 
  1302 // ---------------------------------------------------------------------------
  1291 // ---------------------------------------------------------------------------
  1303 // MoveUpIfRequired()
  1292 // MoveUpIfRequired()
  1304 // ---------------------------------------------------------------------------
  1293 // ---------------------------------------------------------------------------
  1305 //
  1294 //
  1306 void CGlxCloudViewControl::MoveUpIfRequired()
  1295 void CGlxCloudViewControl::MoveUpIfRequired()
  1307     {
  1296     {
  1308     TRACER("GLX_CLOUD::CGlxCloudViewControl::MoveUpIfRequired");
  1297     TRACER("GLX_CLOUD::CGlxCloudViewControl::MoveUpIfRequired");
  1309     TInt focusIndex = iMediaList.FocusIndex();
       
  1310 
       
  1311     //get the focused item's position
  1298     //get the focused item's position
  1312     TPoint point;
  1299     TPoint point;
  1313     iLayout->ChildPos(focusIndex,point);
  1300     iLayout->ChildPos(iMediaList.FocusIndex(),point);
  1314     TSize size;
  1301     TSize size;
  1315     iLayout->ChildSize(focusIndex,size);
  1302     iLayout->ChildSize(iMediaList.FocusIndex(),size);
  1316 
  1303     TInt focus = iMediaList.FocusIndex();
  1317     TInt rownumber = RowNumber(focusIndex);
  1304     TInt rownumber = RowNumber(focus);
  1318     //if the focused item is not visible then move the viewport
  1305     //if the focused item is not visible then move the viewport
  1319     if(point.iY < iViewPortPosition.iY)         
  1306     if(point.iY < iViewPortPosition.iY)         
  1320         { 
  1307         { 
  1321         //set the new position of viewport
  1308         //set the new position of viewport
  1322         TInt offset = iViewPortPosition.iY - point.iY;
  1309         TInt offeset = iViewPortPosition.iY - point.iY;
  1323         iViewPortPosition.iY-=offset;
  1310         iViewPortPosition.iY-=offeset;
  1324         if( (iViewPortPosition.iY < 0) )
  1311         if( (iViewPortPosition.iY < 0) )
  1325             {
  1312             {
  1326             iViewPortPosition.iY = 0;
  1313             iViewPortPosition.iY = 0;
  1327             }   
  1314             }   
  1328         }    
  1315         }    
  1334     iViewPortLayout->SetViewportPos(iViewPortPosition, KSlowCloudMovement);
  1321     iViewPortLayout->SetViewportPos(iViewPortPosition, KSlowCloudMovement);
  1335     iScrollEventData.mViewStartPos = iViewPortPosition.iY;
  1322     iScrollEventData.mViewStartPos = iViewPortPosition.iY;
  1336     Scroll();  
  1323     Scroll();  
  1337     }
  1324     }
  1338 
  1325 
       
  1326 
  1339 // ---------------------------------------------------------------------------
  1327 // ---------------------------------------------------------------------------
  1340 // MoveDownIfRequired()
  1328 // MoveDownIfRequired()
  1341 // ---------------------------------------------------------------------------
  1329 // ---------------------------------------------------------------------------
  1342 //
  1330 //
  1343 void CGlxCloudViewControl::MoveDownIfRequired()
  1331 void CGlxCloudViewControl::MoveDownIfRequired()
  1344     {
  1332     {
  1345     TRACER("GLX_CLOUD::CGlxCloudViewControl::MoveDownIfRequired");
  1333     TRACER("GLX_CLOUD::CGlxCloudViewControl::MoveDownIfRequired");  
  1346     TInt focusIndex = iMediaList.FocusIndex();
       
  1347 
       
  1348     //get the focused item's position
  1334     //get the focused item's position
  1349     TPoint point;
  1335     TPoint point;
  1350     iLayout->ChildPos(focusIndex, point);
  1336     iLayout->ChildPos(iMediaList.FocusIndex(),point);
  1351     TSize size;
  1337     TSize size;
  1352     iLayout->ChildSize(focusIndex, size);
  1338     iLayout->ChildSize(iMediaList.FocusIndex(),size);
  1353 
  1339     //if the focused visual is not visible then move the viewport 
  1354     //Reset viewport position for cases:
  1340     if(point.iY+size.iHeight > iViewPortPosition.iY+iViewPortSize.iHeight )
  1355     //case 1)Focus index is first item
  1341         { 
  1356     if (focusIndex == 0)
  1342         //set the new position of viewport
  1357         {
  1343         TInt offeset = (point.iY+size.iHeight) - (iViewPortPosition.iY+iViewPortSize.iHeight);
  1358 		iViewPortPosition.iY = 0;
  1344         iViewPortPosition.iY+=offeset;
  1359 		}
  1345         if( (iViewPortPosition.iY > iViewPortVirtualSize.iHeight) )
  1360     //case 2)Focused item is in last screen
  1346             {
  1361     else if( point.iY > (iViewPortVirtualSize.iHeight - iViewPortSize.iHeight))
  1347             iViewPortPosition.iY = iViewPortVirtualSize.iHeight - iViewPortSize.iHeight;
  1362         {
  1348             } 
  1363         iViewPortPosition.iY = iViewPortVirtualSize.iHeight - iViewPortSize.iHeight;
  1349         }
  1364         }
  1350     //if its key event then it should be cyclic
  1365     else
  1351     else if (iMediaList.FocusIndex() == 0)
  1366         {
  1352         {
  1367         iViewPortPosition.iY = point.iY + KNumMinRowSpace;
  1353         iViewPortPosition.iY = 0;
  1368         }
  1354         }     
  1369 
       
  1370     //Validate the viewport position
       
  1371     if ((iViewPortPosition.iY > iViewPortVirtualSize.iHeight))
       
  1372         {
       
  1373 		iViewPortPosition.iY = iViewPortVirtualSize.iHeight - iViewPortSize.iHeight;
       
  1374         }
       
  1375 
       
  1376     GLX_LOG_INFO1("GLX_CLOUD::MoveDownIfRequired() iViewPortPosition.iY:%d",
       
  1377             iViewPortPosition.iY);
       
  1378     iViewPortLayout->SetViewportPos(iViewPortPosition, KSlowCloudMovement);
  1355     iViewPortLayout->SetViewportPos(iViewPortPosition, KSlowCloudMovement);
  1379     iScrollEventData.mViewStartPos = iViewPortPosition.iY;
  1356     iScrollEventData.mViewStartPos = iViewPortPosition.iY;
  1380     if(iScrollBarWidget)
  1357     if(iScrollBarWidget)
  1381         {
  1358         {
  1382         Scroll();
  1359         Scroll();           
  1383         }
  1360         }
  1384     }
  1361     }     
       
  1362 
       
  1363 // ---------------------------------------------------------------------------
       
  1364 // MoveDownIfRequired()
       
  1365 // ---------------------------------------------------------------------------
       
  1366 //
       
  1367 void CGlxCloudViewControl::CalculateBubleMidPoint()
       
  1368     { 
       
  1369     TRACER("GLX_CLOUD::CGlxCloudViewControl::CalculateBubleMidPoint");
       
  1370     TPoint midpoint;
       
  1371     TAlfRealRect focussedItemRect;
       
  1372     TRect mainPaneRect;
       
  1373     AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, mainPaneRect);
       
  1374 
       
  1375     CAlfVisual& visual = iLayout->Visual( iMediaList.FocusIndex() );
       
  1376     focussedItemRect = visual.DisplayRect();
       
  1377 
       
  1378     if( GlxGeneralUiUtilities::LayoutIsMirrored () )
       
  1379         {  
       
  1380         midpoint.iX = focussedItemRect.iBr.iX +
       
  1381         ((focussedItemRect.iTl.iX - focussedItemRect.iBr.iX )/2);
       
  1382         }
       
  1383 
       
  1384     else 
       
  1385         {
       
  1386         midpoint.iX=focussedItemRect.iTl.iX +
       
  1387         ((focussedItemRect.iBr.iX - focussedItemRect.iTl.iX )/2);
       
  1388         }
       
  1389 
       
  1390     midpoint.iY=focussedItemRect.iTl.iY+
       
  1391                 ((focussedItemRect.iBr.iY - focussedItemRect.iTl.iY )/2); 
       
  1392     TPoint anchorRect;
       
  1393 
       
  1394     //Get the position of anchor layout
       
  1395     iViewPortLayout->ChildPos (0, anchorRect);
       
  1396 
       
  1397     //Add the differance to the midpoint
       
  1398     midpoint.iX+=anchorRect.iX;
       
  1399     midpoint.iY+=anchorRect.iY; 
       
  1400 
       
  1401     //Substract from the viewport position the viewport position    
       
  1402     SetBubleMidPoint(midpoint);   
       
  1403     } 
  1385 
  1404 
  1386 // ---------------------------------------------------------------------------
  1405 // ---------------------------------------------------------------------------
  1387 // HandlePointerEventL()
  1406 // HandlePointerEventL()
  1388 // ---------------------------------------------------------------------------
  1407 // ---------------------------------------------------------------------------
  1389 //
  1408 //  
  1390 TBool CGlxCloudViewControl::HandlePointerEventL( const TAlfEvent &aEvent )
  1409 TBool CGlxCloudViewControl::HandlePointerEventL( const TAlfEvent &aEvent )
  1391     {
  1410     {
  1392     TRACER("GLX_CLOUD::CGlxCloudViewControl::HandlePointerEventL");
  1411     TRACER("GLX_CLOUD::CGlxCloudViewControl::HandlePointerEventL");
  1393     CAlfVisual* tappedvisual = aEvent.Visual();	
  1412     CAlfVisual* tappedvisual = aEvent.Visual();	
  1394     TBool consumed = EFalse;
  1413     TBool consumed = EFalse;
  1422                 //if the tapped visual is same as the visual in the layout then focus that visual
  1441                 //if the tapped visual is same as the visual in the layout then focus that visual
  1423                 if(layoutvisual == tappedvisual)
  1442                 if(layoutvisual == tappedvisual)
  1424                     {
  1443                     {
  1425                     iTouchFeedback->InstantFeedback(ETouchFeedbackBasic);
  1444                     iTouchFeedback->InstantFeedback(ETouchFeedbackBasic);
  1426                     iMediaList.SetFocusL (NGlxListDefs::EAbsolute, index);
  1445                     iMediaList.SetFocusL (NGlxListDefs::EAbsolute, index);
  1427                     iShowFocus = ETrue;
       
  1428                     HandleLayoutFocusChange();
       
  1429 
  1446 
  1430                     //Start the timer to interpret longpress events
  1447                     //Start the timer to interpret longpress events
  1431                     iTimerComplete = EFalse;
  1448                     iTimerComplete = EFalse;
  1432                     iTimer->Cancel ();//cancels any outstanding requests
  1449                     iTimer->Cancel ();//cancels any outstanding requests
  1433                     iTimer->SetDelay (KLongPressTimer);
  1450                     iTimer->SetDelay (KLongPressTimer);
  1446 
  1463 
  1447         consumed = HandleDragL(aEvent.PointerEvent());
  1464         consumed = HandleDragL(aEvent.PointerEvent());
  1448         }
  1465         }
  1449     else if (iDownEventReceived && aEvent.PointerUp())
  1466     else if (iDownEventReceived && aEvent.PointerUp())
  1450         {
  1467         {
  1451         if (!iTagsContextMenuControl->ItemMenuVisibility())
       
  1452             {
       
  1453             iShowFocus = EFalse;
       
  1454             ResetFocusColor();
       
  1455             }
       
  1456 
       
  1457         iDownEventReceived = EFalse;
  1468         iDownEventReceived = EFalse;
  1458         Display()->Roster().SetPointerEventObservers(0, *this);
  1469         Display()->Roster().SetPointerEventObservers(0, *this);
  1459         consumed = ETrue;
  1470         consumed = ETrue;
  1460         
  1471         
  1461         //If the long press timer is completed , and if upevent is received.. ignore it
  1472         //If the long press timer is completed , and if upevent is received.. ignore it
  1485                 if (layoutvisual == tappedvisual)
  1496                 if (layoutvisual == tappedvisual)
  1486                     {
  1497                     {
  1487                     TInt focus = iMediaList.FocusIndex();
  1498                     TInt focus = iMediaList.FocusIndex();
  1488                     if (index != focus)
  1499                     if (index != focus)
  1489                         {
  1500                         {
       
  1501                         iTouchFeedback->InstantFeedback( ETouchFeedbackBasic );
  1490                         TInt focusrowindex = iFocusRowIndex;
  1502                         TInt focusrowindex = iFocusRowIndex;
  1491                         iMediaList.SetFocusL(NGlxListDefs::EAbsolute, index);
  1503                         iMediaList.SetFocusL(NGlxListDefs::EAbsolute, index);
       
  1504                         SetFocusColor();
  1492                         iFocusRowIndex = RowNumber (iMediaList.FocusIndex ());
  1505                         iFocusRowIndex = RowNumber (iMediaList.FocusIndex ());
  1493                         
  1506                         
  1494                         if( iFocusRowIndex > focusrowindex)
  1507                         if( iFocusRowIndex > focusrowindex)
  1495                             {
  1508                             {
  1496                             GLX_LOG_INFO("GLX_CLOUD :: CGlxCloudViewControl::HandleDragL,b4 movedown");
  1509                             GLX_LOG_INFO("GLX_CLOUD :: CGlxCloudViewControl::HandleDragL,b4 movedown");
  1755         }
  1768         }
  1756     return false;
  1769     return false;
  1757     }
  1770     }
  1758 
  1771 
  1759 // ---------------------------------------------------------------------------
  1772 // ---------------------------------------------------------------------------
  1760 // InitializeScrollBar()
  1773 // attachScrollBar()
  1761 // ---------------------------------------------------------------------------
  1774 // ---------------------------------------------------------------------------
  1762 //
  1775 //	
  1763 void CGlxCloudViewControl::InitializeScrollBar(
  1776 void CGlxCloudViewControl::InitializeScrollBar(IAlfScrollBarWidget* aScrollBarWidget)
  1764         IAlfScrollBarWidget* aScrollBarWidget)
       
  1765     {
  1777     {
  1766     TRACER("GLX_CLOUD::CGlxCloudViewControl::InitializeScrollBar");
  1778     TRACER("GLX_CLOUD::CGlxCloudViewControl::InitializeScrollBar");
  1767     iScrollBarWidget = aScrollBarWidget;
  1779     iScrollBarWidget = aScrollBarWidget;
  1768     ((IAlfScrollBarModel *) (iScrollBarWidget->model()))->initializeData(
  1780     ((IAlfScrollBarModel *) (iScrollBarWidget->model()))->initializeData(
  1769             iScrollEventData.mSpan, iScrollEventData.mViewLength, 0);
  1781             iScrollEventData.mSpan, iScrollEventData.mViewLength, 0);
  1770     Scroll();
       
  1771     DisplayScrollBar();
  1782     DisplayScrollBar();
  1772     }
  1783     }
  1773 
  1784 
  1774 // ---------------------------------------------------------------------------
  1785 // ---------------------------------------------------------------------------
  1775 // Scroll()
  1786 // Scroll()
  1822 
  1833 
  1823 // ---------------------------------------------------------------------------
  1834 // ---------------------------------------------------------------------------
  1824 // DisplayScrollBar()
  1835 // DisplayScrollBar()
  1825 // ---------------------------------------------------------------------------
  1836 // ---------------------------------------------------------------------------
  1826 //
  1837 //
  1827 void CGlxCloudViewControl::DisplayScrollBar()
  1838 void CGlxCloudViewControl::DisplayScrollBar() 
  1828     {
  1839     {
  1829     TRACER("GLX_CLOUD::CGlxCloudViewControl::DisplayScrollBar()");
       
  1830     if (iScrollBarWidget)
  1840     if (iScrollBarWidget)
  1831         {
  1841         {
  1832         IAlfElement* vertBaseElement =(iScrollBarWidget->control()->findElement ("BaseElement"));
  1842         IAlfElement* vertBaseElement =(iScrollBarWidget->control()->findElement ("BaseElement"));
  1833         IAlfScrollBarDefaultBaseElement* scrollbarbaselement=static_cast<IAlfScrollBarDefaultBaseElement*> (
  1843         IAlfScrollBarDefaultBaseElement* scrollbarbaselement=static_cast<IAlfScrollBarDefaultBaseElement*> (
  1834             vertBaseElement->makeInterface (IAlfScrollBarDefaultBaseElement::type() ) );
  1844             vertBaseElement->makeInterface (IAlfScrollBarDefaultBaseElement::type() ) );
  1835 
  1845 
  1836         TInt totalHeight = 0;
  1846         // To set the scrollbar visibility, it's enough to set the opacity 
  1837         for (TInt index = 0; index <= iCloudInfo.Count() - 1; index++)
  1847         // of baselayout. No need to set the opacity of thumb separately. 
  1838             {
  1848         if (iScrollEventData.mSpan)
  1839             totalHeight += KRowHeight;
       
  1840             totalHeight += KNumMinRowSpace;
       
  1841             }
       
  1842 
       
  1843         // To set the scrollbar visibility, it's enough to set the opacity
       
  1844         // of baselayout. No need to set the opacity of thumb separately.
       
  1845         // Set the scrollbar visibility only
       
  1846         // when visuals height exceeds the screen height
       
  1847         if (iScrollEventData.mSpan && totalHeight > iTagScreenHeight)
       
  1848             {
  1849             {
  1849             //make scroll bar visible
  1850             //make scroll bar visible
  1850             GLX_LOG_INFO("GLX_CLOUD: Make scrollbar visible!");
       
  1851             scrollbarbaselement->setOpacity(1.0);
  1851             scrollbarbaselement->setOpacity(1.0);
  1852             }
  1852             }
  1853         else
  1853         else
  1854             {
  1854             {
  1855             //make scroll bar invisible
  1855             //make scroll bar invisible
  1866     {
  1866     {
  1867     TRect rect;
  1867     TRect rect;
  1868     AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect);
  1868     AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect);
  1869     if ((rect.Width() != (iTagScreenWidth + KRightmargin)) || (rect.Height() != iScreenHeight))
  1869     if ((rect.Width() != (iTagScreenWidth + KRightmargin)) || (rect.Height() != iScreenHeight))
  1870         {
  1870         {
  1871 		//set the new screen dimensions
  1871         //set the new screen dimensions
  1872 		iScreenHeight = rect.Height();
  1872         iScreenHeight=rect.Height();
  1873 		iTagScreenWidth = rect.Width() - KRightmargin;
  1873        iTagScreenWidth = rect.Width()- KRightmargin;
  1874 		if (IsLandscape())
  1874         if(IsLandscape())
  1875 			{
  1875             {   
  1876 			iTagScreenHeight = rect.Height();
  1876             iTagScreenHeight = rect.Height();   
  1877 			}
  1877             }
  1878 		else
  1878         else 
  1879 			{
  1879             {
  1880 			iTagScreenHeight = KTagScreenHeight;
  1880             iTagScreenHeight = KTagScreenHeight;
  1881 			}
  1881             }
  1882 
  1882 
  1883 		iViewPortLayout->SetSize(
  1883         iViewPortLayout->SetSize(TAlfRealSize(iTagScreenWidth,iTagScreenHeight), 0);
  1884 				TAlfRealSize(iTagScreenWidth, iTagScreenHeight), 0);
  1884         //delete all layout associations
  1885 		//delete all layout associations
  1885         if ( iCloudInfo.Count ()!= 0)//check for the empty cloud view
  1886 		if (iCloudInfo.Count() != 0)//check for the empty cloud view
  1886             {
  1887 			{
  1887             UpdateLayout();
  1888 			UpdateLayout();
  1888             FetchAttributeFromCacheL();
  1889 			FetchAttributeFromCacheL();
  1889             //generate row structures and draw rows on screen
  1890 			//generate row structures and draw rows on screen
  1890             UpdateRowDataL ();                                    
  1891 			UpdateRowDataL();
  1891 
  1892 
  1892             InitPhysicsL();
  1893 			InitPhysicsL();
  1893             }
  1894 			}
  1894         }
  1895 		}
       
  1896     }
  1895     }
  1897 
  1896 
  1898 // ---------------------------------------------------------------------------
  1897 // ---------------------------------------------------------------------------
  1899 // InitPhysicsL() 
  1898 // InitPhysicsL() 
  1900 // ---------------------------------------------------------------------------
  1899 // ---------------------------------------------------------------------------
  1962     else
  1961     else
  1963         {
  1962         {
  1964         return EFalse;
  1963         return EFalse;
  1965         }
  1964         }
  1966     }
  1965     }
  1967 
       
  1968 // ---------------------------------------------------------------------------
  1966 // ---------------------------------------------------------------------------
  1969 // TimerCompleteL()
  1967 // TimerCompleteL()
  1970 // ---------------------------------------------------------------------------
  1968 // ---------------------------------------------------------------------------
  1971 //
  1969 //
  1972 void CGlxCloudViewControl::TimerCompleteL()
  1970 void CGlxCloudViewControl::TimerCompleteL()
  1983                     ((focussedItemRect.iBr.iY - focussedItemRect.iTl.iY )/2); 
  1981                     ((focussedItemRect.iBr.iY - focussedItemRect.iTl.iY )/2); 
  1984     
  1982     
  1985     TRect rect;
  1983     TRect rect;
  1986     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
  1984     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
  1987     
  1985     
  1988     //only if not dragged and physics hasnt started
  1986     if(!iPhysicsStarted)//only if physics hasnt started
  1989     if (!iPhysicsStarted && !iViewDragged)
       
  1990         {
  1987         {
  1991         iTagsContextMenuControl->SetViewableRect(rect);
  1988         iTagsContextMenuControl->SetViewableRect(rect);
  1992         iTagsContextMenuControl->ShowItemMenuL(ETrue);
  1989         iTagsContextMenuControl->ShowItemMenuL(ETrue);
  1993         iTagsContextMenuControl->SetDisplay(midpoint);
  1990         iTagsContextMenuControl->SetDisplay(midpoint);
  1994         }
  1991         }
  1995    }
  1992    }
  1996 
       
  1997 // ---------------------------------------------------------------------------
  1993 // ---------------------------------------------------------------------------
  1998 // ShowContextItemMenuL()
  1994 // ShowContextItemMenuL()
  1999 // ---------------------------------------------------------------------------
  1995 // ---------------------------------------------------------------------------
  2000 //
  1996 //
  2001 void CGlxCloudViewControl::ShowContextItemMenuL(TBool aShow)
  1997 void CGlxCloudViewControl::ShowContextItemMenuL(TBool aShow)
  2002     {
  1998     {
  2003     TRACER("GLX_CLOUD::ShowContextItemMenuL");
       
  2004     GLX_LOG_INFO1("GLX_CLOUD::ShowContextItemMenuL() aShow=%d", aShow);
       
  2005     iTagsContextMenuControl->ShowItemMenuL(aShow);
  1999     iTagsContextMenuControl->ShowItemMenuL(aShow);
  2006     if(!aShow)
  2000     if(!aShow)
  2007         {
  2001         {
  2008         iViewPortLayout->UpdateChildrenLayout(0);
  2002         iViewPortLayout->UpdateChildrenLayout(0);
  2009         iShowFocus = EFalse;
       
  2010         ResetFocusColor();
       
  2011         }
       
  2012     }
       
  2013 
       
  2014 // ---------------------------------------------------------------------------
       
  2015 // SetFocusToFirstVisibleItemL()
       
  2016 // ---------------------------------------------------------------------------
       
  2017 //
       
  2018 void CGlxCloudViewControl::SetFocusToFirstVisibleItemL()
       
  2019     {
       
  2020     TRACER("GLX_CLOUD::CGlxCloudViewControl::SetFocusToFirstVisibleItemL()");
       
  2021     iShowFocus = ETrue;
       
  2022 
       
  2023     TInt visIndex = GetAbsoluteIndex(TPoint(KLeftMargin + KLeftMargin,
       
  2024             KColSpace));
       
  2025     GLX_LOG_INFO1("GLX_CLOUD::SetFocusToFirstVisibleItemL() visIndex=%d", visIndex);
       
  2026 
       
  2027     if (visIndex != KErrNotFound)
       
  2028         {
       
  2029         iMediaList.SetFocusL(NGlxListDefs::EAbsolute, visIndex);
       
  2030 
       
  2031         MoveUpIfRequired();
       
  2032         }
       
  2033     else
       
  2034         {
       
  2035         HandleLayoutFocusChange();
       
  2036         }
  2003         }
  2037     }
  2004     }
  2038 
  2005 
  2039 //End of file
  2006 //End of file