meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp
branchRCL_3
changeset 80 726fba06891a
parent 64 3533d4323edc
equal deleted inserted replaced
73:c8382f7b54ef 80:726fba06891a
   153                 bitmapStruct.iItemId,
   153                 bitmapStruct.iItemId,
   154                 tempRect,
   154                 tempRect,
   155                 EFalse );
   155                 EFalse );
   156 
   156 
   157     iRichTextViewer->SetSkinBackgroundControlContextL( iBgCtrlContext );
   157     iRichTextViewer->SetSkinBackgroundControlContextL( iBgCtrlContext );
       
   158     iSelectedLink = NULL;
   158     }
   159     }
   159 
   160 
   160 // ---------------------------------------------------------------------------
   161 // ---------------------------------------------------------------------------
   161 // CMRViewerAttachmentsField::MinimumSize
   162 // CMRViewerAttachmentsField::MinimumSize
   162 // ---------------------------------------------------------------------------
   163 // ---------------------------------------------------------------------------
   465     	}
   466     	}
   466 
   467 
   467     if ( IsValidAttachmentViewerCommand(aCommand) && iAttachmentCommandHandler )
   468     if ( IsValidAttachmentViewerCommand(aCommand) && iAttachmentCommandHandler )
   468         {
   469         {
   469         const CESMRRichTextLink* currentLink = iRichTextViewer->GetSelectedLink();
   470         const CESMRRichTextLink* currentLink = iRichTextViewer->GetSelectedLink();
       
   471         // remember the state if Saving all is not in progress
       
   472         if( currentLink && !iAttachmentCommandHandler->IsSaveAllAttachmentsInProgress() ) 
       
   473         	{
       
   474             iSelectedLink = currentLink;
       
   475         	}      
       
   476         else
       
   477             {
       
   478             currentLink = iSelectedLink;// restore link when selection is lost
       
   479         	}
   470 
   480 
   471         ASSERT( currentLink );
   481         ASSERT( currentLink );
   472 
   482 
   473         TBool remoteCommand(
   483         TBool remoteCommand(
   474                 iAttachmentCommandHandler->IsRemoteAttachmentL( *currentLink) );
   484                 iAttachmentCommandHandler->IsRemoteAttachmentL( *currentLink) );
   756 //
   766 //
   757 void CMRViewerAttachmentsField::HandleLongtapEventL( const TPoint& aPosition )
   767 void CMRViewerAttachmentsField::HandleLongtapEventL( const TPoint& aPosition )
   758     {
   768     {
   759     FUNC_LOG;
   769     FUNC_LOG;
   760 
   770 
   761     if ( iRichTextViewer->Rect().Contains( aPosition ) )
   771     // prevent link selection if SaveAllAttachments is in progress
       
   772     TBool saveAllInProgress ( EFalse );
       
   773     if( iAttachmentCommandHandler ) 
       
   774     	{
       
   775         saveAllInProgress = iAttachmentCommandHandler->IsSaveAllAttachmentsInProgress( );
       
   776     	}
       
   777     
       
   778     if ( !saveAllInProgress && iRichTextViewer->Rect().Contains( aPosition ) )
   762         {
   779         {
   763         iRichTextViewer->LinkSelectedL();
   780         iRichTextViewer->LinkSelectedL();
   764         }
   781         }
   765     }
   782     }
   766 
   783 
   776     TBool ret( EFalse );
   793     TBool ret( EFalse );
   777 
   794 
   778     if( iAttachmentCount > 0 &&
   795     if( iAttachmentCount > 0 &&
   779         aPointerEvent.iType == TPointerEvent::EButton1Up )
   796         aPointerEvent.iType == TPointerEvent::EButton1Up )
   780         {
   797         {
   781         if( iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) )
   798 
       
   799         // prevent handling events if SaveAllAttachments is in progress
       
   800         TBool saveAllInProgress ( EFalse );
       
   801         if( iAttachmentCommandHandler ) 
       
   802     	    {
       
   803             saveAllInProgress = iAttachmentCommandHandler->IsSaveAllAttachmentsInProgress( );
       
   804     	    }
       
   805            
       
   806         if(  !saveAllInProgress && iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) )
   782             {
   807             {
   783             iRichTextViewer->HandlePointerEventL( aPointerEvent );
   808             iRichTextViewer->HandlePointerEventL( aPointerEvent );
   784             ret = ETrue;
   809             ret = ETrue;
   785             }
   810             }
   786         }
   811         }