meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp
branchRCL_3
changeset 14 b13141f05c3d
parent 12 4ce476e64c59
child 16 b5fbb9b25d57
equal deleted inserted replaced
13:8592a65ad3fb 14:b13141f05c3d
    29 
    29 
    30 //<cmail>
    30 //<cmail>
    31 #include "cesmrurlparserplugin.h"
    31 #include "cesmrurlparserplugin.h"
    32 //</cmail>
    32 //</cmail>
    33 #include <calentry.h>
    33 #include <calentry.h>
    34 #include <aknutils.h>
    34 #include <AknUtils.h>
    35 #include <stringloader.h>
    35 #include <StringLoader.h>
    36 #include <esmrgui.rsg>
    36 #include <esmrgui.rsg>
    37 #include <avkon.rsg>
    37 #include <avkon.rsg>
    38 #include <txtrich.h>
    38 #include <txtrich.h>
    39 
    39 
    40 #include "emailtrace.h"
    40 #include "emailtrace.h"
   183 // CESMRViewerDescriptionField::SizeChanged()
   183 // CESMRViewerDescriptionField::SizeChanged()
   184 // ---------------------------------------------------------------------------
   184 // ---------------------------------------------------------------------------
   185 //
   185 //
   186 void CESMRViewerDescriptionField::SizeChanged()
   186 void CESMRViewerDescriptionField::SizeChanged()
   187     {
   187     {
       
   188     // Store iRichTextViewer original width.
       
   189     TInt richTextViewerWidth = iRichTextViewer->Size().iWidth;
   188     TRect rect( Rect() );
   190     TRect rect( Rect() );
   189     rect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ).Rect();
   191     rect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ).Rect();
   190 
   192 
   191     TRect viewerRect =
   193     TRect viewerRect =
   192         NMRLayoutManager::GetLayoutText(
   194         NMRLayoutManager::GetLayoutText(
   209             iRichTextViewer->SetFontL( text.Font() );
   211             iRichTextViewer->SetFontL( text.Font() );
   210             // Try applying changes
   212             // Try applying changes
   211             iRichTextViewer->ApplyLayoutChangesL();
   213             iRichTextViewer->ApplyLayoutChangesL();
   212             );
   214             );
   213 
   215 
   214     iRichTextViewer->SetRect(
   216     if ( iRichTextViewer->Size().iWidth != richTextViewerWidth )
   215             TRect( viewerRect.iTl,
   217         {
   216                     TSize( viewerRect.Width(), iSize.iHeight ) ) );
   218         // Most of this case is screen orientation, in this case we need to 
   217 
   219         // Record the index of focusing link, after updating link array, then 
   218     bgRect.SetHeight( iRichTextViewer->Rect().Height() );
   220         // reset the focusing to original one.
   219     SetFocusRect( bgRect );
   221         TInt focusingIndex = iRichTextViewer->GetFocusLink();
       
   222         if ( KErrNotFound != focusingIndex )
       
   223             {
       
   224             iRichTextViewer->SetFocusLink( focusingIndex );
       
   225             //wake up current contact menu selection by calling this
       
   226             iRichTextViewer->FocusChanged(ENoDrawNow);
       
   227             }
       
   228         } 
   220     }
   229     }
   221 
   230 
   222 // ---------------------------------------------------------------------------
   231 // ---------------------------------------------------------------------------
   223 // CESMRViewerDescriptionField::CountComponentControls()
   232 // CESMRViewerDescriptionField::CountComponentControls()
   224 // ---------------------------------------------------------------------------
   233 // ---------------------------------------------------------------------------