photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp
branchRCL_3
changeset 27 34937ec34dac
parent 26 5b3385a43d68
equal deleted inserted replaced
26:5b3385a43d68 27:34937ec34dac
    44 #include <mul/imulcoverflowwidget.h>            // Coverflow widget
    44 #include <mul/imulcoverflowwidget.h>            // Coverflow widget
    45 #include <mul/imulsliderwidget.h>               // For Slider Widget
    45 #include <mul/imulsliderwidget.h>               // For Slider Widget
    46 #include <mpxcollectionpath.h>
    46 #include <mpxcollectionpath.h>
    47 
    47 
    48 #include <gesturehelper.h>
    48 #include <gesturehelper.h>
       
    49 #include <coeutils.h>
    49 
    50 
    50 using namespace GestureHelper;
    51 using namespace GestureHelper;
    51 
    52 
    52 #include <glxhdmicontroller.h>
    53 #include <glxhdmicontroller.h>
    53 
    54 
   227     if(iMMCNotifier)
   228     if(iMMCNotifier)
   228         {
   229         {
   229         delete iMMCNotifier;
   230         delete iMMCNotifier;
   230         iMMCNotifier = NULL;
   231         iMMCNotifier = NULL;
   231         }
   232         }
       
   233     
       
   234     if (iUri)
       
   235         {
       
   236         delete iUri;
       
   237         }
       
   238     
   232     if(iMediaListMulModelProvider)
   239     if(iMediaListMulModelProvider)
   233         {
   240         {
   234         delete iMediaListMulModelProvider;
   241         delete iMediaListMulModelProvider;
   235         }
   242         }
   236     if(iTimer)
   243     if(iTimer)
   423     
   430     
   424 	//Disable the status pane here as it causes flicker while animating
   431 	//Disable the status pane here as it causes flicker while animating
   425     CAknViewAppUi* appui = AppUi();
   432     CAknViewAppUi* appui = AppUi();
   426     if ( appui )
   433     if ( appui )
   427         {
   434         {
       
   435         SetTitlePaneTextL(KNullDesC);
   428         appui->StatusPane()->MakeVisible(EFalse);
   436         appui->StatusPane()->MakeVisible(EFalse);
   429         appui->Cba()->MakeVisible(EFalse);
   437         appui->Cba()->MakeVisible(EFalse);
   430         }
   438         }
   431 
   439 
   432 	iViewWidget->show(true);    
   440 	iViewWidget->show(true);    
   947         }
   955         }
   948     
   956     
   949     if(iZoomControl && iZoomControl->Activated())
   957     if(iZoomControl && iZoomControl->Activated())
   950         {
   958         {
   951         iZoomControl->HandleZoomForegroundEvent(aForeground);
   959         iZoomControl->HandleZoomForegroundEvent(aForeground);
       
   960         if (aForeground && iUri && !ConeUtils::FileExists(iUri->Des()))
       
   961             {
       
   962             GLX_LOG_INFO("File does not exist, Exit zoom view!");
       
   963             HandleItemRemovedL();
       
   964             }
   952         }
   965         }
   953 
   966 
   954     if (!aForeground)
   967     if (!aForeground)
   955         {
   968         {
   956         if(iHdmiController)
   969         if(iHdmiController)
  1161                 return EEventConsumed;
  1174                 return EEventConsumed;
  1162                 }
  1175                 }
  1163             case ETypeItemRemoved:
  1176             case ETypeItemRemoved:
  1164                 {
  1177                 {
  1165                 GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeItemRemoved");
  1178                 GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeItemRemoved");
  1166                 TInt focusIndex = iMediaList->FocusIndex();
  1179                 HandleItemRemovedL();
  1167                 TInt mlCount = iMediaList->Count();
       
  1168                 GLX_LOG_INFO2("CGlxFullScreenViewImp::OfferEventL focusIndex=%d, iOldFocusIndex=%d",
       
  1169                         focusIndex, iOldFocusIndex);
       
  1170                 if (mlCount && (iOldFocusIndex == focusIndex
       
  1171                         || iOldFocusIndex == mlCount) && iZoomControl
       
  1172                         && iZoomControl->Activated())
       
  1173                     {
       
  1174                     GLX_LOG_INFO("Fcused item is removed, Exit zoom view!");
       
  1175                     DeactivateZoomControlL();
       
  1176                     }
       
  1177                 SetItemToHDMIL();
       
  1178                 if (focusIndex != KErrNotFound && EUiOn == GetUiState())
       
  1179                     {
       
  1180                     // show/hide the slider
       
  1181                     if (iSliderWidget)
       
  1182                         {
       
  1183                         iSliderWidget->ShowWidget(CheckIfSliderToBeShownL());
       
  1184                         }
       
  1185                     }
       
  1186                 /** if this is the last image deleted when Photo is in foreground, go back to the previous view*/
       
  1187                 if (mlCount == 0 && IsForeground()
       
  1188                         && iNaviState->ViewingMode()
       
  1189                                 == NGlxNavigationalState::EView)
       
  1190                     {
       
  1191                     iUiUtility->SetViewNavigationDirection(
       
  1192                             EGlxNavigationBackwards);
       
  1193                     iNaviState->ActivatePreviousViewL();
       
  1194                     }
       
  1195                 TRAP_IGNORE(ShowDrmExpiryNoteL());
       
  1196                 return EEventConsumed;
  1180                 return EEventConsumed;
  1197                 }
  1181                 }
  1198             case ETypeHighlight:
  1182             case ETypeHighlight:
  1199                 {
  1183                 {
  1200                 GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeHighlight");
  1184                 GLX_LOG_INFO("CGlxFullScreenViewImp::OfferEventL ETypeHighlight");
  1315             break;
  1299             break;
  1316             }
  1300             }
  1317 		case EAknSoftkeyBack:
  1301 		case EAknSoftkeyBack:
  1318             {
  1302             {
  1319             HideUi(ETrue);
  1303             HideUi(ETrue);
       
  1304             // Enable status pane  and  Set null text 
       
  1305 			StatusPane()->MakeVisible(ETrue);
       
  1306 			SetTitlePaneTextL(KNullDesC);
  1320             break;
  1307             break;
  1321             }                        
  1308             }                        
  1322         } 
  1309         } 
  1323     return consumed;
  1310     return consumed;
  1324     }
  1311     }
  1852         //Set the external display to cloning mode if
  1839         //Set the external display to cloning mode if
  1853         //the current item is something we dont support 
  1840         //the current item is something we dont support 
  1854         //(e.g. video, corrupted item, item with invalid DRM)
  1841         //(e.g. video, corrupted item, item with invalid DRM)
  1855         iHdmiController->ItemNotSupported();
  1842         iHdmiController->ItemNotSupported();
  1856         }
  1843         }
       
  1844     
  1857     iOldFocusIndex = iMediaList->FocusIndex();
  1845     iOldFocusIndex = iMediaList->FocusIndex();
       
  1846     delete iUri;
       
  1847     iUri = NULL;   
       
  1848     iUri = item.Uri().AllocL();
  1858     }
  1849     }
  1859 
  1850 
  1860 // ---------------------------------------------------------------------------
  1851 // ---------------------------------------------------------------------------
  1861 // HandleMMCInsertionL
  1852 // HandleMMCInsertionL
  1862 // 
  1853 // 
  2089                         - KFullScreenIterator, 1);
  2080                         - KFullScreenIterator, 1);
  2090                 }
  2081                 }
  2091             }
  2082             }
  2092         }
  2083         }
  2093     }
  2084     }
       
  2085 
       
  2086 // ---------------------------------------------------------------------------
       
  2087 // Sets the title pane text
       
  2088 // ---------------------------------------------------------------------------
       
  2089 void CGlxFullScreenViewImp::SetTitlePaneTextL(const TDesC& aTitleText)
       
  2090 	{
       
  2091     TRACER("CGlxFullScreenViewImp::SetTitlePaneTextL()");
       
  2092     CAknViewAppUi* appui = AppUi();
       
  2093     if (appui)
       
  2094         {
       
  2095         CAknTitlePane* titlePane =
       
  2096                 (CAknTitlePane*) appui->StatusPane()->ControlL(TUid::Uid(
       
  2097                         EEikStatusPaneUidTitle));
       
  2098         titlePane->SetTextL(aTitleText);
       
  2099         titlePane->DrawNow();
       
  2100         }
       
  2101     }
       
  2102 
       
  2103 // ---------------------------------------------------------------------------
       
  2104 // HandleItemRemovedL
       
  2105 // ---------------------------------------------------------------------------
       
  2106 void CGlxFullScreenViewImp::HandleItemRemovedL()
       
  2107     {
       
  2108     TRACER("CGlxFullScreenViewImp::HandleItemRemovedL()");
       
  2109     TInt focusIndex = iMediaList->FocusIndex();
       
  2110     TInt mlCount = iMediaList->Count();
       
  2111     GLX_LOG_INFO2("CGlxFullScreenViewImp::HandleItemRemovedL focusIndex=%d, iOldFocusIndex=%d",
       
  2112             focusIndex, iOldFocusIndex);
       
  2113     // When photos is in background, the Following scenario could happen,
       
  2114     // 1) First item is deleted => iOldFocusIndex == focusIndex (or)
       
  2115     // 2) Last item is deleted => iOldFocusIndex == mlCount (or)
       
  2116     // 3) New item is added and focused item is deleted => iOldFocusIndex != focusIndex
       
  2117     if (mlCount && (iOldFocusIndex == focusIndex || iOldFocusIndex == mlCount
       
  2118             || iOldFocusIndex != focusIndex) && iZoomControl
       
  2119             && iZoomControl->Activated())
       
  2120         {
       
  2121         GLX_LOG_INFO("Focused item is removed, Exit zoom view!");
       
  2122         DeactivateZoomControlL();
       
  2123         }
       
  2124     SetItemToHDMIL();
       
  2125     if (focusIndex != KErrNotFound && EUiOn == GetUiState())
       
  2126         {
       
  2127         // show/hide the slider
       
  2128         if (iSliderWidget)
       
  2129             {
       
  2130             iSliderWidget->ShowWidget(CheckIfSliderToBeShownL());
       
  2131             }
       
  2132         }
       
  2133     /** if this is the last image deleted when Photo is in foreground, go back to the previous view*/
       
  2134     if (mlCount == 0 && IsForeground() && iNaviState->ViewingMode()
       
  2135             == NGlxNavigationalState::EView)
       
  2136         {
       
  2137         iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards);
       
  2138         iNaviState->ActivatePreviousViewL();
       
  2139         }
       
  2140     TRAP_IGNORE(ShowDrmExpiryNoteL());
       
  2141     }