meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerfromfield.cpp
branchRCL_3
changeset 16 b5fbb9b25d57
parent 12 4ce476e64c59
child 22 d620048b4810
equal deleted inserted replaced
14:b13141f05c3d 16:b5fbb9b25d57
    23 #include "nmrlayoutmanager.h"
    23 #include "nmrlayoutmanager.h"
    24 #include "cmrlabel.h"
    24 #include "cmrlabel.h"
    25 
    25 
    26 #include <calentry.h>
    26 #include <calentry.h>
    27 #include <caluser.h>
    27 #include <caluser.h>
    28 #include <stringloader.h>
    28 #include <StringLoader.h>
    29 #include <eikenv.h>
    29 #include <eikenv.h>
    30 #include <avkon.hrh>
    30 #include <avkon.hrh>
    31 #include <aknutils.h>
    31 #include <AknUtils.h>
    32 #include <esmrgui.rsg>
    32 #include <esmrgui.rsg>
    33 
    33 
    34 // DEBUG
    34 // DEBUG
    35 #include "emailtrace.h"
    35 #include "emailtrace.h"
    36 
    36 
    71     TAknLayoutText editorRect =
    71     TAknLayoutText editorRect =
    72     NMRLayoutManager::GetLayoutText(
    72     NMRLayoutManager::GetLayoutText(
    73             Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
    73             Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
    74     iRichTextViewer->SetFontL( editorRect.Font() );
    74     iRichTextViewer->SetFontL( editorRect.Font() );
    75     iRichTextViewer->ApplyLayoutChangesL();
    75     iRichTextViewer->ApplyLayoutChangesL();
    76     
    76 
    77     const CFont* topicFont =
    77     const CFont* topicFont =
    78         AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont, NULL );
    78         AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont, NULL );
    79     iFieldTopic->SetFont( topicFont );
    79     iFieldTopic->SetFont( topicFont );
    80     iRichTextViewer->SetEventQueue( iEventQueue );
    80     iRichTextViewer->SetEventQueue( iEventQueue );
    81     }
    81     }
   155     // viewer's real size iExpandedSize and editorRect's width.
   155     // viewer's real size iExpandedSize and editorRect's width.
   156     TPoint tlPoint(
   156     TPoint tlPoint(
   157             editorRect.TextRect().iTl.iX, editorRect.TextRect().iTl.iY );
   157             editorRect.TextRect().iTl.iX, editorRect.TextRect().iTl.iY );
   158     TSize prefSize( editorRect.TextRect().Width(), iExpandedSize.iHeight );
   158     TSize prefSize( editorRect.TextRect().Width(), iExpandedSize.iHeight );
   159     TRect viewerRect( tlPoint, prefSize );
   159     TRect viewerRect( tlPoint, prefSize );
   160     // Failures are ignored. 
   160     // Failures are ignored.
   161     TRAP_IGNORE( 
   161     TRAP_IGNORE(
   162             // Try setting font 
   162             // Try setting font
   163             iRichTextViewer->SetFontL( editorRect.Font() );
   163             iRichTextViewer->SetFontL( editorRect.Font() );
   164             // Try applying changes
   164             // Try applying changes
   165             iRichTextViewer->ApplyLayoutChangesL();
   165             iRichTextViewer->ApplyLayoutChangesL();
   166             );
   166             );
   167     iRichTextViewer->SetRect( viewerRect );
   167     iRichTextViewer->SetRect( viewerRect );
   344         iRichTextViewer->ResetActionMenuL();
   344         iRichTextViewer->ResetActionMenuL();
   345         }
   345         }
   346     }
   346     }
   347 
   347 
   348 // ---------------------------------------------------------------------------
   348 // ---------------------------------------------------------------------------
   349 // CESMRViewerFromField::HandleLongtapEventL
       
   350 // ---------------------------------------------------------------------------
       
   351 //
       
   352 void CESMRViewerFromField::HandleLongtapEventL( const TPoint& aPosition )
       
   353     {
       
   354     FUNC_LOG;
       
   355     
       
   356     if ( iRichTextViewer->Rect().Contains( aPosition ) )
       
   357         {
       
   358         iRichTextViewer->LinkSelectedL();
       
   359 		HandleTactileFeedbackL();
       
   360         }
       
   361     }
       
   362 
       
   363 // ---------------------------------------------------------------------------
       
   364 // CESMRViewerFromField::SetContainerWindowL()
   349 // CESMRViewerFromField::SetContainerWindowL()
   365 // ---------------------------------------------------------------------------
   350 // ---------------------------------------------------------------------------
   366 //
   351 //
   367 void CESMRViewerFromField::SetContainerWindowL(const CCoeControl& aContainer)
   352 void CESMRViewerFromField::SetContainerWindowL(const CCoeControl& aContainer)
   368     {
   353     {