meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrlocationfield.cpp
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 16 b5fbb9b25d57
child 22 d620048b4810
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14  *  Description : ESMR location field implementation
    14  *  Description : ESMR location field implementation
    15  *  Version     : %version: e002sa32#53.1.1 %
    15  *  Version     : %version: e002sa32#53.1.2 %
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 
    19 
    20 #include "cesmrlocationfield.h"
    20 #include "cesmrlocationfield.h"
   348     {
   348     {
   349     FUNC_LOG;
   349     FUNC_LOG;
   350     if ( aEdwin == iLocation && aEventType == EEventTextUpdate )
   350     if ( aEdwin == iLocation && aEventType == EEventTextUpdate )
   351         {
   351         {
   352         TInt textLength( iLocation->TextLength() );
   352         TInt textLength( iLocation->TextLength() );
   353         
   353 
   354         if ( iLocation->GetLimitLength() <= textLength )
   354         if ( iLocation->GetLimitLength() <= textLength )
   355             {
   355             {
   356             NotifyEventAsyncL( EESMRCmdSizeExceeded );
   356             NotifyEventAsyncL( EESMRCmdSizeExceeded );
   357             }
   357             }
   358         else if ( iWaypointIcon && textLength == 0 )
   358         else if ( iWaypointIcon && textLength == 0 )
   498         }
   498         }
   499 
   499 
   500     // Layout field title
   500     // Layout field title
   501     if( iTitle )
   501     if( iTitle )
   502         {
   502         {
   503         TAknLayoutText labelLayout(
   503         TAknTextComponentLayout editorLayout =
   504                 NMRLayoutManager::GetLayoutText(
   504                 NMRLayoutManager::GetTextComponentLayout(
   505                         firstRowRect,
   505                         NMRLayoutManager::EMRTextLayoutTextEditor );
   506                             NMRLayoutManager::EMRTextLayoutTextEditor ) );
   506 
   507 
   507         AknLayoutUtils::LayoutLabel( iTitle, firstRowRect, editorLayout );
   508         iTitle->SetRect( labelLayout.TextRect() );
       
   509 
       
   510         // Setting font also for the label. Failures are ignored.
       
   511         iTitle->SetFont( labelLayout.Font() );
       
   512         }
   508         }
   513 
   509 
   514     TRect editorRect( 0, 0, 0, 0 );
   510     TRect editorRect( 0, 0, 0, 0 );
   515 
   511 
   516     // Layout field editor
   512     // Layout field editor
   774                 TInt pos( 0 );
   770                 TInt pos( 0 );
   775                 CEikMenuPaneItem* item =
   771                 CEikMenuPaneItem* item =
   776                         aMenuPane->ItemAndPos( EESMRCmdAddLocation, pos );
   772                         aMenuPane->ItemAndPos( EESMRCmdAddLocation, pos );
   777 
   773 
   778                 item->iData.iCascadeId = 0;
   774                 item->iData.iCascadeId = 0;
   779                 
   775 
   780                 if ( FeaturesL().FeatureSupported(
   776                 if ( FeaturesL().FeatureSupported(
   781                         CESMRFeatureSettings::EESMRUIMnFwIntegration ) )
   777                         CESMRFeatureSettings::EESMRUIMnFwIntegration ) )
   782                     {
   778                     {
   783                     item->iData.iCommandId = EESMRCmdAssignFromMap;
   779                     item->iData.iCommandId = EESMRCmdAssignFromMap;
   784                     StringLoader::Load(item->iData.iText, 
   780                     StringLoader::Load(item->iData.iText,
   785                             R_MEET_REQ_OPTIONS_ASSIGN_FROM_MAP, iCoeEnv );
   781                             R_MEET_REQ_OPTIONS_ASSIGN_FROM_MAP, iCoeEnv );
   786                     }
   782                     }
   787                 
   783 
   788 #ifdef RD_USE_MYLOCATIONUI
   784 #ifdef RD_USE_MYLOCATIONUI
   789                 else
   785                 else
   790                     {
   786                     {
   791                     item->iData.iCommandId = EMRCommandMyLocations;
   787                     item->iData.iCommandId = EMRCommandMyLocations;
   792                     StringLoader::Load( item->iData.iText,
   788                     StringLoader::Load( item->iData.iText,
   793                             R_MEET_REQ_OPTIONS_MY_LOCATIONS, iCoeEnv );
   789                             R_MEET_REQ_OPTIONS_MY_LOCATIONS, iCoeEnv );
   794                     }
   790                     }
   795 #endif //RD_USE_MYLOCATIONUI
   791 #endif //RD_USE_MYLOCATIONUI
   796                 
   792 
   797                 aMenuPane->SetItemDimmed( item->iData.iCommandId, EFalse );
   793                 aMenuPane->SetItemDimmed( item->iData.iCommandId, EFalse );
   798                 break;
   794                 break;
   799                 }
   795                 }
   800             default:
   796             default:
   801                 {
   797                 {