videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp
branchRCL_3
changeset 16 7f2b2a65da29
parent 14 8970fbd719ec
child 23 8f0df5c82986
equal deleted inserted replaced
14:8970fbd719ec 16:7f2b2a65da29
    13 *
    13 *
    14 * Description:  Implementation of CMPXVideoPlaybackControl
    14 * Description:  Implementation of CMPXVideoPlaybackControl
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: e003sa33#20 %
    18 // Version : %version: 21 %
    19 
    19 
    20 
    20 
    21 // INCLUDE FILES
    21 // INCLUDE FILES
    22 #include <avkon.hrh>
    22 #include <avkon.hrh>
    23 #include <e32std.h>
    23 #include <e32std.h>
   200 // CMPXVideoPlaybackControl::HandlePointerEventL()
   200 // CMPXVideoPlaybackControl::HandlePointerEventL()
   201 // -------------------------------------------------------------------------------------------------
   201 // -------------------------------------------------------------------------------------------------
   202 //
   202 //
   203 void CMPXVideoPlaybackControl::HandlePointerEventL( const TPointerEvent& aPointerEvent )
   203 void CMPXVideoPlaybackControl::HandlePointerEventL( const TPointerEvent& aPointerEvent )
   204 {
   204 {
   205     MPX_DEBUG(_L("CMPXVideoPlaybackControl::HandlePointerEventL()"));
   205     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControl::HandlePointerEventL()"),
       
   206                    _L("iControlIndex = %d"), iControlIndex );
   206 
   207 
   207     iController->iContainer->UserInputHandler()->ProcessPointerEventL( this,
   208     iController->iContainer->UserInputHandler()->ProcessPointerEventL( this,
   208                                                                        aPointerEvent,
   209                                                                        aPointerEvent,
   209                                                                        EMpxVideoPlaybackControl );
   210                                                                        EMpxVideoPlaybackControl );
   210 }
   211 }
   213 // CMPXVideoPlaybackControl::DoHandlePointerEventL()
   214 // CMPXVideoPlaybackControl::DoHandlePointerEventL()
   214 // -------------------------------------------------------------------------------------------------
   215 // -------------------------------------------------------------------------------------------------
   215 //
   216 //
   216 EXPORT_C void CMPXVideoPlaybackControl::DoHandlePointerEventL( const TPointerEvent& aPointerEvent)
   217 EXPORT_C void CMPXVideoPlaybackControl::DoHandlePointerEventL( const TPointerEvent& aPointerEvent)
   217 {
   218 {
   218     MPX_DEBUG(_L("CMPXVideoPlaybackControl::DoHandlePointerEventL()"));
   219     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControl::DoHandlePointerEventL()"),
       
   220                    _L(" iControlIndex = %d, aPointerEvent.iType = %d"),
       
   221                    iControlIndex, aPointerEvent.iType );
   219 
   222 
   220     if ( AknLayoutUtils::PenEnabled() )
   223     if ( AknLayoutUtils::PenEnabled() )
   221     {
   224     {
       
   225         if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   226         {
       
   227             iController->ResetDisappearingTimers( EMPXTimerCancel );
       
   228 
       
   229             //
       
   230             //  Grab the pointer event for all controls so the events will not transfer to a
       
   231             //  different control as a dragging event occurs
       
   232             //
       
   233             SetPointerCapture( ETrue );
       
   234             ClaimPointerGrab( ETrue );
       
   235         }
       
   236         else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
       
   237         {
       
   238             iController->ResetDisappearingTimers( EMPXTimerReset );
       
   239 
       
   240             SetPointerCapture( EFalse );
       
   241             ClaimPointerGrab( EFalse );
       
   242         }
       
   243 
   222         switch( iControlIndex )
   244         switch( iControlIndex )
   223         {
   245         {
   224             case EMPXProgressBar:
   246             case EMPXProgressBar:
   225             case EMPXVolumeBar:
   247             case EMPXVolumeBar:
   226             case EMPXButtonBar:
   248             case EMPXButtonBar:
   227             case EMPXAspectRatioIcon:
   249             case EMPXAspectRatioIcon:
   228             case EMPXMediaDetailsViewer:
   250             case EMPXMediaDetailsViewer:
   229             {
   251             {
   230                 if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   231                 {
       
   232                     iController->ResetDisappearingTimers( EMPXTimerCancel );
       
   233 
       
   234                     iControl->SetPointerCapture( ETrue );
       
   235                     iControl->ClaimPointerGrab( ETrue );
       
   236                 }
       
   237                 else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
       
   238                 {
       
   239                     iController->ResetDisappearingTimers( EMPXTimerReset );
       
   240 
       
   241                     iControl->SetPointerCapture( EFalse );
       
   242                     iControl->ClaimPointerGrab( EFalse );
       
   243                 }
       
   244 
       
   245                 //
   252                 //
   246                 // Pass an event to controller
   253                 // Pass an event to controller
   247                 //
   254                 //
   248                 iControl->HandlePointerEventL( aPointerEvent );
   255                 iControl->HandlePointerEventL( aPointerEvent );
   249                 break;
   256                 break;
   560 //
   567 //
   561 void CMPXVideoPlaybackControl::ResetControl()
   568 void CMPXVideoPlaybackControl::ResetControl()
   562 {
   569 {
   563     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ResetControl()"));
   570     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::ResetControl()"));
   564 
   571 
   565     iControl->SetPointerCapture( EFalse );
   572     SetPointerCapture( EFalse );
   566     iControl->ClaimPointerGrab( EFalse );
   573     ClaimPointerGrab( EFalse );
   567     
   574 
   568     switch( iControlIndex )
   575     switch( iControlIndex )
   569     {
   576     {
   570         case EMPXButtonBar:
   577         case EMPXButtonBar:
   571         {
   578         {
   572             static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->Reset();
   579             static_cast<CMPXVideoPlaybackButtonBar*>(iControl)->Reset();
   580         case EMPXVolumeBar:
   587         case EMPXVolumeBar:
   581         {
   588         {
   582              static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->Reset();
   589              static_cast<CMPXVideoPlaybackVolumeBar*>(iControl)->Reset();
   583              break;
   590              break;
   584         }
   591         }
   585         case EMPXAspectRatioIcon:
       
   586         default:
       
   587             break;
       
   588     }
   592     }
   589 }
   593 }
   590 
   594 
   591 // End of File
   595 // End of File