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