videocollection/hgmyvideos/src/vcxhgmyvideosvideolistimpl.cpp
branchRCL_3
changeset 6 7d91903f795f
parent 0 96612d01cf9f
child 8 ce5ada96ab30
equal deleted inserted replaced
2:dec420019252 6:7d91903f795f
    55 #include "vcxhgmyvideos.hrh"
    55 #include "vcxhgmyvideos.hrh"
    56 #include "vcxhgmyvideosvideocopier.h"
    56 #include "vcxhgmyvideosvideocopier.h"
    57 #include "vcxhgmyvideospanics.h"
    57 #include "vcxhgmyvideospanics.h"
    58 #include "vcxhgmyvideosupnpinterface.h"
    58 #include "vcxhgmyvideosupnpinterface.h"
    59 #include "vcxhgtelephonyclient.h"
    59 #include "vcxhgtelephonyclient.h"
       
    60 #ifdef RD_VIDEO_AS_RINGING_TONE
    60 #include "vcxhgmyvideosaiwmenuhandler.h"
    61 #include "vcxhgmyvideosaiwmenuhandler.h"
       
    62 #endif
    61 
    63 
    62 _LIT( KVcxHgMyVideosMifFile, "\\resource\\apps\\vcxhgmyvideosicons.mif" );
    64 _LIT( KVcxHgMyVideosMifFile, "\\resource\\apps\\vcxhgmyvideosicons.mif" );
    63 
    65 
    64 // ============================ MEMBER FUNCTIONS ===============================
    66 // ============================ MEMBER FUNCTIONS ===============================
    65 
    67 
   102         CVcxHgMyVideosModel& aModel,
   104         CVcxHgMyVideosModel& aModel,
   103         CVcxHgMyVideosMainView& aView,
   105         CVcxHgMyVideosMainView& aView,
   104         CHgScroller& aScroller )
   106         CHgScroller& aScroller )
   105   : CVcxHgMyVideosListBase( aModel, aView, aScroller ),
   107   : CVcxHgMyVideosListBase( aModel, aView, aScroller ),
   106     iCurrentlyPlayedVideo( KErrNotFound ),
   108     iCurrentlyPlayedVideo( KErrNotFound ),
   107     iMultipleMarkingActive( EFalse ),
   109     iMultipleMarkingActive( EFalse )
   108     iAiwMenuHandler( NULL )
   110 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   111     , iAiwMenuHandler( NULL )
       
   112 #endif
   109     {
   113     {
   110     }
   114     }
   111 
   115 
   112 // -----------------------------------------------------------------------------
   116 // -----------------------------------------------------------------------------
   113 // CVcxHgMyVideosVideoListImpl::ConstructL()
   117 // CVcxHgMyVideosVideoListImpl::ConstructL()
   182     delete iCenRep;
   186     delete iCenRep;
   183     delete iUPnP;
   187     delete iUPnP;
   184     delete iVideoCopier;
   188     delete iVideoCopier;
   185     delete iVideoModel;
   189     delete iVideoModel;
   186     delete iSendUi;
   190     delete iSendUi;
       
   191 #ifdef RD_VIDEO_AS_RINGING_TONE
   187     delete iAiwMenuHandler;
   192     delete iAiwMenuHandler;
       
   193 #endif
   188     }
   194     }
   189 
   195 
   190 // -----------------------------------------------------------------------------
   196 // -----------------------------------------------------------------------------
   191 // CVcxHgMyVideosVideoListImpl::DoListActivateL()
   197 // CVcxHgMyVideosVideoListImpl::DoListActivateL()
   192 // -----------------------------------------------------------------------------
   198 // -----------------------------------------------------------------------------
   707 // ------------------------------------------------------------------------------
   713 // ------------------------------------------------------------------------------
   708 //
   714 //
   709 void CVcxHgMyVideosVideoListImpl::DynInitMenuPaneL( TInt aResourceId,
   715 void CVcxHgMyVideosVideoListImpl::DynInitMenuPaneL( TInt aResourceId,
   710                                                     CEikMenuPane* aMenuPane )
   716                                                     CEikMenuPane* aMenuPane )
   711     {
   717     {
       
   718 #ifdef RD_VIDEO_AS_RINGING_TONE
   712     if ( AiwMenuHandlerL()->TryHandleSubmenuL( aMenuPane ) )
   719     if ( AiwMenuHandlerL()->TryHandleSubmenuL( aMenuPane ) )
   713         {
   720         {
   714         // Submenu was initialized by Aiw
   721         // Submenu was initialized by Aiw
   715         return;
   722         return;
   716         }
   723         }
       
   724 #endif
   717 
   725 
   718     RArray<TInt> markedVideos;
   726     RArray<TInt> markedVideos;
   719     CleanupClosePushL( markedVideos );
   727     CleanupClosePushL( markedVideos );
   720     
   728     
   721     iVideoModel->MarkedVideosL( markedVideos );
   729     iVideoModel->MarkedVideosL( markedVideos );
   815             // SendUi uses TInt for size, hide Send menu item for over 2GB attachments
   823             // SendUi uses TInt for size, hide Send menu item for over 2GB attachments
   816             if ( attachmentsTotalSize > 0 && attachmentsTotalSize < KMaxTInt )
   824             if ( attachmentsTotalSize > 0 && attachmentsTotalSize < KMaxTInt )
   817                 {
   825                 {
   818                 // Place Send menu item on top of "Use as" (Assign) submenu
   826                 // Place Send menu item on top of "Use as" (Assign) submenu
   819                 TInt sendItemIndex = 0;
   827                 TInt sendItemIndex = 0;
       
   828 #ifdef RD_VIDEO_AS_RINGING_TONE                
   820                 aMenuPane->ItemAndPos( EVcxHgMyVideosCmdAiwAssign, sendItemIndex );
   829                 aMenuPane->ItemAndPos( EVcxHgMyVideosCmdAiwAssign, sendItemIndex );
       
   830 #else
       
   831                 aMenuPane->ItemAndPos( EVcxHgMyVideosCmdSortSubMenu, sendItemIndex );
       
   832 #endif
   821                 // Add Send item to menu
   833                 // Add Send item to menu
   822                 TSendingCapabilities capabilities(
   834                 TSendingCapabilities capabilities(
   823                     0,
   835                     0,
   824                     attachmentsTotalSize,
   836                     attachmentsTotalSize,
   825                     TSendingCapabilities::ESupportsAttachments );
   837                     TSendingCapabilities::ESupportsAttachments );
   835                 itemData.iFlags |= EEikMenuItemSpecificListQuery;
   847                 itemData.iFlags |= EEikMenuItemSpecificListQuery;
   836                 }
   848                 }
   837             CleanupStack::PopAndDestroy( &operationTargets );
   849             CleanupStack::PopAndDestroy( &operationTargets );
   838             }
   850             }
   839 
   851 
       
   852 #ifdef RD_VIDEO_AS_RINGING_TONE
   840         // Assign (use as) menu item
   853         // Assign (use as) menu item
   841         if ( ( markedVideos.Count() == 0 ) &&
   854         if ( ( markedVideos.Count() == 0 ) &&
   842                 ( highlight >= 0 ) && ( count > 0 ) &&
   855                 ( highlight >= 0 ) && ( count > 0 ) &&
   843                 ( ( dlState == EVcxMyVideosDlStateNone ) ) )
   856                 ( ( dlState == EVcxMyVideosDlStateNone ) ) )
   844             {
   857             {
   847         else
   860         else
   848             {
   861             {
   849             // Hide Assign (use as) menu item
   862             // Hide Assign (use as) menu item
   850             aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdAiwAssign, ETrue );
   863             aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdAiwAssign, ETrue );
   851             }
   864             }
       
   865 #endif
   852 
   866 
   853         // Marking submenu
   867         // Marking submenu
   854         if( count > 0 )
   868         if( count > 0 )
   855             {
   869             {
   856             // Show "Mark/Unmark" only if there are videos in the list
   870             // Show "Mark/Unmark" only if there are videos in the list
   862             {
   876             {
   863             // Dont show "Sort by" if list is empty.
   877             // Dont show "Sort by" if list is empty.
   864             aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdSortSubMenu, ETrue );
   878             aMenuPane->SetItemDimmed( EVcxHgMyVideosCmdSortSubMenu, ETrue );
   865             }
   879             }
   866         }
   880         }
       
   881 #ifdef RD_VIDEO_AS_RINGING_TONE
   867     else if ( aResourceId == R_VCXHGMYVIDEOS_USE_AS_SUBMENU )
   882     else if ( aResourceId == R_VCXHGMYVIDEOS_USE_AS_SUBMENU )
   868         {
   883         {
   869         RArray<TInt> operationTargets;
   884         RArray<TInt> operationTargets;
   870         CleanupClosePushL( operationTargets );
   885         CleanupClosePushL( operationTargets );
   871 
   886 
   884                 }
   899                 }
   885             CleanupStack::PopAndDestroy( videoUri );
   900             CleanupStack::PopAndDestroy( videoUri );
   886             }
   901             }
   887         CleanupStack::PopAndDestroy( &operationTargets );
   902         CleanupStack::PopAndDestroy( &operationTargets );
   888         }
   903         }
       
   904 #endif
   889     CleanupStack::PopAndDestroy( &markedVideos );
   905     CleanupStack::PopAndDestroy( &markedVideos );
   890     }
   906     }
   891 
   907 
   892 // -----------------------------------------------------------------------------
   908 // -----------------------------------------------------------------------------
   893 // CVcxHgMyVideosVideoListImpl::SetEmptyListTextL()
   909 // CVcxHgMyVideosVideoListImpl::SetEmptyListTextL()
  1119         iSendUi = CSendUi::NewL();
  1135         iSendUi = CSendUi::NewL();
  1120         }
  1136         }
  1121     return iSendUi;
  1137     return iSendUi;
  1122     }
  1138     }
  1123 
  1139 
       
  1140 #ifdef RD_VIDEO_AS_RINGING_TONE
  1124 // ---------------------------------------------------------------------------
  1141 // ---------------------------------------------------------------------------
  1125 // CVcxHgMyVideosVideoListImpl::TryHandleAiwCommandL()
  1142 // CVcxHgMyVideosVideoListImpl::TryHandleAiwCommandL()
  1126 // ---------------------------------------------------------------------------
  1143 // ---------------------------------------------------------------------------
  1127 //
  1144 //
  1128 void CVcxHgMyVideosVideoListImpl::TryHandleAiwCommandL( TInt aCommand )
  1145 void CVcxHgMyVideosVideoListImpl::TryHandleAiwCommandL( TInt aCommand )
  1147             CleanupStack::PopAndDestroy( videoUri );
  1164             CleanupStack::PopAndDestroy( videoUri );
  1148             }
  1165             }
  1149         CleanupStack::PopAndDestroy( &operationTargets );
  1166         CleanupStack::PopAndDestroy( &operationTargets );
  1150         }
  1167         }
  1151     }
  1168     }
       
  1169 #endif
  1152 
  1170 
  1153 // ---------------------------------------------------------------------------
  1171 // ---------------------------------------------------------------------------
  1154 // CVcxHgMyVideosVideoListImpl::IsMarking()
  1172 // CVcxHgMyVideosVideoListImpl::IsMarking()
  1155 // ---------------------------------------------------------------------------
  1173 // ---------------------------------------------------------------------------
  1156 //
  1174 //
  1163         ret = ETrue;
  1181         ret = ETrue;
  1164         }
  1182         }
  1165     return ret;
  1183     return ret;
  1166     }
  1184     }
  1167 
  1185 
       
  1186 #ifdef RD_VIDEO_AS_RINGING_TONE
  1168 // ---------------------------------------------------------------------------
  1187 // ---------------------------------------------------------------------------
  1169 // CVcxHgMyVideosVideoListImpl::AiwMenuHandlerL()
  1188 // CVcxHgMyVideosVideoListImpl::AiwMenuHandlerL()
  1170 // ---------------------------------------------------------------------------
  1189 // ---------------------------------------------------------------------------
  1171 //
  1190 //
  1172 CHgMyVideosAiwMenuHandler* CVcxHgMyVideosVideoListImpl::AiwMenuHandlerL()
  1191 CHgMyVideosAiwMenuHandler* CVcxHgMyVideosVideoListImpl::AiwMenuHandlerL()
  1176         iAiwMenuHandler = new (ELeave) CHgMyVideosAiwMenuHandler();
  1195         iAiwMenuHandler = new (ELeave) CHgMyVideosAiwMenuHandler();
  1177         iAiwMenuHandler->AttachMenuL( R_VCXHGMYVIDEOS_USE_AS_SUBMENU );
  1196         iAiwMenuHandler->AttachMenuL( R_VCXHGMYVIDEOS_USE_AS_SUBMENU );
  1178         }
  1197         }
  1179     return iAiwMenuHandler;
  1198     return iAiwMenuHandler;
  1180     }
  1199     }
       
  1200 #endif