taskswitcher/contextengine/tsfswpreviewprovider/wsplugin/src/previewprovidercrp.cpp
branchRCL_3
changeset 19 79311d856354
parent 11 ff572dfe6d86
equal deleted inserted replaced
18:d05a55b217df 19:79311d856354
    51 // --------------------------------------------------------------------------
    51 // --------------------------------------------------------------------------
    52 // CPreviewProviderCRP::ConstructL
    52 // CPreviewProviderCRP::ConstructL
    53 // --------------------------------------------------------------------------
    53 // --------------------------------------------------------------------------
    54 //    
    54 //    
    55 void CPreviewProviderCRP::ConstructL()
    55 void CPreviewProviderCRP::ConstructL()
    56     { 
    56     {
       
    57     iLastWgIdRedraw = ETrue;
    57     }
    58     }
    58 
    59 
    59 // --------------------------------------------------------------------------
    60 // --------------------------------------------------------------------------
    60 // CPreviewProviderCRP::~CPreviewProviderCRP
    61 // CPreviewProviderCRP::~CPreviewProviderCRP
    61 // --------------------------------------------------------------------------
    62 // --------------------------------------------------------------------------
   145     TSLOG_CONTEXT( ConstructL, TSLOG_LOCAL );
   146     TSLOG_CONTEXT( ConstructL, TSLOG_LOCAL );
   146     TSLOG_IN();
   147     TSLOG_IN();
   147     
   148     
   148     BaseConstructL( aEnv, aId, aOwner );
   149     BaseConstructL( aEnv, aId, aOwner );
   149     aEnv.RegisterEventHandler( this, this, TWservCrEvent::EWindowGroupChanged |
   150     aEnv.RegisterEventHandler( this, this, TWservCrEvent::EWindowGroupChanged |
   150                                            TWservCrEvent::EDeviceOrientationChanged );
   151                                            TWservCrEvent::EDeviceOrientationChanged |
       
   152                                            TWservCrEvent::EScreenDrawing );
   151     iScreenChangedTime = 0;
   153     iScreenChangedTime = 0;
   152     
   154     
   153     TSLOG_OUT();
   155     TSLOG_OUT();
   154     }
   156     }
   155     
   157     
   172             currTime.HomeTime();
   174             currTime.HomeTime();
   173             TTimeIntervalSeconds secondsFrom;
   175             TTimeIntervalSeconds secondsFrom;
   174             TInt err = currTime.SecondsFrom( iScreenChangedTime, secondsFrom );
   176             TInt err = currTime.SecondsFrom( iScreenChangedTime, secondsFrom );
   175             if ( err != KErrNone || secondsFrom.Int() > KMinTimeForOrientationSwitch )
   177             if ( err != KErrNone || secondsFrom.Int() > KMinTimeForOrientationSwitch )
   176                 {
   178                 {
   177                 TRAP_IGNORE( ScreenshotL() );
   179                 if ( iLastWgIdRedraw )
       
   180                     {
       
   181                     TRAP_IGNORE( ScreenshotL() );
       
   182                     }
   178                 }
   183                 }
   179             else
   184             else
   180                 {
   185                 {
   181                 // Reset time to allow screenshot taking on next wg change
   186                 // Reset time to allow screenshot taking on next wg change
   182                 iScreenChangedTime = 0;
   187                 iScreenChangedTime = 0;
   184                 BitmapRotationNeeded( iPrevId?iPrevId:iPrevReg, iClockwiseRot );
   189                 BitmapRotationNeeded( iPrevId?iPrevId:iPrevReg, iClockwiseRot );
   185                 }
   190                 }
   186             iPrevReg = 0;
   191             iPrevReg = 0;
   187             }
   192             }
   188         iPrevId = wgId;
   193         iPrevId = wgId;
       
   194         iLastWgIdRedraw = EFalse;
   189         }
   195         }
   190     else if ( aEvent.Type() == TWservCrEvent::EDeviceOrientationChanged )
   196     else if ( aEvent.Type() == TWservCrEvent::EDeviceOrientationChanged )
   191         {
   197         {
   192         iScreenChangedTime.HomeTime();
   198         iScreenChangedTime.HomeTime();
   193         TRAP_IGNORE( ScreenshotL() );
   199         if ( iLastWgIdRedraw )
       
   200             {
       
   201             TRAP_IGNORE( ScreenshotL() );
       
   202             }
       
   203         }
       
   204     else if ( aEvent.Type() == TWservCrEvent::EScreenDrawing )
       
   205         {
       
   206         iLastWgIdRedraw = ETrue;
   194         }
   207         }
   195     
   208     
   196     TSLOG_OUT();
   209     TSLOG_OUT();
   197     }
   210     }
   198     
   211