141 // --------------------------------------------------------------------------- |
141 // --------------------------------------------------------------------------- |
142 // |
142 // |
143 TSize CESMRViewerDetailedSubjectField::MinimumSize() |
143 TSize CESMRViewerDetailedSubjectField::MinimumSize() |
144 { |
144 { |
145 TRect parentRect( Parent()->Rect() ); |
145 TRect parentRect( Parent()->Rect() ); |
146 |
146 |
147 TRect fieldRect = |
147 TRect fieldRect = |
148 NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); |
148 NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); |
149 |
149 |
150 TRect viewerRect( NMRLayoutManager::GetLayoutText( |
150 TRect viewerRect( NMRLayoutManager::GetLayoutText( |
151 fieldRect, |
151 fieldRect, |
152 NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); |
152 NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); |
153 |
153 |
154 // Adjust field size so that there's room for expandable editor. |
154 // Adjust field size so that there's room for expandable editor. |
155 fieldRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); |
155 fieldRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); |
156 |
156 |
157 return fieldRect.Size(); |
157 return fieldRect.Size(); |
158 } |
158 } |
159 |
159 |
160 |
160 |
161 // --------------------------------------------------------------------------- |
161 // --------------------------------------------------------------------------- |
191 FUNC_LOG; |
191 FUNC_LOG; |
192 MESMRCalEntry::TESMRCalEntryType entryType( |
192 MESMRCalEntry::TESMRCalEntryType entryType( |
193 aEntry.Type() ); |
193 aEntry.Type() ); |
194 |
194 |
195 CCalEntry& entry = aEntry.Entry(); |
195 CCalEntry& entry = aEntry.Entry(); |
196 |
196 |
197 if( !IsLocked() ) |
197 if( !IsLocked() ) |
198 { |
198 { |
199 if( entry.PriorityL() == EFSCalenMRPriorityHigh ) |
199 if( entry.PriorityL() == EFSCalenMRPriorityHigh ) |
200 { |
200 { |
201 iPriorityIcon = CMRImage::NewL( |
201 iPriorityIcon = CMRImage::NewL( |
202 NMRBitmapManager::EMRBitmapPriorityHigh, ETrue ); |
202 NMRBitmapManager::EMRBitmapPriorityHigh, ETrue ); |
203 iPriorityIcon->SetParent( this ); |
203 iPriorityIcon->SetParent( this ); |
204 } |
204 } |
205 if( entry.PriorityL() == EFSCalenMRPriorityLow ) |
205 if( entry.PriorityL() == EFSCalenMRPriorityLow ) |
206 { |
206 { |
207 iPriorityIcon = CMRImage::NewL( |
207 iPriorityIcon = CMRImage::NewL( |
208 NMRBitmapManager::EMRBitmapPriorityLow, ETrue ); |
208 NMRBitmapManager::EMRBitmapPriorityLow, ETrue ); |
209 iPriorityIcon->SetParent( this ); |
209 iPriorityIcon->SetParent( this ); |
210 } |
210 } |
211 } |
211 } |
212 |
212 |
213 |
213 |
214 if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == entryType ) |
214 if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == entryType ) |
215 { |
215 { |
216 MESMRMeetingRequestEntry* mrEntry = |
216 MESMRMeetingRequestEntry* mrEntry = |
217 static_cast<MESMRMeetingRequestEntry*>(&aEntry); |
217 static_cast<MESMRMeetingRequestEntry*>(&aEntry); |
218 |
218 |
288 // --------------------------------------------------------------------------- |
288 // --------------------------------------------------------------------------- |
289 // CESMRViewerDetailedSubjectField::HandleEdwinSizeEventL() |
289 // CESMRViewerDetailedSubjectField::HandleEdwinSizeEventL() |
290 // --------------------------------------------------------------------------- |
290 // --------------------------------------------------------------------------- |
291 // |
291 // |
292 TBool CESMRViewerDetailedSubjectField::HandleEdwinSizeEventL( |
292 TBool CESMRViewerDetailedSubjectField::HandleEdwinSizeEventL( |
293 CEikEdwin* aEdwin, |
293 CEikEdwin* aEdwin, |
294 TEdwinSizeEvent /*aType*/, |
294 TEdwinSizeEvent /*aType*/, |
295 TSize aSize ) |
295 TSize aSize ) |
296 { |
296 { |
297 FUNC_LOG; |
297 FUNC_LOG; |
298 TBool reDraw( EFalse ); |
298 TBool reDraw( EFalse ); |
299 |
299 |
300 // Let's save the required size for the iRichTextViewer |
300 // Let's save the required size for the iRichTextViewer |
301 iSize = aSize; |
301 iSize = aSize; |
302 |
302 |
303 if ( iObserver && aEdwin == iRichTextViewer ) |
303 if ( iObserver && aEdwin == iRichTextViewer ) |
304 { |
304 { |
305 iObserver->ControlSizeChanged( this ); |
305 iObserver->ControlSizeChanged( this ); |
306 reDraw = ETrue; |
306 reDraw = ETrue; |
307 } |
307 } |
308 |
308 |
309 return reDraw; |
309 return reDraw; |
310 } |
310 } |
311 |
311 |
312 // --------------------------------------------------------------------------- |
312 // --------------------------------------------------------------------------- |
313 // CESMRViewerDetailedSubjectField::ListObserverSet |
313 // CESMRViewerDetailedSubjectField::ListObserverSet |
443 RestoreMiddleSoftKeyL(); |
443 RestoreMiddleSoftKeyL(); |
444 } |
444 } |
445 } |
445 } |
446 } |
446 } |
447 |
447 |
448 |
448 |
449 // --------------------------------------------------------------------------- |
449 // --------------------------------------------------------------------------- |
450 // CESMRViewerDetailedSubjectField::HandleRichTextLinkSelection |
450 // CESMRViewerDetailedSubjectField::HandleRichTextLinkSelection |
451 // --------------------------------------------------------------------------- |
451 // --------------------------------------------------------------------------- |
452 // |
452 // |
453 TBool CESMRViewerDetailedSubjectField::HandleRichTextLinkSelection( |
453 TBool CESMRViewerDetailedSubjectField::HandleRichTextLinkSelection( |
454 const CESMRRichTextLink* /*aLink*/ ) |
454 const CESMRRichTextLink* /*aLink*/ ) |
455 { |
455 { |
456 TBool result = EFalse; |
456 TBool result = EFalse; |
457 |
457 |
458 // No implementation yet: waiting for UI spec. |
458 // No implementation yet: waiting for UI spec. |
459 |
459 |
460 return result; |
460 return result; |
461 } |
461 } |
462 |
462 |
463 // --------------------------------------------------------------------------- |
463 // --------------------------------------------------------------------------- |
464 // CESMRViewerDetailedSubjectField::CountComponentControls |
464 // CESMRViewerDetailedSubjectField::CountComponentControls |
514 { |
514 { |
515 // Store iRichTextViewer original width. |
515 // Store iRichTextViewer original width. |
516 TInt richTextViewerWidth = iRichTextViewer->Size().iWidth; |
516 TInt richTextViewerWidth = iRichTextViewer->Size().iWidth; |
517 TRect rect( Rect() ); |
517 TRect rect( Rect() ); |
518 |
518 |
519 TAknLayoutRect rowLayoutRect( |
519 TAknLayoutRect rowLayoutRect( |
520 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); |
520 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); |
521 TRect rowRect( rowLayoutRect.Rect() ); |
521 TRect rowRect( rowLayoutRect.Rect() ); |
522 |
522 |
523 // Layouting field icon |
523 // Layouting field icon |
524 if( iFieldIcon ) |
524 if( iFieldIcon ) |
525 { |
525 { |
526 TAknWindowComponentLayout iconLayout( |
526 TAknWindowComponentLayout iconLayout( |
527 NMRLayoutManager::GetWindowComponentLayout( |
527 NMRLayoutManager::GetWindowComponentLayout( |
528 NMRLayoutManager::EMRLayoutSingleRowAColumnGraphic ) ); |
528 NMRLayoutManager::EMRLayoutSingleRowAColumnGraphic ) ); |
529 AknLayoutUtils::LayoutControl( iFieldIcon, rowRect, iconLayout ); |
529 AknLayoutUtils::LayoutControl( iFieldIcon, rowRect, iconLayout ); |
530 } |
530 } |
531 |
531 |
532 // Layouting priority icon |
532 // Layouting priority icon |
533 if( iPriorityIcon ) |
533 if( iPriorityIcon ) |
534 { |
534 { |
535 TAknWindowComponentLayout iconLayout( |
535 TAknWindowComponentLayout iconLayout( |
536 NMRLayoutManager::GetWindowComponentLayout( |
536 NMRLayoutManager::GetWindowComponentLayout( |
537 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
537 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
538 AknLayoutUtils::LayoutImage( iPriorityIcon, rowRect, iconLayout ); |
538 AknLayoutUtils::LayoutImage( iPriorityIcon, rowRect, iconLayout ); |
539 } |
539 } |
540 |
540 |
541 TAknLayoutText viewerLayoutText; |
541 TAknLayoutText viewerLayoutText; |
542 |
542 |
543 if( iPriorityIcon ) |
543 if( iPriorityIcon ) |
544 { |
544 { |
545 viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, |
545 viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, |
546 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
546 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
547 } |
547 } |
548 else |
548 else |
549 { |
549 { |
550 viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, |
550 viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, |
551 NMRLayoutManager::EMRTextLayoutTextEditor ); |
551 NMRLayoutManager::EMRTextLayoutTextEditor ); |
552 } |
552 } |
553 |
553 |
554 // Layouting viewer field |
554 // Layouting viewer field |
555 TRect viewerRect( viewerLayoutText.TextRect() ); |
555 TRect viewerRect( viewerLayoutText.TextRect() ); |
556 |
556 |
557 // Resize height according to actual height required by edwin. |
557 // Resize height according to actual height required by edwin. |
558 viewerRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); |
558 viewerRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); |
559 iRichTextViewer->SetRect( viewerRect ); |
559 iRichTextViewer->SetRect( viewerRect ); |
560 |
560 |
561 // Layouting focus |
561 // Layouting focus |
562 TRect bgRect( viewerRect ); |
562 TRect bgRect( viewerRect ); |
563 |
563 |
564 // Move focus rect so that it's relative to field's position. |
564 // Move focus rect so that it's relative to field's position. |
565 bgRect.Move( -Position() ); |
565 bgRect.Move( -Position() ); |
566 SetFocusRect( bgRect ); |
566 SetFocusRect( bgRect ); |
567 |
567 |
568 // Failures are ignored. |
568 // Failures are ignored. |
569 TRAP_IGNORE( |
569 TRAP_IGNORE( |
570 // Try setting font |
570 // Try setting font |
571 iRichTextViewer->SetFontL( viewerLayoutText.Font() ); |
571 iRichTextViewer->SetFontL( viewerLayoutText.Font() ); |
572 // Try applying changes |
572 // Try applying changes |
573 iRichTextViewer->ApplyLayoutChangesL(); |
573 iRichTextViewer->ApplyLayoutChangesL(); |
574 ); |
574 ); |
575 |
575 |
576 if ( iRichTextViewer->Size().iWidth != richTextViewerWidth ) |
576 if ( iRichTextViewer->Size().iWidth != richTextViewerWidth ) |
577 { |
577 { |
578 // Most of this case is screen orientation, in this case we need to |
578 // Most of this case is screen orientation, in this case we need to |
579 // Record the index of focusing link, after updating link array, then |
579 // Record the index of focusing link, after updating link array, then |
580 // reset the focusing to original one. |
580 // reset the focusing to original one. |
581 TInt focusingIndex = iRichTextViewer->GetFocusLink(); |
581 TInt focusingIndex = iRichTextViewer->GetFocusLink(); |
582 if ( KErrNotFound != focusingIndex ) |
582 if ( KErrNotFound != focusingIndex ) |
583 { |
583 { |
584 iRichTextViewer->SetFocusLink( focusingIndex ); |
584 iRichTextViewer->SetFocusLink( focusingIndex ); |
590 |
590 |
591 // --------------------------------------------------------------------------- |
591 // --------------------------------------------------------------------------- |
592 // CESMRViewerDetailedSubjectField::SetContainerWindowL |
592 // CESMRViewerDetailedSubjectField::SetContainerWindowL |
593 // --------------------------------------------------------------------------- |
593 // --------------------------------------------------------------------------- |
594 // |
594 // |
595 void CESMRViewerDetailedSubjectField::SetContainerWindowL( |
595 void CESMRViewerDetailedSubjectField::SetContainerWindowL( |
596 const CCoeControl& aContainer ) |
596 const CCoeControl& aContainer ) |
597 { |
597 { |
598 CCoeControl::SetContainerWindowL( aContainer ); |
598 CCoeControl::SetContainerWindowL( aContainer ); |
599 iRichTextViewer->SetContainerWindowL( aContainer ); |
599 iRichTextViewer->SetContainerWindowL( aContainer ); |
600 iRichTextViewer->SetParent( this ); |
600 iRichTextViewer->SetParent( this ); |
601 } |
601 } |
602 |
602 |
|
603 // --------------------------------------------------------------------------- |
|
604 // CESMRViewerDetailedSubjectField::SupportsLongTapFunctionalityL |
|
605 // --------------------------------------------------------------------------- |
|
606 // |
|
607 TBool CESMRViewerDetailedSubjectField::SupportsLongTapFunctionalityL( |
|
608 const TPointerEvent &aPointerEvent ) |
|
609 { |
|
610 FUNC_LOG; |
|
611 TBool ret( EFalse ); |
|
612 |
|
613 if ( iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) ) |
|
614 { |
|
615 if( iRichTextViewer->PointerEventOccuresOnALinkL( aPointerEvent ) ) |
|
616 { |
|
617 ret = ETrue; |
|
618 } |
|
619 } |
|
620 |
|
621 return ret; |
|
622 } |
|
623 |
603 //EOF |
624 //EOF |