meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriorityfield.cpp
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 16 b5fbb9b25d57
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
    56 CESMRPriorityField::~CESMRPriorityField()
    56 CESMRPriorityField::~CESMRPriorityField()
    57     {
    57     {
    58     FUNC_LOG;
    58     FUNC_LOG;
    59     iArray.ResetAndDestroy();
    59     iArray.ResetAndDestroy();
    60     iArray.Close();
    60     iArray.Close();
    61     
    61 
    62     delete iIcon;    
    62     delete iIcon;
    63     }
    63     }
    64 
    64 
    65 // ---------------------------------------------------------------------------
    65 // ---------------------------------------------------------------------------
    66 // CESMRPriorityField::NewL
    66 // CESMRPriorityField::NewL
    67 // ---------------------------------------------------------------------------
    67 // ---------------------------------------------------------------------------
    80 // CESMRPriorityField::ConstructL
    80 // CESMRPriorityField::ConstructL
    81 // ---------------------------------------------------------------------------
    81 // ---------------------------------------------------------------------------
    82 //
    82 //
    83 void CESMRPriorityField::ConstructL()
    83 void CESMRPriorityField::ConstructL()
    84     {
    84     {
    85     FUNC_LOG;    
    85     FUNC_LOG;
    86     iLabel = CMRLabel::NewL();
    86     iLabel = CMRLabel::NewL();
    87     iLabel->SetParent( this );
    87     iLabel->SetParent( this );
    88     CESMRField::ConstructL( iLabel ); // ownership transfered
    88     CESMRField::ConstructL( iLabel ); // ownership transfered
    89 
    89 
    90     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal );
    90     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal );
    96 // ---------------------------------------------------------------------------
    96 // ---------------------------------------------------------------------------
    97 //
    97 //
    98 void CESMRPriorityField::InitializeL()
    98 void CESMRPriorityField::InitializeL()
    99     {
    99     {
   100     FUNC_LOG;
   100     FUNC_LOG;
   101     NMRColorManager::SetColor( *iLabel, 
   101     NMRColorManager::SetColor( *iLabel,
   102                                NMRColorManager::EMRMainAreaTextColor );
   102                                NMRColorManager::EMRMainAreaTextColor );
   103     }
   103     }
   104 
   104 
   105 // ---------------------------------------------------------------------------
   105 // ---------------------------------------------------------------------------
   106 // CESMRPriorityField::InternalizeL
   106 // CESMRPriorityField::InternalizeL
   142             iIndex = i;
   142             iIndex = i;
   143             UpdateTextL ( iIndex );
   143             UpdateTextL ( iIndex );
   144             }
   144             }
   145         }
   145         }
   146     // reader
   146     // reader
   147     CleanupStack::PopAndDestroy(); // codescanner::cleanup 
   147     CleanupStack::PopAndDestroy(); // codescanner::cleanup
   148     }
   148     }
   149 
   149 
   150 // ---------------------------------------------------------------------------
   150 // ---------------------------------------------------------------------------
   151 // CESMRPriorityField::ExternalizeL
   151 // CESMRPriorityField::ExternalizeL
   152 // ---------------------------------------------------------------------------
   152 // ---------------------------------------------------------------------------
   170 // ---------------------------------------------------------------------------
   170 // ---------------------------------------------------------------------------
   171 //
   171 //
   172 void CESMRPriorityField::SetOutlineFocusL( TBool aFocus )
   172 void CESMRPriorityField::SetOutlineFocusL( TBool aFocus )
   173     {
   173     {
   174     FUNC_LOG;
   174     FUNC_LOG;
   175     CESMRField::SetOutlineFocusL ( aFocus );    
   175     CESMRField::SetOutlineFocusL ( aFocus );
   176     iLabel->SetFocus( aFocus );
   176     iLabel->SetFocus( aFocus );
   177 
   177 
   178     //Focus gained
   178     //Focus gained
   179     if ( aFocus )
   179     if ( aFocus )
   180         {
   180         {
   191     FUNC_LOG;
   191     FUNC_LOG;
   192     TRect rect = Rect();
   192     TRect rect = Rect();
   193     TAknLayoutRect rowLayoutRect =
   193     TAknLayoutRect rowLayoutRect =
   194         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
   194         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
   195     rect = rowLayoutRect.Rect();
   195     rect = rowLayoutRect.Rect();
   196     
   196 
   197     TAknWindowComponentLayout iconLayout =
   197     TAknWindowComponentLayout iconLayout =
   198         NMRLayoutManager::GetWindowComponentLayout( 
   198         NMRLayoutManager::GetWindowComponentLayout(
   199                 NMRLayoutManager::EMRLayoutTextEditorIcon );
   199                 NMRLayoutManager::EMRLayoutTextEditorIcon );
   200     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   200     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   201     
   201 
   202     TAknLayoutRect bgLayoutRect =
   202     TAknLayoutRect bgLayoutRect =
   203         NMRLayoutManager::GetLayoutRect( 
   203         NMRLayoutManager::GetLayoutRect(
   204                 rect, NMRLayoutManager::EMRLayoutTextEditorBg );
   204                 rect, NMRLayoutManager::EMRLayoutTextEditorBg );
   205     TRect bgRect( bgLayoutRect.Rect() );
   205     TRect bgRect( bgLayoutRect.Rect() );
   206     // Move focus rect so that it's relative to field's position.
   206     // Move focus rect so that it's relative to field's position.
   207     bgRect.Move( -Position() );
   207     bgRect.Move( -Position() );
   208     SetFocusRect( bgRect );
   208     SetFocusRect( bgRect );
   209     
   209 
   210     TAknLayoutText labelLayout = 
   210     TAknTextComponentLayout editorLayout =
   211         NMRLayoutManager::GetLayoutText( 
   211             NMRLayoutManager::GetTextComponentLayout(
   212                 rect, NMRLayoutManager::EMRTextLayoutTextEditor );
   212                     NMRLayoutManager::EMRTextLayoutTextEditor );
   213     iLabel->SetRect( labelLayout.TextRect() );
   213 
       
   214     AknLayoutUtils::LayoutLabel( iLabel, rect, editorLayout );
   214     }
   215     }
   215 
   216 
   216 // ---------------------------------------------------------------------------
   217 // ---------------------------------------------------------------------------
   217 // CESMRPriorityField::CountComponentControls()
   218 // CESMRPriorityField::CountComponentControls()
   218 // ---------------------------------------------------------------------------
   219 // ---------------------------------------------------------------------------
   263     TBool isUsed( EFalse );
   264     TBool isUsed( EFalse );
   264     if( aCommand == EESMRCmdOpenPriorityQuery ||
   265     if( aCommand == EESMRCmdOpenPriorityQuery ||
   265         aCommand == EAknCmdOpen )
   266         aCommand == EAknCmdOpen )
   266         {
   267         {
   267     	HandleTactileFeedbackL();
   268     	HandleTactileFeedbackL();
   268     	
   269 
   269         ExecutePriorityQueryL();
   270         ExecutePriorityQueryL();
   270         isUsed = ETrue;
   271         isUsed = ETrue;
   271         }
   272         }
   272     return isUsed;
   273     return isUsed;
   273     }
   274     }
   379     {
   380     {
   380     FUNC_LOG;
   381     FUNC_LOG;
   381     CESMRPriority* priority = iArray[ aIndex ];
   382     CESMRPriority* priority = iArray[ aIndex ];
   382     iLabel->SetTextL ( priority->Text ( ) );
   383     iLabel->SetTextL ( priority->Text ( ) );
   383 
   384 
   384     NMRBitmapManager::TMRBitmapId bitmapId( 
   385     NMRBitmapManager::TMRBitmapId bitmapId(
   385             NMRBitmapManager::EMRBitmapPriorityNormal );
   386             NMRBitmapManager::EMRBitmapPriorityNormal );
   386 
   387 
   387     switch ( priority->Id() )
   388     switch ( priority->Id() )
   388         {
   389         {
   389         case EFSCalenMRPriorityLow:
   390         case EFSCalenMRPriorityLow:
   406             }
   407             }
   407         default:
   408         default:
   408         	ASSERT(EFalse);
   409         	ASSERT(EFalse);
   409         	break;
   410         	break;
   410         }
   411         }
   411     
   412 
   412     delete iIcon;
   413     delete iIcon;
   413     iIcon = NULL;
   414     iIcon = NULL;
   414     iIcon = CMRImage::NewL( bitmapId );
   415     iIcon = CMRImage::NewL( bitmapId );
   415     iIcon->SetParent( this );
   416     iIcon->SetParent( this );
   416 
   417