uifw/AvKon/src/AknPreviewPopUp.cpp
branchRCL_3
changeset 10 9f56a4e1b8ab
parent 0 2f259fa3e83a
child 15 08e69e956a8c
equal deleted inserted replaced
9:aabf2c525e0f 10:9f56a4e1b8ab
    65                                     CAknPreviewPopUpController& aController,
    65                                     CAknPreviewPopUpController& aController,
    66                                     const TInt aStyle )
    66                                     const TInt aStyle )
    67     : iContent( aContent ),
    67     : iContent( aContent ),
    68       iController( aController ),
    68       iController( aController ),
    69       iFlags( aStyle ),
    69       iFlags( aStyle ),
    70       iAllowUpEvent(EFalse)
    70       iAllowUpEvent(EFalse),
       
    71       iIsDeleted(0)
    71     {
    72     {
    72     GfxTransEffect::Register( this, KGfxPreviewPopupControlUid );
    73     GfxTransEffect::Register( this, KGfxPreviewPopupControlUid );
    73     }
    74     }
    74 
    75 
    75 // -----------------------------------------------------------------------------
    76 // -----------------------------------------------------------------------------
    77 // -----------------------------------------------------------------------------
    78 // -----------------------------------------------------------------------------
    78 //
    79 //
    79 CAknPreviewPopUp::~CAknPreviewPopUp()
    80 CAknPreviewPopUp::~CAknPreviewPopUp()
    80     {
    81     {
    81     AKNTASHOOK_REMOVE();
    82     AKNTASHOOK_REMOVE();
       
    83     
       
    84     if( iIsDeleted )
       
    85         {
       
    86     	*iIsDeleted = ETrue ;
       
    87         iIsDeleted = 0 ;
       
    88         }
    82 
    89 
    83     GfxTransEffect::Deregister( this );
    90     GfxTransEffect::Deregister( this );
    84 
    91 
    85     if ( CapturesPointer() )
    92     if ( CapturesPointer() )
    86         {
    93         {
   507 // CAknPreviewPopUp::HandlePointerEventL
   514 // CAknPreviewPopUp::HandlePointerEventL
   508 // -----------------------------------------------------------------------------
   515 // -----------------------------------------------------------------------------
   509 //
   516 //
   510 void CAknPreviewPopUp::HandlePointerEventL( const TPointerEvent& aPointerEvent )
   517 void CAknPreviewPopUp::HandlePointerEventL( const TPointerEvent& aPointerEvent )
   511     {
   518     {
       
   519 	TBool isDelete = EFalse; 
       
   520 	iIsDeleted = &isDelete;
       
   521 	
   512     if ( AknLayoutUtils::PenEnabled() )
   522     if ( AknLayoutUtils::PenEnabled() )
   513         {
   523         {
   514         iCloseMenu = EFalse;
   524         iCloseMenu = EFalse;
   515         if ( aPointerEvent.iType == TPointerEvent::EButton1Up && !IsVisible() )
   525         if ( aPointerEvent.iType == TPointerEvent::EButton1Up && !IsVisible() )
   516             {
   526             {
   520         // redirect pointer event to content
   530         // redirect pointer event to content
   521         if ( Rect().Contains( aPointerEvent.iPosition ) && IsVisible() )
   531         if ( Rect().Contains( aPointerEvent.iPosition ) && IsVisible() )
   522             {
   532             {
   523             iAllowUpEvent = ETrue;
   533             iAllowUpEvent = ETrue;
   524             CCoeControl::HandlePointerEventL( aPointerEvent );
   534             CCoeControl::HandlePointerEventL( aPointerEvent );
       
   535             if( isDelete )
       
   536             	{
       
   537             	return;
       
   538             	}
   525             if ( !( iFlags & CAknPreviewPopUpController::EPermanentMode ) && aPointerEvent.iType == TPointerEvent::EButton1Up && IsVisible() )
   539             if ( !( iFlags & CAknPreviewPopUpController::EPermanentMode ) && aPointerEvent.iType == TPointerEvent::EButton1Up && IsVisible() )
   526                 {
   540                 {
   527             	  // if pointer up is already redirected to the content, but the popup is still visible,
   541             	  // if pointer up is already redirected to the content, but the popup is still visible,
   528             	  // then the original timeout has already happened and we need to reset the timer.
   542             	  // then the original timeout has already happened and we need to reset the timer.
   529             	  // TSW Error EJZG-7JR3PC.
   543             	  // TSW Error EJZG-7JR3PC.
   591                 if ( aPointerEvent.iType == TPointerEvent::EDrag || 
   605                 if ( aPointerEvent.iType == TPointerEvent::EDrag || 
   592                     aPointerEvent.iType == TPointerEvent::EButtonRepeat ||
   606                     aPointerEvent.iType == TPointerEvent::EButtonRepeat ||
   593                     (aPointerEvent.iType == TPointerEvent::EButton1Up && iAllowUpEvent ) )
   607                     (aPointerEvent.iType == TPointerEvent::EButton1Up && iAllowUpEvent ) )
   594                     {
   608                     {
   595                     CCoeControl::HandlePointerEventL( aPointerEvent );
   609                     CCoeControl::HandlePointerEventL( aPointerEvent );
       
   610                     if( isDelete )
       
   611                     	{
       
   612                     	return;
       
   613                     	}
   596                     }
   614                     }
   597                 }
   615                 }
   598             else
   616             else
   599                 {
   617                 {
   600                 if ( aPointerEvent.iType == TPointerEvent::EDrag || 
   618                 if ( aPointerEvent.iType == TPointerEvent::EDrag || 
   601                     aPointerEvent.iType == TPointerEvent::EButtonRepeat )
   619                     aPointerEvent.iType == TPointerEvent::EButtonRepeat )
   602                     {
   620                     {
   603                     CCoeControl::HandlePointerEventL( aPointerEvent );
   621                     CCoeControl::HandlePointerEventL( aPointerEvent );
       
   622                     if( isDelete )
       
   623                     	{
       
   624                     	return;
       
   625                     	}
   604                     }
   626                     }
   605                 }
   627                 }
   606                 
   628                 
   607             }
   629             }
   608         if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
   630         if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
   609             {
   631             {
   610             iAllowUpEvent = EFalse;
   632             iAllowUpEvent = EFalse;
   611             }
   633             }
   612         }
   634         }
       
   635     
       
   636     iIsDeleted = 0;
   613     }
   637     }
   614     
   638     
   615 // -----------------------------------------------------------------------------
   639 // -----------------------------------------------------------------------------
   616 // CAknPreviewPopUp::OfferKeyEventL
   640 // CAknPreviewPopUp::OfferKeyEventL
   617 // -----------------------------------------------------------------------------
   641 // -----------------------------------------------------------------------------