camerauis/cameraapp/generic/src/CamBurstThumbnailView.cpp
changeset 19 d9aefe59d544
parent 3 8b2d6d0384b0
child 21 fa6d9f75d6a6
child 28 3075d9b614e6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  View class to display a thumbnail grid after burst capture*
       
    15 */
       
    16 
       
    17 
       
    18 // INCLUDE FILES
       
    19 
       
    20 #include <eikmenub.h>
       
    21 #include <StringLoader.h>       
       
    22 #include <AknQueryDialog.h>
       
    23 #include <TSendingCapabilities.h>
       
    24 #include <cameraapp.rsg>
       
    25 #include <vgacamsettings.rsg>
       
    26 #include <sendnorm.rsg>
       
    27 #include <sendui.h>
       
    28 #include <SenduiMtmUids.h>
       
    29 #include <CMessageData.h>
       
    30 #include <aknlayoutscalable_apps.cdl.h> // AknLayoutScalable_Apps
       
    31 //#include <SFIUtilsAppInterface.h>
       
    32 #include <aknnotewrappers.h>  // CAknInformationNote
       
    33 #include <akntoolbar.h> // CAknToolbar
       
    34 #include <aknbutton.h>
       
    35 #include <eiksoftkeypostingtransparency.h> // EikSoftkeyPostingTransparency
       
    36 
       
    37 #include "CamAppUi.h"
       
    38 #include "CamUtility.h"
       
    39 //#include "camproductvariant.h"
       
    40 #include "CamBurstThumbnailView.h"
       
    41 #include "CamAppUiBase.h"
       
    42 #include "CamBurstThumbnailContainer.h"
       
    43 #include "Cam.hrh"
       
    44 #include "CamBurstThumbnailGridModel.h"
       
    45 #include "CamBurstThumbnailGrid.h"
       
    46 #include "CamBurstCaptureArray.h"
       
    47 #include "camoneclickuploadutility.h"
       
    48 #include "CameraUiConfigManager.h"
       
    49 #include "OstTraceDefinitions.h"
       
    50 #ifdef OST_TRACE_COMPILER_IN_USE
       
    51 #include "CamBurstThumbnailViewTraces.h"
       
    52 #endif
       
    53 
       
    54 
       
    55 
       
    56 //CONSTANTS
       
    57 _LIT( KCamImageMimeType, "image/jpeg" );
       
    58 
       
    59 // ========================= MEMBER FUNCTIONS ================================
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // CCamBurstThumbnailView::NewLC
       
    63 // Symbian OS two-phased constructor
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 CCamBurstThumbnailView* CCamBurstThumbnailView::NewLC( CCamAppController& aController )
       
    67     {
       
    68     CCamBurstThumbnailView* self = 
       
    69         new( ELeave ) CCamBurstThumbnailView( aController );
       
    70 
       
    71     CleanupStack::PushL( self );
       
    72     self->ConstructL();
       
    73 
       
    74     return self;
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // CCamBurstThumbnailView destructor
       
    79 // 
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 CCamBurstThumbnailView::~CCamBurstThumbnailView()
       
    83   {
       
    84   PRINT( _L("Camera => ~CCamBurstThumbnailView") );
       
    85   // Free some space by deleting the model
       
    86   delete iGridModel;
       
    87 
       
    88   // NOTE: iAiwServiceHandler owned and deleted by base class
       
    89   PRINT( _L("Camera <= ~CCamBurstThumbnailView") );
       
    90   }
       
    91 
       
    92 // ---------------------------------------------------------------------------
       
    93 // CCamBurstThumbnailView::Id
       
    94 // Returns UID of view
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 TUid CCamBurstThumbnailView::Id() const
       
    98     {
       
    99     return TUid::Uid( ECamViewIdBurstThumbnail );
       
   100     }
       
   101 
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // CCamBurstThumbnailView::DynInitMenuPaneL
       
   105 // Changes MenuPane dynamically
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 void CCamBurstThumbnailView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
       
   109     {
       
   110     PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL"))
       
   111        
       
   112     // initializes the aiw service parameters for aiw commands
       
   113     DynInitAiwMenuPaneL( aResourceId, aMenuPane );
       
   114                 
       
   115     if ( iAiwServiceHandler )
       
   116         {
       
   117         // handle any AIW menu cascades
       
   118         if ( iAiwServiceHandler->HandleSubmenuL( *aMenuPane ) )
       
   119             {
       
   120             return;
       
   121             }
       
   122         }
       
   123 
       
   124     if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
       
   125         {
       
   126         // If there are >1 images marked remove the 
       
   127         // open image item.
       
   128         if ( iGridModel->NoOfMarkedImages() > 1 )
       
   129             {
       
   130             aMenuPane->SetItemDimmed( ECamCmdOpenPhoto, ETrue );
       
   131             TInt itemPos = 0;
       
   132             if( aMenuPane->MenuItemExists( KAiwCmdUpload, itemPos ) )
       
   133                 {
       
   134                 PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL SetItemDimmed: KAiwCmdUpload"))
       
   135                 aMenuPane->SetItemDimmed(
       
   136                     KAiwCmdUpload, ETrue );
       
   137                 }
       
   138             if( aMenuPane->MenuItemExists( ECamCmdShareOnOvi, itemPos ) )
       
   139                 {
       
   140                 PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL SetItemDimmed: ECamCmdShareOnOvi"))
       
   141                 aMenuPane->SetItemDimmed(
       
   142                     ECamCmdShareOnOvi, ETrue );
       
   143                 }
       
   144             }
       
   145         
       
   146         // In touch ui the delete option is available on the fixed toolbar
       
   147         // there is no need to display it in the options menu
       
   148         if ( iController.IsTouchScreenSupported() )
       
   149             {
       
   150             TInt itemPos = 0;
       
   151             if ( aMenuPane->MenuItemExists( ECamCmdDelete, itemPos ) )
       
   152                 {
       
   153                 aMenuPane->SetItemDimmed( ECamCmdDelete, ETrue );
       
   154                 }
       
   155             }
       
   156         } // ends: if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
       
   157     
       
   158  
       
   159     // ------------------------------------------------------------------
       
   160     if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU ||
       
   161          aResourceId == R_CAM_BURST_THUMBNAIL_OK_MENU )
       
   162         {
       
   163         TBool showSend = ETrue;
       
   164         TBool showSendToCaller = EFalse;
       
   165 
       
   166 /*#ifndef __WINS__
       
   167         if ( iSFIUtils->IsCLIValidL() )
       
   168             {
       
   169             showSend = EFalse;
       
   170             showSendToCaller = ETrue;
       
   171 
       
   172             if ( iGridModel->NoOfMarkedImages() > 1 )
       
   173                 {
       
   174                 // Send to caller is disabled if multiple images
       
   175                 // have been marked.
       
   176                 showSendToCaller = EFalse;
       
   177                 }
       
   178             }
       
   179 #endif*/
       
   180 
       
   181         if ( iController.IsTouchScreenSupported() &&
       
   182              !iOneClickUploadUtility->OneClickUploadSupported() &&
       
   183              aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
       
   184             {
       
   185             // In touch UI, when one click upload is not supported,
       
   186             // there will be a Send button in the fixed toolbar. Options
       
   187             // menu items are not needed. Send is kept in the context menu.
       
   188             showSend = EFalse;
       
   189             showSendToCaller = EFalse;
       
   190             }
       
   191 
       
   192         TInt itemPos = 0;
       
   193         if( aMenuPane->MenuItemExists( ECamCmdSendToCallerMultimedia, itemPos ) )
       
   194             {
       
   195             aMenuPane->SetItemDimmed(
       
   196                 ECamCmdSendToCallerMultimedia, !showSendToCaller );
       
   197             }
       
   198 
       
   199         if( aMenuPane->MenuItemExists( ECamCmdSend, itemPos ) )
       
   200             {
       
   201             aMenuPane->SetItemDimmed(
       
   202                 ECamCmdSend, !showSend );
       
   203             }
       
   204         }
       
   205 
       
   206     if ( aResourceId == R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION )
       
   207         {
       
   208         if ( iGridModel->IsMarkedL( iGridModel->HighlightedGridIndex() ) )
       
   209             {
       
   210             // If marked, hide the MARK option
       
   211             aMenuPane->SetItemDimmed( EAknCmdMark, ETrue );
       
   212             }
       
   213         else
       
   214             {
       
   215             // If unmarked, hide the UNMARK option
       
   216             aMenuPane->SetItemDimmed( EAknCmdUnmark, ETrue );        
       
   217             }
       
   218         
       
   219         if ( iGridModel->NoOfMarkedImages() == 0 )
       
   220             {
       
   221             // If NO marked cells, hide the UNMARK ALL option
       
   222             aMenuPane->SetItemDimmed( EAknUnmarkAll, ETrue );        
       
   223             }
       
   224 
       
   225         if ( iGridModel->NoOfMarkedImages() == iGridModel->NoOfValidCells() )
       
   226             {
       
   227             // If ALL cells are marked, hide the MARKALL option
       
   228             aMenuPane->SetItemDimmed( EAknMarkAll, ETrue ); 
       
   229             }    
       
   230         }    
       
   231 
       
   232     PRINT( _L("Camera <= CCamBurstThumbnailView::DynInitMenuPaneL"))
       
   233     }   
       
   234 
       
   235 // -----------------------------------------------------------------------------
       
   236 // CCamBurstThumbnailView::HandleCommandL
       
   237 // Handle commands
       
   238 // -----------------------------------------------------------------------------
       
   239 //
       
   240 void CCamBurstThumbnailView::HandleCommandL( TInt aCommand )
       
   241     {
       
   242     
       
   243     PRINT1( _L("Camera => CCamBurstThumbnailView::HandleCommandL (aCommand: %d)"), aCommand )
       
   244     
       
   245     // sometimes commands come even after DoDeactivate() has been called.
       
   246     // this makes sure that those are ignored.
       
   247     if ( iGridModel == NULL )
       
   248         {
       
   249         return;
       
   250         }
       
   251     
       
   252     switch ( aCommand )
       
   253         {
       
   254         case ECamCmdOneClickUpload:
       
   255             {
       
   256             TInt markedItems = iGridModel->NoOfMarkedImages();
       
   257             // If there are no images marked use the highlighted image
       
   258             // set it now for safety just in case no marked images are found
       
   259             iController.SetAsCurrentImage(
       
   260                     iGridModel->HighlightedBurstIndex() );
       
   261 
       
   262             if ( markedItems > 0 )
       
   263                 {
       
   264                 // Upload marked images
       
   265 
       
   266                 CDesC16ArrayFlat* fileNames =
       
   267                     new ( ELeave ) CDesC16ArrayFlat( markedItems );
       
   268                 CleanupStack::PushL( fileNames );
       
   269 
       
   270                 for ( TInt i = 0; i < iGridModel->NoOfImages(); i++ )
       
   271                     {
       
   272                     if ( iGridModel->IsMarkedL( i ) )
       
   273                         {
       
   274                         fileNames->AppendL( iGridModel->ImageFileName( i ) );
       
   275                         }
       
   276                     }
       
   277                 iOneClickUploadUtility->UploadL(
       
   278                         *fileNames );
       
   279                 CleanupStack::PopAndDestroy( fileNames );
       
   280                 }
       
   281             else
       
   282                 {
       
   283                 // Upload highlighted image
       
   284                 iOneClickUploadUtility->UploadL(
       
   285                         iController.CurrentFullFileName() );
       
   286                 }
       
   287             break;
       
   288             }
       
   289         case ECamCmdRenameImage:
       
   290             {
       
   291             iController.SetAsCurrentImage( 
       
   292                 iGridModel->ConvertFromValidToGlobalIndex (
       
   293                     SingleSelectionGridIndexL() ) );
       
   294             QueryRenameL( ECamControllerImage );
       
   295             break;
       
   296             }
       
   297 
       
   298         case ECamCmdDelete:        
       
   299             {
       
   300             if ( DisplayDeleteNoteL() )
       
   301                 {
       
   302                 DoDeleteL();
       
   303                 }
       
   304             
       
   305             break;
       
   306             }
       
   307             
       
   308         case ECamCmdNewPhoto:
       
   309             {
       
   310             // the thumbnail scaling needs to be stopped in
       
   311             // preparation for the app ui switching the view
       
   312             iGridModel->CancelThumbnails();
       
   313             CCamViewBase::HandleCommandL( aCommand ); // Pass on to AppUi
       
   314             break;
       
   315             }
       
   316             
       
   317         case ECamCmdToolbarMarkUnmark:
       
   318             {
       
   319             TBool mark = iGridModel->IsMarkedL( iGridModel->HighlightedGridIndex() );                        
       
   320             iGridModel->SetCurrentMark( !mark );
       
   321       //      UpdateOneClickUploadButton();
       
   322             break;
       
   323             }
       
   324                       
       
   325         case EAknCmdMark:        
       
   326             {
       
   327             iGridModel->SetCurrentMark( ETrue );
       
   328     //        UpdateOneClickUploadButton();
       
   329             break;
       
   330             }
       
   331     
       
   332         case EAknCmdUnmark:
       
   333             {
       
   334             iGridModel->SetCurrentMark( EFalse );
       
   335  //           UpdateOneClickUploadButton();
       
   336             break;
       
   337             }
       
   338     
       
   339         case EAknMarkAll:
       
   340             {
       
   341             iGridModel->MarkAll( ETrue );
       
   342   //          UpdateOneClickUploadButton();
       
   343             break;
       
   344             }
       
   345     
       
   346         case EAknUnmarkAll:
       
   347             {
       
   348             iGridModel->MarkAll( EFalse );
       
   349   //          UpdateOneClickUploadButton();
       
   350             break;
       
   351             }
       
   352     
       
   353         case EAknSoftkeyBack:
       
   354             {
       
   355             // the thumbnail scaling needs to be stopped in
       
   356             // preparation for the app ui switching the view
       
   357             iGridModel->CancelThumbnails();            
       
   358             // About to be closed by user, so will want to delete the model
       
   359             // on deactivation
       
   360             if ( IsForeground() )
       
   361                 {
       
   362                 iResetModelOnDeactivate = ETrue;    
       
   363                 }
       
   364             CCamViewBase::HandleCommandL( aCommand ); // Pass on to AppUi
       
   365             break;
       
   366             }
       
   367         case ECamMSKCmdAppChange:
       
   368         case EAknSoftkeySelect:
       
   369             {   
       
   370             if ( iGridModel->NoOfMarkedImages() == 0 )
       
   371                 {
       
   372                 // select the focused item and open it to still postcapture
       
   373                 iResetModelOnDeactivate = EFalse;   
       
   374 
       
   375                 // This selects the highlighted image
       
   376                 iController.SetAsCurrentImage( iGridModel->HighlightedGridIndex() );
       
   377                 // ConvertFromValidToGlobalIndex used so that appropriate images are displayed
       
   378                 iController.SetAsCurrentImage( iGridModel->ConvertFromValidToGlobalIndex( iGridModel->HighlightedGridIndex() ) );    
       
   379                 CCamViewBase::HandleCommandL( ECamCmdOpenPhoto );
       
   380                 }
       
   381             else    
       
   382                 {   
       
   383                 // If at least one image is marked, open context sensitive menu
       
   384                 CEikMenuBar* menuBar = MenuBar();            
       
   385                 if ( menuBar )
       
   386                     {
       
   387                     menuBar->SetMenuTitleResourceId( R_CAM_BURST_THUMBNAIL_OK_MENUBAR);
       
   388                     menuBar->SetMenuType( CEikMenuBar::EMenuContext );
       
   389                     menuBar->TryDisplayMenuBarL();
       
   390                     // Here we again set back the type of menu to "Options" when pressed LSK
       
   391                     menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
       
   392                     menuBar->SetMenuTitleResourceId( R_CAM_BURST_THUMBNAIL_MENUBAR);
       
   393                     }
       
   394                 }
       
   395             break;
       
   396             }
       
   397 
       
   398         case EAknSoftkeyOptions:
       
   399             {
       
   400             // do nothing - handled by the framework
       
   401             break;
       
   402             }
       
   403 
       
   404         case EAknSoftkeyCancel:
       
   405             {
       
   406             // do nothing - handled by framework
       
   407             break;
       
   408             }
       
   409             
       
   410         case ECamCmdSend:
       
   411             {
       
   412             CCamPostCaptureViewBase::HandleCommandL( aCommand );
       
   413             break;
       
   414             }
       
   415 
       
   416         case ECamCmdSendToCallerMultimedia:
       
   417             {
       
   418 /*#ifndef __WINS__
       
   419             DoInCallSendL();
       
   420 #endif*/
       
   421             }
       
   422             break;
       
   423             
       
   424 		case ECamCmdQuickSend:
       
   425        		{
       
   426 /*#ifndef __WINS__
       
   427             if( iSFIUtils->IsCLIValidL() )
       
   428                 {
       
   429                 // only do send to caller if no images are marked
       
   430                 // or one image is marked
       
   431                 if ( iGridModel->NoOfMarkedImages() < 2 )
       
   432                     {
       
   433                     DoInCallSendL();
       
   434                     }
       
   435                 }
       
   436             else
       
   437 #endif // __WINS__*/
       
   438                 //{
       
   439                 DoSendAsL();
       
   440                 //}
       
   441             }
       
   442             break;            
       
   443 
       
   444        case ECamCmdExitStandby:
       
   445         	{
       
   446        		PRINT( _L("Camera :: CCamBurstThumbnailView::HandleCommandL ECamCmdExitStandby in") )	
       
   447         	CCamViewBase::ExitStandbyModeL();
       
   448         	PRINT( _L("Camera :: CCamBurstThumbnailView::HandleCommandL ECamCmdExitStandby out") )
       
   449         	break;
       
   450         	}
       
   451 
       
   452         case ECamCmdOpenPhoto:
       
   453             {
       
   454             iResetModelOnDeactivate = EFalse;   
       
   455             TInt markedItems = iGridModel->NoOfMarkedImages();
       
   456             // If there are no images marked use the highlighted image 
       
   457             // set it now for safety just in case no marked images are found
       
   458             iController.SetAsCurrentImage( iGridModel->HighlightedBurstIndex() );
       
   459 
       
   460             if ( markedItems != 0 )  // this command should never be available if there is >1 marked item
       
   461                 {
       
   462                 TInt totalItems = iGridModel->NoOfImages();
       
   463                 TInt index = 0;
       
   464                 TBool found = EFalse;
       
   465                 while ( index < totalItems && !found )
       
   466                     {
       
   467                     if ( iGridModel->IsMarkedL( index ) )
       
   468                         {
       
   469                         found = ETrue;
       
   470                         iController.SetAsCurrentImage( index );
       
   471                         }
       
   472                     index++;
       
   473                     }
       
   474                 }
       
   475             }
       
   476             //lint -fallthrough 
       
   477         default: 
       
   478             {
       
   479             // Handle AIW commands
       
   480             TInt aiwServiceCmd = iAiwServiceHandler->ServiceCmdByMenuCmd( aCommand );
       
   481             if ( aiwServiceCmd != KAiwCmdNone )
       
   482                 {
       
   483                 CAiwGenericParamList& inParams  = iAiwServiceHandler->InParamListL();
       
   484                 CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL();
       
   485                 // Add file path/s to AIW parameters
       
   486                 TInt markedItems = iGridModel->NoOfMarkedImages();
       
   487                 // If there are no images marked use the highlighted image
       
   488                 if ( markedItems == 0 )
       
   489                     {
       
   490                     TAiwVariant variant( iGridModel->ImageFileName( 
       
   491                                          iGridModel->HighlightedBurstIndex() ) );
       
   492                     TAiwGenericParam param( EGenericParamFile, variant );
       
   493                     inParams.AppendL( param );
       
   494                     
       
   495                     // Set as contact call iamge needs image MIME type as AIW param
       
   496                     // Set as wall paper requires MIME type also.
       
   497                     TAiwVariant variant2(  KCamImageMimeType );
       
   498                     TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
       
   499                     inParams.AppendL( param2 );
       
   500                     
       
   501                     }
       
   502                 else // there are marked items, add them to the list
       
   503                     {
       
   504                     TInt totalItems = iGridModel->NoOfImages();
       
   505                     TInt index = 0;
       
   506                     TInt found = 0;
       
   507                     while ( index < totalItems && found < markedItems )
       
   508                         {
       
   509                         if ( iGridModel->IsMarkedL( index ) )
       
   510                             {
       
   511                             found++;
       
   512                             TAiwVariant variant( iGridModel->ImageFileName( index ) );
       
   513                             TAiwGenericParam param( EGenericParamFile, variant );
       
   514                             inParams.AppendL( param );
       
   515                             
       
   516                             // Set as contact call iamge needs image MIME type as AIW param
       
   517                             // Set as wall paper requires MIME type also.
       
   518                             TAiwVariant variant2(  KCamImageMimeType );
       
   519                             TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
       
   520                             inParams.AppendL( param2 );
       
   521                             }
       
   522                         index++;
       
   523                         }
       
   524                     }
       
   525 
       
   526                 iAiwServiceHandler->ExecuteMenuCmdL( aCommand, inParams, outParams, 0, this );
       
   527                 }
       
   528             else
       
   529                 {
       
   530                 CCamViewBase::HandleCommandL( aCommand );
       
   531                 }
       
   532             break;
       
   533             }
       
   534         }    
       
   535     
       
   536     PRINT1( _L("Camera <= CCamBurstThumbnailView::HandleCommandL (aCommand: %d)"), aCommand )
       
   537     }
       
   538 
       
   539 
       
   540 // ---------------------------------------------------------------------------
       
   541 // CCamBurstThumbnailView::HandleNotifyL
       
   542 // Handles any notification caused by asynchronous ExecuteCommandL
       
   543 // or event.
       
   544 // ---------------------------------------------------------------------------
       
   545 //
       
   546 TInt CCamBurstThumbnailView::HandleNotifyL(
       
   547     TInt /*aCmdId*/,
       
   548     TInt aEventId,
       
   549     CAiwGenericParamList& /*aEventParamList*/,
       
   550     const CAiwGenericParamList& /*aInParamList*/ )
       
   551     {
       
   552     //AIW fails to assign. eg. the contact is locked for being used now.
       
   553     if ( aEventId == KAiwEventError && iController.IsAppUiAvailable() )
       
   554       {
       
   555       CCamAppUi* appUi =  static_cast<CCamAppUi*>( AppUi() );
       
   556       TRAP_IGNORE( appUi->HandleCameraErrorL( KErrInUse ) );
       
   557       }
       
   558     
       
   559     return 0;
       
   560     }
       
   561 
       
   562 // -----------------------------------------------------------------------------
       
   563 // CCamBurstThumbnailView::DisplayDeleteNoteL()
       
   564 // Display confirmation note for deletion of images
       
   565 // -----------------------------------------------------------------------------
       
   566 //
       
   567 TBool CCamBurstThumbnailView::DisplayDeleteNoteL()
       
   568     {
       
   569     // Display the delete confirmation note
       
   570     HBufC* confirmationText;
       
   571 
       
   572     // Find the number of images marked, to work out which note to display.
       
   573     TInt noteText = 0;
       
   574     TInt noteDlg = 0;
       
   575     TInt noOfMarkedImages = iGridModel->NoOfMarkedImages();
       
   576 
       
   577     // Check if no of marked images is zero (if we are to delete the current
       
   578     // highlighted object) or one (if we are to delete a single marked item).
       
   579     if ( noOfMarkedImages  <= 1)    
       
   580         {
       
   581         noteText = R_CAM_STILL_POST_CAPTURE_DELETE_NOTE_TEXT;
       
   582         noteDlg  = R_CAM_STILL_POST_CAPTURE_DELETE_NOTE;
       
   583         confirmationText = StringLoader::LoadLC( noteText );    
       
   584         }
       
   585     else //  noOfMarkedImages > 1 
       
   586         {   
       
   587         noteText = R_CAM_BURST_DELETE_MULTIPLE_NOTE_TEXT;
       
   588         noteDlg  = R_CAM_BURST_DELETE_MULTIPLE_NOTE;
       
   589         confirmationText = StringLoader::LoadLC( noteText, noOfMarkedImages );    
       
   590         }
       
   591     
       
   592     // Create the dialog with the text, and show it to the user
       
   593     CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText );
       
   594     CleanupStack::PopAndDestroy( confirmationText );
       
   595 
       
   596     return confirmationDialog->ExecuteLD( noteDlg );
       
   597     }
       
   598 
       
   599 // -----------------------------------------------------------------------------
       
   600 // CCamBurstThumbnailView::DoDeleteL
       
   601 // Marks the required files for deletion
       
   602 // -----------------------------------------------------------------------------
       
   603 //
       
   604 void CCamBurstThumbnailView::DoDeleteL()
       
   605     {
       
   606     if ( iGridModel->NoOfMarkedImages() > 0 )
       
   607         {
       
   608         // Confirmation; mark the files for deletion.
       
   609         iGridModel->DeleteMarkedL();
       
   610         }
       
   611     else
       
   612         {
       
   613         // Confirmation; mark the highlighted item
       
   614         iGridModel->DeleteHighlightL();
       
   615         }
       
   616  //   UpdateOneClickUploadButton();
       
   617     }
       
   618 
       
   619 
       
   620 
       
   621 // -----------------------------------------------------------------------------
       
   622 // CCamBurstThumbnailView::HandleForegroundEventL
       
   623 // Handle foreground event
       
   624 // -----------------------------------------------------------------------------
       
   625 //
       
   626 void CCamBurstThumbnailView::HandleForegroundEventL( TBool aForeground )
       
   627   {
       
   628   PRINT( _L("Camera => CCamBurstThumbnailView::HandleForegroundEventL") );
       
   629 
       
   630   if ( aForeground )
       
   631     {
       
   632     CCamAppUiBase* appui = static_cast<CCamAppUiBase*>( AppUi() );
       
   633     if ( !appui->IsInPretendExit() )
       
   634       {
       
   635       IncrementCameraUsers();
       
   636       iController.DeepSleepTimerStart();
       
   637       }
       
   638     }
       
   639   else
       
   640     {
       
   641     // Only decrements if we have incremented.
       
   642     DecrementCameraUsers();
       
   643     }
       
   644 
       
   645   PRINT( _L("Camera <= CCamBurstThumbnailView::HandleForegroundEventL") );
       
   646   }
       
   647 
       
   648 
       
   649 // ---------------------------------------------------------------------------
       
   650 // CCamBurstThumbnailView::DoActivateL
       
   651 // Activate this view
       
   652 // ---------------------------------------------------------------------------
       
   653 //
       
   654 void CCamBurstThumbnailView::DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
       
   655                                                     const TDesC8& aCustomMessage )
       
   656     {    
       
   657     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMBURSTTHUMBNAILVIEW_DOACTIVATEL, "e_CCamBurstThumbnailView_DoActivateL 1" );
       
   658     PRINT( _L( "Camera => CCamBurstThumbnailView::DoActivateL" ) );
       
   659     PERF_EVENT_START_L2( EPerfEventBurstThumbnailViewActivation );
       
   660     if ( aPrevViewId.iViewUid.iUid == ECamViewIdStillPreCapture || !iGridModel )
       
   661         {
       
   662         iResetModelOnDeactivate = EFalse;
       
   663 
       
   664         // Precautionary tidyup, though should never happen. 
       
   665         if ( iGridModel )
       
   666             {
       
   667             delete iGridModel;
       
   668             iGridModel = NULL;
       
   669             }
       
   670 
       
   671         // If we've come from Pre-Capture view, we shouldn't have an active model.
       
   672         // Create a new one and register with it.
       
   673         iGridModel = CCamBurstThumbnailGridModel::NewL();        
       
   674         iGridModel->AddModelObserverL( this, 
       
   675                                       CCamBurstThumbnailGridModel::EModelEventDeleted | 
       
   676                                       CCamBurstThumbnailGridModel::EModelEventHighlight );
       
   677 
       
   678         // Guaranteed to only be called right after a burst capture         
       
   679         iGridModel->SetBurstArrayL( iController.BurstCaptureArray() );
       
   680         }
       
   681     else
       
   682         {
       
   683         // We still need to re-register for model events, else if we return to 
       
   684         // grid view from post-capture, we won't receive delete/highlight events
       
   685         // any more.
       
   686         iGridModel->AddModelObserverL( this, 
       
   687                                       CCamBurstThumbnailGridModel::EModelEventDeleted | 
       
   688                                       CCamBurstThumbnailGridModel::EModelEventHighlight );
       
   689 
       
   690         iGridModel->RefreshL();
       
   691         }
       
   692           
       
   693     if ( iController.IsTouchScreenSupported() )
       
   694         {
       
   695         // set toolbar
       
   696 		if ( iOneClickUploadUtility->OneClickUploadSupported() )
       
   697             {
       
   698             CreateAndSetToolbarL( R_CAM_BURST_POSTCAPTURE_TOOLBAR_UPLOAD );
       
   699             UpdateToolbarIconsL();
       
   700             }
       
   701         CAknToolbar* fixedToolbar = Toolbar();
       
   702         if ( fixedToolbar )
       
   703             {
       
   704             fixedToolbar->SetToolbarObserver( this );
       
   705             fixedToolbar->SetToolbarVisibility( ETrue );           
       
   706             }
       
   707         }
       
   708     
       
   709     
       
   710  
       
   711     CCamPostCaptureViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
       
   712     
       
   713     iAiwServiceHandler->Reset();   
       
   714 
       
   715     // initialise AIW services for touch menu
       
   716     iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU, 
       
   717                                      R_CAM_MOVE_TO_STILL_IMAGE_SEQUENCE_INTEREST );
       
   718     iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU, 
       
   719             R_CAM_SET_AS_CALL_IMAGE_INTEREST );
       
   720     iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU, 
       
   721             R_CAM_SHARE_ON_OVI_INTEREST );
       
   722             
       
   723     
       
   724     static_cast<CCamAppUiBase*>( AppUi() )->PushDefaultNaviPaneL();
       
   725     PERF_EVENT_END_L2( EPerfEventBurstThumbnailViewActivation );
       
   726     PRINT( _L( "Camera <= CCamBurstThumbnailView::DoActivateL" ) );
       
   727     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMBURSTTHUMBNAILVIEW_DOACTIVATEL, "e_CCamBurstThumbnailView_DoActivateL 0" );
       
   728     }
       
   729 
       
   730 // ---------------------------------------------------------------------------
       
   731 // CCamBurstThumbnailView::DoDeactivate
       
   732 // Deactivate this view
       
   733 // ---------------------------------------------------------------------------
       
   734 //
       
   735 void CCamBurstThumbnailView::DoDeactivate()
       
   736     { 
       
   737     PRINT( _L( "Camera => CCamBurstThumbnailView::DoDeactivateL" ) );          
       
   738     iGridModel->RemoveModelObserver( this,  CCamBurstThumbnailGridModel::EModelEventDeleted | 
       
   739                                             CCamBurstThumbnailGridModel::EModelEventHighlight );
       
   740 
       
   741     CCamPostCaptureViewBase::DoDeactivate();
       
   742 
       
   743     // Must delete this last (after everything had a chance to de-register)
       
   744     // also delete model if all images have been deleted
       
   745     if ( iResetModelOnDeactivate || iController.BurstCaptureArray()->ImagesRemaining() == 0 )
       
   746         {   
       
   747         PRINT( _L( "Camera: CCamBurstThumbnailView::DoDeactivateL resetting model on deactivate" ) );             
       
   748         delete iGridModel;
       
   749         iGridModel = NULL;
       
   750         }
       
   751 	PRINT( _L( "Camera <= CCamBurstThumbnailView::DoDeactivateL" ) );        
       
   752     }
       
   753 
       
   754 
       
   755 // ---------------------------------------------------------------------------
       
   756 // CCamBurstThumbnailView::HighlightChanged
       
   757 // Called when the highlighted item in the grid view changes
       
   758 // ---------------------------------------------------------------------------
       
   759 //
       
   760 void CCamBurstThumbnailView::HighlightChanged()
       
   761     {
       
   762     // Check title is correct as highlight may have changed
       
   763     TRAPD( ignore, SetTitlePaneTextL() );
       
   764     if ( ignore )
       
   765         { 
       
   766         // Do nothing ( removes build warning )
       
   767         }
       
   768     }
       
   769 
       
   770 
       
   771 // ---------------------------------------------------------------------------
       
   772 // CCamBurstThumbnailView::ImagesDeleted
       
   773 // Called when images have been deleted from the grid view
       
   774 // ---------------------------------------------------------------------------
       
   775 //
       
   776 void CCamBurstThumbnailView::ImagesDeleted() 
       
   777     {
       
   778     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
       
   779 
       
   780     // inform the media gallery
       
   781     TRAPD( ignore, appUi->HandleControllerEventL( ECamEventMediaFileChanged, KErrNone ) );
       
   782     // Check there is still at least one image 
       
   783     if ( iGridModel->NoOfValidCells() == 0 )
       
   784         {
       
   785         iResetModelOnDeactivate = ETrue; 
       
   786 
       
   787         CAknToolbar* toolbar = Toolbar();
       
   788         if (toolbar)
       
   789             {
       
   790             toolbar->SetToolbarVisibility( EFalse );
       
   791             }
       
   792         // Close thumbnail view, go back to Burst PreCapture
       
   793         TRAP( ignore, HandleCommandL( EAknSoftkeyBack ) );
       
   794         }
       
   795     else
       
   796         {
       
   797         iGridModel->UpdateViewableGrid( EFalse );
       
   798         }
       
   799     }
       
   800 
       
   801 // ---------------------------------------------------------------------------
       
   802 // CCamViewBase::IsNewNameValidL
       
   803 // Check if renaming to the given name is valid.
       
   804 // ---------------------------------------------------------------------------
       
   805 //
       
   806 TBool 
       
   807 CCamBurstThumbnailView::IsNewNameValidL( const TDesC& aFilename )
       
   808     {
       
   809     TInt currentIndex = iGridModel->HighlightedGridIndex();
       
   810 
       
   811     TInt i = 0;
       
   812     TInt burstItemsCount = iGridModel->NoOfValidCells();
       
   813     for ( i = 0; i < burstItemsCount; ++i )
       
   814         {
       
   815         TPtrC imageName = iGridModel->ImageName( i );
       
   816 
       
   817         if ( i != currentIndex )
       
   818             {
       
   819             if ( CamUtility::CompareIgnoreCase( aFilename,
       
   820                  imageName ) )
       
   821                 {
       
   822                 // New name already exists on grid
       
   823                 return EFalse;
       
   824                 }
       
   825             }
       
   826 
       
   827         }
       
   828     return ETrue;
       
   829     }
       
   830 
       
   831 
       
   832 // ---------------------------------------------------------------------------
       
   833 // CCamBurstThumbnailView::CCamBurstThumbnailView
       
   834 // C++ constructor
       
   835 // ---------------------------------------------------------------------------
       
   836 //
       
   837 CCamBurstThumbnailView::CCamBurstThumbnailView( CCamAppController& aController )
       
   838     : CCamPostCaptureViewBase( aController )
       
   839     {
       
   840     }
       
   841 
       
   842 // ---------------------------------------------------------------------------
       
   843 // CCamBurstThumbnailView::ConstructL
       
   844 // Symbian OS 2nd phase constructor
       
   845 // ---------------------------------------------------------------------------
       
   846 //
       
   847 void CCamBurstThumbnailView::ConstructL()
       
   848     {    
       
   849     PRINT( _L("Camera => CCamBurstThumbnailView::ConstructL") );
       
   850     
       
   851     BaseConstructL( R_CAM_BURST_THUMBNAIL_VIEW );
       
   852     CCamPostCaptureViewBase::ConstructL();
       
   853     
       
   854     PRINT( _L("Camera <= CCamBurstThumbnailView::ConstructL") );
       
   855     }
       
   856 
       
   857 // ---------------------------------------------------------------------------
       
   858 // CCamBurstThumbnailView::CreateContainerL
       
   859 // Create container control
       
   860 // ---------------------------------------------------------------------------
       
   861 //
       
   862 void CCamBurstThumbnailView::CreateContainerL()
       
   863     {    
       
   864     PRINT( _L("Camera => CCamBurstThumbnailView::CreateContainerL") );
       
   865     CCamBurstThumbnailContainer* cont = new (ELeave) CCamBurstThumbnailContainer( 
       
   866                                                            iController,
       
   867                                                            *this, 
       
   868                                                            *iGridModel );
       
   869     CleanupStack::PushL( cont );
       
   870     cont->SetMopParent( this );
       
   871     TRect screen;
       
   872     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
       
   873     cont->ConstructL( screen );
       
   874     CleanupStack::Pop( cont );
       
   875     iContainer = cont;
       
   876     PRINT( _L("Camera <= CCamBurstThumbnailView::CreateContainerL") );
       
   877     }
       
   878 
       
   879 // ---------------------------------------------------------------------------
       
   880 // CCamBurstThumbnailView::SetTitlePaneTextL
       
   881 // Set the view's title text
       
   882 // ---------------------------------------------------------------------------
       
   883 //
       
   884 void CCamBurstThumbnailView::SetTitlePaneTextL()
       
   885     {    
       
   886     PRINT( _L("Camera => CCamBurstThumbnailView::SetTitlePaneTextL") );
       
   887     // Do not want to set the title to the filename if it's shown in the application pane
       
   888     _LIT(KSpaces, "  ");
       
   889     static_cast<CCamAppUi*>( iEikonEnv->AppUi() )->SetTitleL( KSpaces );
       
   890     PRINT( _L("Camera <= CCamBurstThumbnailView::SetTitlePaneTextL") );
       
   891     }
       
   892     
       
   893 // ---------------------------------------------------------------------------
       
   894 // CCamBurstThumbnailView::DoSendAsL
       
   895 // Use SendUI to create a message containing burst thumbnails
       
   896 // ---------------------------------------------------------------------------
       
   897 //
       
   898 void CCamBurstThumbnailView::DoSendAsL() const
       
   899     {
       
   900     PRINT( _L("Camera => CCamBurstThumbnailView::DoSendAsL") );
       
   901     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() ); 
       
   902     
       
   903     if ( !appUi->SendAsInProgress() )
       
   904         {
       
   905         appUi->SetSendAsInProgressL( ETrue ); 
       
   906         CMessageData* messageData = CMessageData::NewLC();
       
   907 
       
   908         TInt totalItems = iGridModel->NoOfImages();
       
   909         TInt markedItems = iGridModel->NoOfMarkedImages();
       
   910 
       
   911         if ( markedItems == 0 )
       
   912             {
       
   913             // if no images are marked use the highlighted item instead
       
   914             messageData->AppendAttachmentL( iGridModel->ImageFileName( 
       
   915                     iGridModel->HighlightedBurstIndex() ) );
       
   916             }
       
   917         else
       
   918             {
       
   919             // attach all marked items
       
   920             TInt index = 0;
       
   921             TInt found = 0;
       
   922             while ( index < totalItems && found < markedItems )
       
   923                 {
       
   924                 if ( iGridModel->IsMarkedL( index ) )
       
   925                     {
       
   926                     found++;
       
   927                     messageData->AppendAttachmentL( iGridModel->ImageFileName( index ) );
       
   928                     }
       
   929                 index++;
       
   930                 }
       
   931             }
       
   932 
       
   933         TRAP_IGNORE( iSendAppUi->ShowQueryAndSendL( messageData, iSendingCapabilities ) )
       
   934         
       
   935         appUi->SetSendAsInProgressL( EFalse );
       
   936         CleanupStack::PopAndDestroy( messageData );
       
   937         }
       
   938     
       
   939     
       
   940     PRINT( _L("Camera <= CCamBurstThumbnailView::DoSendAsL") );
       
   941     }
       
   942 
       
   943 // ---------------------------------------------------------------------------
       
   944 // CCamBurstThumbnailView::SingleSelectionGridIndexL()
       
   945 // Returns the array index of the first marked item,
       
   946 // or highlighted item if none marked.
       
   947 // ---------------------------------------------------------------------------
       
   948 //
       
   949 TInt CCamBurstThumbnailView::SingleSelectionGridIndexL() const
       
   950     {
       
   951     TInt ret = KErrNotFound;
       
   952 
       
   953     if( iGridModel->NoOfMarkedImages() == 0 )
       
   954         {
       
   955         ret = iGridModel->HighlightedGridIndex();
       
   956         }
       
   957     else
       
   958         {
       
   959         TInt totalItems = iGridModel->NoOfImages();
       
   960         for( TInt index = 0; index < totalItems; index++ )
       
   961             {
       
   962             if ( iGridModel->IsMarkedL( index ) )
       
   963                 {
       
   964                 ret = index;
       
   965                 break;
       
   966                 }
       
   967             }
       
   968         }
       
   969 
       
   970     return ret;
       
   971     }
       
   972 
       
   973 // ---------------------------------------------------------------------------
       
   974 // CCamViewBase::IsBurstPostCapture
       
   975 // Returns whether the view is a burst mode postcapture view
       
   976 // ---------------------------------------------------------------------------
       
   977 //
       
   978 TBool CCamBurstThumbnailView::IsBurstPostCapture()
       
   979     {
       
   980     return ETrue;
       
   981     }
       
   982 
       
   983 // ---------------------------------------------------------------------------
       
   984 // CCamViewBase::ImageFilesDeleted
       
   985 // Notifies view that images files have been deleted outside of camera
       
   986 // ---------------------------------------------------------------------------
       
   987 //
       
   988 void CCamBurstThumbnailView::ImageFilesDeleted()
       
   989     {
       
   990     PRINT( _L("Camera => CCamBurstThumbnailView::ImageFilesDeleted") )
       
   991     if ( iGridModel )
       
   992         {
       
   993         iGridModel->ImageFilesDeleted();
       
   994         }
       
   995     PRINT( _L("Camera <= CCamBurstThumbnailView::ImageFilesDeleted") )
       
   996     }
       
   997 
       
   998 
       
   999 /*#ifndef __WINS__
       
  1000 // ---------------------------------------------------------------------------
       
  1001 // CCamBurstThumbnailView::DoInCallSendL
       
  1002 // Handle send to caller functionality
       
  1003 // ---------------------------------------------------------------------------
       
  1004 //
       
  1005 void CCamBurstThumbnailView::DoInCallSendL() const
       
  1006     {
       
  1007     // Ignore if more than one item marked
       
  1008     if( iGridModel->NoOfMarkedImages() < 2 )
       
  1009         {
       
  1010         TInt index = SingleSelectionGridIndexL();
       
  1011         if ( iSFIUtils && iSFIUtils->IsCLIValidL() && index >=0 )
       
  1012             {
       
  1013             iSFIUtils->SendMediaFileL( iGridModel->ImageFileName( index ) );
       
  1014             }
       
  1015         }
       
  1016     }
       
  1017 #endif // __WINS__*/
       
  1018 
       
  1019 // ---------------------------------------------------------------------------
       
  1020 // CCamBurstThumbnailView::CalculateThumbnailSize
       
  1021 // Calculates the size of a single thumbnail based on the infromation 
       
  1022 // how many images are alltogether shown on the burst grid
       
  1023 // ---------------------------------------------------------------------------
       
  1024 //
       
  1025 TSize CCamBurstThumbnailView::CalculateThumbnailSize( TInt aNumberOfBurstImages )
       
  1026 	{
       
  1027 	TSize thumb;
       
  1028 	TAknLayoutRect gridLayout;
       
  1029 	TAknLayoutRect cellLayout;
       
  1030 	TAknLayoutRect thumbLayout;
       
  1031 	
       
  1032 	thumb.iHeight = 0;
       
  1033 	thumb.iWidth = 0;
       
  1034 	
       
  1035 	if ( aNumberOfBurstImages <= KBurstGridDefaultThumbnails )
       
  1036 		{
       
  1037 		 gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 1 ) );
       
  1038 		 cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 1, 0, 0 ) ); 
       
  1039 		 thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 0, 0, 0 ) ); 
       
  1040 		}
       
  1041 	else if ( aNumberOfBurstImages <= KBurstGridMaxVisibleThumbnails )
       
  1042 		{
       
  1043 		 gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 3 ) );
       
  1044 		 cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 3, 0, 0 ) ); 
       
  1045 		 thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 1, 0, 0 ) ); 
       
  1046 		}
       
  1047 	else
       
  1048 		{
       
  1049 		 gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 5 ) );
       
  1050 		 cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 5, 0, 0 ) ); 
       
  1051 		 thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 2, 0, 0 ) ); 
       
  1052 		}
       
  1053 	
       
  1054 	thumb.iHeight = thumbLayout.Rect().Height();
       
  1055 	thumb.iWidth = thumbLayout.Rect().Width();
       
  1056 	
       
  1057 	return thumb;
       
  1058 	}
       
  1059 
       
  1060 
       
  1061 void CCamBurstThumbnailView::DynInitAiwMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
       
  1062     {
       
  1063 
       
  1064     if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
       
  1065         {
       
  1066         if ( iAiwServiceHandler && iAiwServiceHandler->IsAiwMenu( aResourceId ) )
       
  1067             {
       
  1068 
       
  1069             CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL();
       
  1070             TInt markedItems = iGridModel->NoOfMarkedImages();
       
  1071             // If there are no images marked use the highlighted image
       
  1072 
       
  1073             TCamOrientation orientation = static_cast<CCamAppUiBase*>( AppUi() )->CamOrientation();
       
  1074             
       
  1075             if ( markedItems == 0 )
       
  1076                 {
       
  1077                 TAiwVariant variant( iGridModel->ImageFileName( 
       
  1078                         iGridModel->HighlightedBurstIndex() ) );
       
  1079                 TAiwGenericParam param( EGenericParamFile, variant );
       
  1080                 paramList.AppendL( param );
       
  1081 
       
  1082                 // Set as contact call image needs image MIME type as AIW param
       
  1083                 //if ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft )
       
  1084                 {
       
  1085                 TAiwVariant variant2(  KCamImageMimeType );
       
  1086                 TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
       
  1087                 paramList.AppendL( param2 );
       
  1088                 }
       
  1089 
       
  1090                 }
       
  1091             else if ( markedItems == 1 )
       
  1092                 {
       
  1093                 TInt totalItems = iGridModel->NoOfImages();
       
  1094                 TInt index = 0;
       
  1095                 while ( index < totalItems )
       
  1096                     {
       
  1097                     if ( iGridModel->IsMarkedL( index ) )
       
  1098                         {
       
  1099 
       
  1100                         TAiwVariant variant( iGridModel->ImageFileName( index ) );
       
  1101                         TAiwGenericParam param( EGenericParamFile, variant );
       
  1102                         paramList.AppendL( param );
       
  1103 
       
  1104                         //if ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft )
       
  1105                         {
       
  1106                         TAiwVariant variant2(  KCamImageMimeType );
       
  1107                         TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
       
  1108                         paramList.AppendL( param2 );
       
  1109                         }
       
  1110 
       
  1111                         break;
       
  1112                         }
       
  1113                     index++;
       
  1114                     }
       
  1115                 }
       
  1116             else // there are more than on marked item
       
  1117                 {
       
  1118                 // removing lint warning
       
  1119                 }
       
  1120 
       
  1121             iAiwServiceHandler->InitializeMenuPaneL(
       
  1122                     *aMenuPane, 
       
  1123                     aResourceId, 
       
  1124                     ECamCmdAIWCommands, 
       
  1125                     paramList );
       
  1126             }
       
  1127 
       
  1128         }
       
  1129 
       
  1130     }
       
  1131 
       
  1132 // ---------------------------------------------------------------------------
       
  1133 // Dim 1-click upload button if more than one image is marked
       
  1134 // ---------------------------------------------------------------------------
       
  1135 //
       
  1136 void CCamBurstThumbnailView::UpdateOneClickUploadButton()
       
  1137     {
       
  1138     CAknToolbar* toolbar = Toolbar();
       
  1139     if( toolbar && iGridModel )
       
  1140         {
       
  1141         TBool shouldBeDimmed = ( iGridModel->NoOfMarkedImages() > 1 );
       
  1142 
       
  1143         CAknButton* button = static_cast<CAknButton*>(
       
  1144                 toolbar->ControlOrNull( ECamCmdOneClickUpload ) );
       
  1145 		
       
  1146 		if ( button )
       
  1147             {
       
  1148             TBool isDimmed = button->IsDimmed();
       
  1149             if ( ( shouldBeDimmed && !isDimmed ) ||
       
  1150                  ( !shouldBeDimmed && isDimmed ) )
       
  1151                  {
       
  1152                  button->SetDimmed( shouldBeDimmed );
       
  1153                  button->DrawDeferred();
       
  1154                  }
       
  1155              }
       
  1156         }
       
  1157     }
       
  1158 
       
  1159 
       
  1160 //  End of File