356 // CESMRViewerAttendeesField::MinimumSize() |
356 // CESMRViewerAttendeesField::MinimumSize() |
357 // --------------------------------------------------------------------------- |
357 // --------------------------------------------------------------------------- |
358 // |
358 // |
359 TSize CESMRViewerAttendeesField::MinimumSize() |
359 TSize CESMRViewerAttendeesField::MinimumSize() |
360 { |
360 { |
361 // Parent rect will be list area later --> no need to calculate it manually. |
361 // Minimum size -> Height: TitleRow + Editor size + Margin |
362 TRect parentRect = Parent()->Rect(); |
362 // Width: Parent's Width |
363 TRect contentRect = NMRLayoutManager::GetLayoutRect( |
363 // (so the content pane that holds all the fields) |
364 parentRect, NMRLayoutManager::EMRLayoutListArea ).Rect(); |
364 TRect rect( Rect() ); |
365 // We have two lines; title and richtextviewer. |
365 TAknLayoutRect row1LayoutRect = |
366 TRect fieldRect = |
366 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); |
367 NMRLayoutManager::GetFieldLayoutRect( contentRect, 2 ).Rect(); |
367 TInt titleHeight = row1LayoutRect.Rect().Height(); |
368 // Get row size for second row (richtext viewer). |
368 |
369 TRect rowRect = |
369 // Add title field height |
370 NMRLayoutManager::GetFieldRowLayoutRect( fieldRect, 2 ).Rect(); |
370 TInt totalHeight = titleHeight; |
371 // Get size for default 1 line editor. |
371 |
372 TRect viewerRect = NMRLayoutManager::GetLayoutText( |
372 TAknLayoutRect row2LayoutRect = |
373 rowRect, |
373 NMRLayoutManager::GetFieldRowLayoutRect( rect, 2 ); |
374 NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ).TextRect(); |
374 TInt editorRowHeight = row2LayoutRect.Rect().Height(); |
375 // Adjust field size so that there's room for expandable editor. |
375 |
376 fieldRect.Resize( 0, iExpandedSize.iHeight - viewerRect.Height() ); |
376 TAknTextComponentLayout editorLayout = |
377 return fieldRect.Size(); |
377 NMRLayoutManager::GetTextComponentLayout( |
|
378 NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); |
|
379 |
|
380 // Editor height from Layout data |
|
381 TInt editorHeight = editorLayout.H(); |
|
382 // Margin is the outer row's height - editor's layout height |
|
383 TInt margin = editorRowHeight - editorHeight; |
|
384 // Parent has the width |
|
385 TInt width( Parent()->Size().iWidth ); |
|
386 // Count the total height of the attendee field. |
|
387 // iExpandedSize is used because the Editor size might be something else |
|
388 // than what is stated in Layout data. |
|
389 totalHeight += iExpandedSize.iHeight + margin; |
|
390 return TSize( width, totalHeight ); |
378 } |
391 } |
379 |
392 |
380 // --------------------------------------------------------------------------- |
393 // --------------------------------------------------------------------------- |
381 // CESMRViewerAttendeesField::ExecuteGenericCommandL() |
394 // CESMRViewerAttendeesField::ExecuteGenericCommandL() |
382 // --------------------------------------------------------------------------- |
395 // --------------------------------------------------------------------------- |