mobilemessaging/mmsui/viewersrc/UniMmsViewerAppUi.cpp
branchRCL_3
changeset 28 fbb813aef148
parent 18 a9c7e5670d17
child 33 94cccd85bd25
equal deleted inserted replaced
24:e00582ce7ecd 28:fbb813aef148
   168 #include <uniobjectsinfo.h>
   168 #include <uniobjectsinfo.h>
   169 
   169 
   170 #include <mmsclient.h>              // CMmsClientMtm, mmsconst.h
   170 #include <mmsclient.h>              // CMmsClientMtm, mmsconst.h
   171 #include <mmsgenutils.h>
   171 #include <mmsgenutils.h>
   172 #include <mmsmsventry.h>
   172 #include <mmsmsventry.h>
       
   173 #include <mmsversion.h>
   173 
   174 
   174 #include "MmsViewer.hrh"            // application specific commands & enums
   175 #include "MmsViewer.hrh"            // application specific commands & enums
   175 #include "UniMmsViewerDocument.h"      // CMmsViewerDocument
   176 #include "UniMmsViewerDocument.h"      // CMmsViewerDocument
   176 #include "UniMmsViewerAppUi.h"         // CMmsViewerAppUi
   177 #include "UniMmsViewerAppUi.h"         // CMmsViewerAppUi
   177 #include "MmsViewerHeader.h"
   178 #include "MmsViewerHeader.h"
  1158                 //Exit is the last item... leave it there.
  1159                 //Exit is the last item... leave it there.
  1159                 aMenuPane->DeleteBetweenMenuItems( 0, amountOfItems - 2 );
  1160                 aMenuPane->DeleteBetweenMenuItems( 0, amountOfItems - 2 );
  1160                 return;
  1161                 return;
  1161                 }
  1162                 }
  1162                     
  1163                     
  1163             TInt focusedControl = FocusedControlId( ); 
  1164             TInt focusedControl = FocusedControlId( );
       
  1165                       
       
  1166             TBool senderHighlighted = EFalse;
       
  1167             if ( focusedControl == EMsgComponentIdFrom )
       
  1168                 {
       
  1169                 CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
       
  1170                     iView->ControlById( EMsgComponentIdFrom ) );
       
  1171                 
       
  1172                 if ( address && address->Editor().SelectionLength() )
       
  1173                     {
       
  1174                     senderHighlighted = ETrue;
       
  1175                     }
       
  1176                 }
       
  1177             
  1164             if ( !IsOwnMessage( ) )
  1178             if ( !IsOwnMessage( ) )
  1165                 {    
  1179                 {    
  1166                 if( (FocusedControlId( ) == EMsgComponentIdFrom) && ( ( iMtm->Sender( ) ).Length() ) )
  1180                 if( ( FocusedControlId( ) == EMsgComponentIdFrom) && ( ( iMtm->Sender( ) ).Length() ) 
       
  1181                       && senderHighlighted )
  1167                     {
  1182                     {
  1168                     iFindItemMenu->SetSenderHighlightStatus( ETrue );
  1183                     iFindItemMenu->SetSenderHighlightStatus( ETrue );
  1169                     iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) );                
  1184                     iFindItemMenu->SetSenderDisplayText( TMmsGenUtils::PureAddress( iMtm->Sender( ) ) );                
  1170                     }
  1185                     }
  1171 	            else
  1186 	            else
  1172 	     	        {
  1187 	     	        {
  1173                     iFindItemMenu->SetSenderHighlightStatus( EFalse );
  1188                     iFindItemMenu->SetSenderHighlightStatus( EFalse );
  1174 		            }
  1189 		            }
  1175                 }
  1190                 }
  1176  			iFindItemMenu->AddItemFindMenuL( 
  1191             
  1177                 ( focusedControl == EMsgComponentIdBody ) ? iView->ItemFinder( ) : 0,
  1192             iFindItemMenu->AddItemFindMenuL( 
       
  1193                 ( iView->ItemFinder()->CurrentSelection().Length() ) 
       
  1194                 ? iView->ItemFinder( ) : 0,
  1178                 aMenuPane, 
  1195                 aMenuPane, 
  1179                 EFindItemMenuPlaceHolder,
  1196                 EFindItemMenuPlaceHolder,
  1180                 TMmsGenUtils::PureAddress( iMtm->Sender( ) ),
  1197                 senderHighlighted ? 
       
  1198                 TMmsGenUtils::PureAddress( iMtm->Sender( ) ) : KNullDesC(),
  1181                 iHeader->Alias( ) && !iHeader->IsRemoteAlias( ) ? ETrue : EFalse, //"Is sender known"
  1199                 iHeader->Alias( ) && !iHeader->IsRemoteAlias( ) ? ETrue : EFalse, //"Is sender known"
  1182                 EFalse );
  1200                 EFalse );
  1183                 
  1201                 
  1184             const TMsvEntry& context = Document( )->Entry( );
  1202             const TMsvEntry& context = Document( )->Entry( );
  1185             // local variation for MMS Delivery Status dialog feature
  1203             // local variation for MMS Delivery Status dialog feature
  1604                 }
  1622                 }
  1605             }
  1623             }
  1606             break;
  1624             break;
  1607         case EKeyDevice3:       //Selection key
  1625         case EKeyDevice3:       //Selection key
  1608         case EKeyEnter:         //Enter Key
  1626         case EKeyEnter:         //Enter Key
  1609             {           
  1627             {                    
       
  1628             if( iView->FocusedControl()->ControlType() == EMsgAddressControl )
       
  1629                 {
       
  1630                 CMsgAddressControl* address = static_cast<CMsgAddressControl*>(
       
  1631                     iView->FocusedControl() );
       
  1632                 if ( address && !address->Editor().SelectionLength() )
       
  1633                     {
       
  1634                     // restore highlight to address field
       
  1635                     return address->Editor().OfferKeyEventL( aKeyEvent, aType );
       
  1636                     }               
       
  1637                 }
       
  1638             else if ( iView->FocusedControl()->ControlType() == EMsgBodyControl )
       
  1639                 {       
       
  1640                 CItemFinder* itemFinder = iView->ItemFinder();
       
  1641                 if ( FocusedControlId() == EMsgComponentIdBody 
       
  1642                      && itemFinder )
       
  1643                     {                                                                          
       
  1644                     if ( !itemFinder->CurrentSelection().Length() )
       
  1645                         {
       
  1646                         CMsgBodyControl* body = static_cast<CMsgBodyControl*>(
       
  1647                             iView->FocusedControl() );
       
  1648                         if ( body )
       
  1649                             {                     
       
  1650                              // restore highlight to current itemfinder item
       
  1651                             return body->Editor().OfferKeyEventL( aKeyEvent, aType );
       
  1652                             }
       
  1653                         }
       
  1654                     }
       
  1655                 }
       
  1656             // fall through
       
  1657             } 
       
  1658         case EMsgFindItemKeyEvent:
       
  1659             {
  1610             TInt focusedControl = FocusedControlId( );
  1660             TInt focusedControl = FocusedControlId( );
  1611             CMsgMediaControl* control = MediaControlById(focusedControl);
  1661             CMsgMediaControl* control = MediaControlById(focusedControl);
  1612             if (control)
  1662             if (control)
  1613                 {
  1663                 {
  1614                 if ( MediaCanStop( control ) )
  1664                 if ( MediaCanStop( control ) )
  1983             aResourceId = R_MMSVIEWER_CANNOT_FW_BIG;
  2033             aResourceId = R_MMSVIEWER_CANNOT_FW_BIG;
  1984             return EFalse;
  2034             return EFalse;
  1985             }
  2035             }
  1986         }
  2036         }
  1987     TBool objectsOk = CanForwardObjectsL( aResourceId );
  2037     TBool objectsOk = CanForwardObjectsL( aResourceId );
       
  2038 	TInt conformanceSize = KClassMaxSizeVideoRich;
       
  2039 	if(iMmsConformance->ConformanceVersion() > KMmsVersion12)
       
  2040 	{
       
  2041 		conformanceSize = KClassMaxSizeMegapixel;
       
  2042 	}
       
  2043 		
  1988     if ( objectsOk && Document( )->CreationMode( ) == EMmsCreationModeWarning )
  2044     if ( objectsOk && Document( )->CreationMode( ) == EMmsCreationModeWarning )
  1989         {
  2045         {
  1990         if ( Document( )->SmilType( ) != EMmsSmil ||
  2046         if ( Document( )->SmilType( ) != EMmsSmil ||
  1991              iViewerFlags & ESuspiciousSmil )
  2047              iViewerFlags & ESuspiciousSmil )
  1992             {
  2048             {
  1993             aResourceId = 0;
  2049             aResourceId = 0;
  1994             return ShowGuidedModeConfirmationQueryL( R_MMSVIEWER_QUEST_GUIDED_PRESENTATION );
  2050             return ShowGuidedModeConfirmationQueryL( R_MMSVIEWER_QUEST_GUIDED_PRESENTATION );
  1995             }
  2051             }
  1996         else if ( msgSize > KClassMaxSizeVideoRich )
  2052         else if ( msgSize > conformanceSize )
  1997             {
  2053             {
  1998             aResourceId = 0;
  2054             aResourceId = 0;
  1999             return ShowGuidedModeConfirmationQueryL( R_MMSVIEWER_QUEST_GUIDED_INC_OBJ );
  2055             return ShowGuidedModeConfirmationQueryL( R_MMSVIEWER_QUEST_GUIDED_INC_OBJ );
  2000             }
  2056             }
  2001         }
  2057         }