294 |
294 |
295 TGulAlignment align; |
295 TGulAlignment align; |
296 align.SetHAlignment( EHLeft ); |
296 align.SetHAlignment( EHLeft ); |
297 align.SetVAlignment( EVCenter ); |
297 align.SetVAlignment( EVCenter ); |
298 iType->SetAlignment( align ); |
298 iType->SetAlignment( align ); |
299 |
299 |
300 // An icon is required for layouting the field. Actual correct icon |
300 // An icon is required for layouting the field. Actual correct icon |
301 // is set after InternalizeL. |
301 // is set after InternalizeL. |
302 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapEventTypeMeeting ); |
302 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapEventTypeMeeting ); |
303 } |
303 } |
304 |
304 |
305 // --------------------------------------------------------------------------- |
305 // --------------------------------------------------------------------------- |
384 iIcon->SetRect( iconLayout.Rect() ); |
384 iIcon->SetRect( iconLayout.Rect() ); |
385 |
385 |
386 // Layouting lock icon |
386 // Layouting lock icon |
387 if( iLockIcon ) |
387 if( iLockIcon ) |
388 { |
388 { |
389 TAknWindowComponentLayout iconLayout( |
389 TAknWindowComponentLayout iconLayout( |
390 NMRLayoutManager::GetWindowComponentLayout( |
390 NMRLayoutManager::GetWindowComponentLayout( |
391 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
391 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
392 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
392 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
393 } |
393 } |
394 |
394 |
395 // Layouting label |
395 // Layouting label |
396 TAknLayoutText viewerLayoutText; |
396 TAknTextComponentLayout viewerLayoutText; |
397 if( iLockIcon ) |
397 if( iLockIcon ) |
398 { |
398 { |
399 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
399 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
400 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
400 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
401 } |
401 } |
402 else |
402 else |
403 { |
403 { |
404 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
404 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
405 NMRLayoutManager::EMRTextLayoutTextEditor ); |
405 NMRLayoutManager::EMRTextLayoutTextEditor ); |
406 } |
406 } |
407 |
407 |
408 TRect viewerRect( viewerLayoutText.TextRect() ); |
408 AknLayoutUtils::LayoutLabel( iType, rect, viewerLayoutText ); |
409 iType->SetRect( viewerRect ); |
409 TRect viewerRect( iType->Rect() ); |
410 |
410 |
411 // Move focus rect so that it's relative to field's position. |
411 // Move focus rect so that it's relative to field's position. |
412 viewerRect.Move( -Position() ); |
412 viewerRect.Move( -Position() ); |
413 |
413 |
414 TAknLayoutRect bgLayoutRect = |
414 TAknLayoutRect bgLayoutRect = |
415 NMRLayoutManager::GetLayoutRect( |
415 NMRLayoutManager::GetLayoutRect( |
416 rect, NMRLayoutManager::EMRLayoutTextEditorBg ); |
416 rect, NMRLayoutManager::EMRLayoutTextEditorBg ); |
417 TRect bgRect( bgLayoutRect.Rect() ); |
417 TRect bgRect( bgLayoutRect.Rect() ); |
418 |
418 |
419 // Adjust background rect according to viewerRect |
419 // Adjust background rect according to viewerRect |
420 bgRect.SetWidth( viewerRect.Width() ); |
420 bgRect.SetWidth( viewerRect.Width() ); |
421 |
421 |
422 // Move focus rect so that it's relative to field's position. |
422 // Move focus rect so that it's relative to field's position. |
423 bgRect.Move( -Position() ); |
423 bgRect.Move( -Position() ); |
424 |
424 |
425 SetFocusRect( bgRect ); |
425 SetFocusRect( bgRect ); |
426 |
426 |
427 |
427 |
428 TAknTextComponentLayout editorLayout( |
428 TAknTextComponentLayout editorLayout( |
429 NMRLayoutManager::GetTextComponentLayout( |
429 NMRLayoutManager::GetTextComponentLayout( |
430 NMRLayoutManager::EMRTextLayoutTextEditor ) ); |
430 NMRLayoutManager::EMRTextLayoutTextEditor ) ); |
431 AknLayoutUtils::LayoutLabel( iType, rect, editorLayout ); |
431 AknLayoutUtils::LayoutLabel( iType, rect, editorLayout ); |
432 } |
432 } |
436 // --------------------------------------------------------------------------- |
436 // --------------------------------------------------------------------------- |
437 // |
437 // |
438 void CMRUnifiedEditorField::SetIconL( MESMRCalEntry& aEntry ) |
438 void CMRUnifiedEditorField::SetIconL( MESMRCalEntry& aEntry ) |
439 { |
439 { |
440 FUNC_LOG; |
440 FUNC_LOG; |
441 NMRBitmapManager::TMRBitmapId bitmapId( |
441 NMRBitmapManager::TMRBitmapId bitmapId( |
442 NMRBitmapManager::EMRBitmapNotSet ); |
442 NMRBitmapManager::EMRBitmapNotSet ); |
443 |
443 |
444 CCalEntry& entry = aEntry.Entry(); |
444 CCalEntry& entry = aEntry.Entry(); |
445 |
445 |
446 switch ( entry.EntryTypeL() ) |
446 switch ( entry.EntryTypeL() ) |
447 { |
447 { |
448 case CCalEntry::EAppt: |
448 case CCalEntry::EAppt: |
449 { |
449 { |
450 if( CCalenInterimUtils2::IsMeetingRequestL( entry ) ) |
450 if( CCalenInterimUtils2::IsMeetingRequestL( entry ) ) |