mobilemessaging/mmsui/viewersrc/UniMmsViewerAppUi.cpp
branchRCL_3
changeset 18 a9c7e5670d17
parent 17 caea42e26caa
child 28 fbb813aef148
equal deleted inserted replaced
17:caea42e26caa 18:a9c7e5670d17
  1193                 {
  1193                 {
  1194                 aMenuPane->SetItemDimmed( EMmsViewerForward, ETrue );
  1194                 aMenuPane->SetItemDimmed( EMmsViewerForward, ETrue );
  1195                 }
  1195                 }
  1196                                 
  1196                                 
  1197    
  1197    
  1198             if ( ! (    Document( )->SmilType( ) == EMmsSmil 
       
  1199                    &&   (  focusedControl == EMsgComponentIdBody 
       
  1200                         || focusedControl == EMsgComponentIdImage 
       
  1201                         || focusedControl == EMsgComponentIdAudio 
       
  1202 #ifdef RD_SVGT_IN_MESSAGING              
       
  1203                         ||  focusedControl == EMsgComponentIdSvg
       
  1204 #endif
       
  1205                         || focusedControl == EMsgComponentIdVideo ) ) )
       
  1206                 {
       
  1207                 aMenuPane->SetItemDimmed( EMmsViewerSaveObject, ETrue );
       
  1208                 }
       
  1209                 
  1198                 
  1210             if (    ! ( iSupportedFeatures & EMmsFeatureUpload )
  1199             if (    ! ( iSupportedFeatures & EMmsFeatureUpload )
  1211                 ||  !iUploadServices.Count( ) )
  1200                 ||  !iUploadServices.Count( ) )
  1212                 {
  1201                 {
  1213                 aMenuPane->SetItemDimmed( EMmsViewerUpload, ETrue );
  1202                 aMenuPane->SetItemDimmed( EMmsViewerUpload, ETrue );
  2822 #ifdef RD_SCALABLE_UI_V2
  2811 #ifdef RD_SCALABLE_UI_V2
  2823             if ( AknLayoutUtils::PenEnabled() )
  2812             if ( AknLayoutUtils::PenEnabled() )
  2824                 {
  2813                 {
  2825                 TPointerEvent* pointerEvent = static_cast<TPointerEvent*>( aArg2 );
  2814                 TPointerEvent* pointerEvent = static_cast<TPointerEvent*>( aArg2 );
  2826                 CMsgBaseControl* baseControl = static_cast<CMsgBaseControl*>( aArg1 );
  2815                 CMsgBaseControl* baseControl = static_cast<CMsgBaseControl*>( aArg1 );
       
  2816                 TWsEvent* wsEvent = static_cast<TWsEvent*>(aArg2);
  2827                 
  2817                 
  2828                 if (    pointerEvent
  2818                 if (    pointerEvent
  2829                     &&  pointerEvent->iType == TPointerEvent::EButton1Down )
  2819                     &&  pointerEvent->iType == TPointerEvent::EButton1Down )
  2830                     {
  2820                     {
  2831                     // We are looking for a valid tap (button down and up)
  2821                     // We are looking for a valid tap (button down and up)
  2847                         }
  2837                         }
  2848                     iTapConsumed = EFalse;
  2838                     iTapConsumed = EFalse;
  2849                     }
  2839                     }
  2850                 else if ( (!iTapConsumed) && (pointerEvent
  2840                 else if ( (!iTapConsumed) && (pointerEvent
  2851                         &&  pointerEvent->iType == TPointerEvent::EButton1Up) )
  2841                         &&  pointerEvent->iType == TPointerEvent::EButton1Up) )
  2852                     {
  2842                     {   
  2853                     iLongTapDetector->CancelAnimationL();
  2843                     iLongTapDetector->MonitorWsMessage(*wsEvent);
  2854                     iTapConsumed = ETrue;
  2844                     iTapConsumed = ETrue;
       
  2845                     CMsgBaseControl* focusedControl = iView->FocusedControl();
  2855                     if ( baseControl && iPointerTarget == baseControl )
  2846                     if ( baseControl && iPointerTarget == baseControl )
  2856                         {
  2847                         {
  2857                         switch( iMskId )
  2848                         switch( iMskId )
  2858                             {
  2849                             {
  2859                             // Tapping on selected object functions as a
  2850                             // Tapping on selected object functions as a
  2868                             case R_MMSVIEWER_MSK_BUTTON_OPEN_OBJECTS:
  2859                             case R_MMSVIEWER_MSK_BUTTON_OPEN_OBJECTS:
  2869 #ifdef RD_SVGT_IN_MESSAGING                 	
  2860 #ifdef RD_SVGT_IN_MESSAGING                 	
  2870                             case R_MMSVIEWER_MSK_BUTTON_PLAY_SVG:
  2861                             case R_MMSVIEWER_MSK_BUTTON_PLAY_SVG:
  2871 #endif                
  2862 #endif                
  2872                                 {
  2863                                 {
  2873                                 // Read current MSK resource to get a command id
  2864                                 HandleSelectionKeyL();
  2874                                 // to execute.
       
  2875                                 TResourceReader reader;
       
  2876                                 iEikonEnv->CreateResourceReaderLC(
       
  2877                                     reader, iMskId );
       
  2878                                 reader.ReadInt8(); // version
       
  2879                                 HandleCommandL( reader.ReadUint16() );
       
  2880                                 CleanupStack::PopAndDestroy(); // resource buffer
       
  2881                                 *static_cast<TBool*>( aArg3 ) = ETrue;  // handled
  2865                                 *static_cast<TBool*>( aArg3 ) = ETrue;  // handled
  2882                                 }
  2866                                 }
  2883                             default:
  2867                             default:
  2884                                 ;
  2868                                 ;
  2885                             }
  2869                             }
  2886                         }
  2870                         }
       
  2871                     else if ( focusedControl && iPointerTarget == focusedControl )
       
  2872                         {
       
  2873                             if ( iMskId == R_MMSVIEWER_MSK_BUTTON_PLAY_VIDEO ||
       
  2874                                  iMskId == R_MMSVIEWER_MSK_BUTTON_STOP_VIDEO )
       
  2875                                 {
       
  2876                                 HandleSelectionKeyL();
       
  2877                                 *static_cast<TBool*>( aArg3 ) = ETrue;  // handled
       
  2878                                 }
       
  2879                         }
       
  2880 
  2887                     iPointerTarget = NULL;
  2881                     iPointerTarget = NULL;
  2888                     }
  2882                     }
  2889                 }
  2883                 }
  2890 #endif // RD_SCALABLE_UI_V2
  2884 #endif // RD_SCALABLE_UI_V2
  2891             break;
  2885             break;
  5525             iEmbeddedObjectStylusPopup->SetPosition(aPenEventLocation);
  5519             iEmbeddedObjectStylusPopup->SetPosition(aPenEventLocation);
  5526             iEmbeddedObjectStylusPopup->ShowMenu();
  5520             iEmbeddedObjectStylusPopup->ShowMenu();
  5527             iTapConsumed = ETrue;
  5521             iTapConsumed = ETrue;
  5528             }
  5522             }
  5529         }   
  5523         }   
  5530     }  
  5524     } 
       
  5525 // ---------------------------------------------------------
       
  5526 // CMmsViewerAppUi::HandleSelectionKeyL
       
  5527 //  Function for handling the selection key
       
  5528 // ---------------------------------------------------------
       
  5529 void CMmsViewerAppUi::HandleSelectionKeyL()
       
  5530     {
       
  5531     // Read current MSK resource to get a command id
       
  5532     // to execute.
       
  5533     TResourceReader reader;
       
  5534     iEikonEnv->CreateResourceReaderLC(
       
  5535         reader, iMskId );
       
  5536     reader.ReadInt8(); // version
       
  5537     HandleCommandL( reader.ReadUint16() );
       
  5538     CleanupStack::PopAndDestroy(); // resource buffer
       
  5539     }
  5531 //  End of File
  5540 //  End of File
  5532 
  5541