meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp
branchRCL_3
changeset 16 b5fbb9b25d57
parent 14 b13141f05c3d
child 22 d620048b4810
equal deleted inserted replaced
14:b13141f05c3d 16:b5fbb9b25d57
    83     FUNC_LOG;
    83     FUNC_LOG;
    84     TAknLayoutText layoutText =
    84     TAknLayoutText layoutText =
    85         NMRLayoutManager::GetLayoutText( Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
    85         NMRLayoutManager::GetLayoutText( Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
    86     iRichTextViewer->SetFontL( layoutText.Font() );
    86     iRichTextViewer->SetFontL( layoutText.Font() );
    87     iRichTextViewer->ApplyLayoutChangesL();
    87     iRichTextViewer->ApplyLayoutChangesL();
    88     
    88 
    89     if ( IsFocused() )
    89     if ( IsFocused() )
    90         {
    90         {
    91         iRichTextViewer->FocusChanged( EDrawNow );
    91         iRichTextViewer->FocusChanged( EDrawNow );
    92         }
    92         }
    93 
    93 
   203     // Setting Font for the rich text viewer
   203     // Setting Font for the rich text viewer
   204     TAknLayoutText text = NMRLayoutManager::GetLayoutText(
   204     TAknLayoutText text = NMRLayoutManager::GetLayoutText(
   205                 Rect(),
   205                 Rect(),
   206                 NMRLayoutManager::EMRTextLayoutTextEditor );
   206                 NMRLayoutManager::EMRTextLayoutTextEditor );
   207 
   207 
   208     // Failures are ignored. 
   208     // Failures are ignored.
   209     TRAP_IGNORE( 
   209     TRAP_IGNORE(
   210             // Try setting font 
   210             // Try setting font
   211             iRichTextViewer->SetFontL( text.Font() );
   211             iRichTextViewer->SetFontL( text.Font() );
   212             // Try applying changes
   212             // Try applying changes
   213             iRichTextViewer->ApplyLayoutChangesL();
   213             iRichTextViewer->ApplyLayoutChangesL();
   214             );
   214             );
   215 
   215 
       
   216     iRichTextViewer->SetRect(
       
   217             TRect( viewerRect.iTl,
       
   218                     TSize( viewerRect.Width(), iSize.iHeight ) ) );
       
   219 
   216     if ( iRichTextViewer->Size().iWidth != richTextViewerWidth )
   220     if ( iRichTextViewer->Size().iWidth != richTextViewerWidth )
   217         {
   221         {
   218         // Most of this case is screen orientation, in this case we need to 
   222         // Most of this case is screen orientation, in this case we need to
   219         // Record the index of focusing link, after updating link array, then 
   223         // Record the index of focusing link, after updating link array, then
   220         // reset the focusing to original one.
   224         // reset the focusing to original one.
   221         TInt focusingIndex = iRichTextViewer->GetFocusLink();
   225         TInt focusingIndex = iRichTextViewer->GetFocusLink();
   222         if ( KErrNotFound != focusingIndex )
   226         if ( KErrNotFound != focusingIndex )
   223             {
   227             {
   224             iRichTextViewer->SetFocusLink( focusingIndex );
   228             iRichTextViewer->SetFocusLink( focusingIndex );
   225             //wake up current contact menu selection by calling this
   229             //wake up current contact menu selection by calling this
   226             iRichTextViewer->FocusChanged(ENoDrawNow);
   230             iRichTextViewer->FocusChanged(ENoDrawNow);
   227             }
   231             }
   228         } 
   232         }
   229     }
   233     }
   230 
   234 
   231 // ---------------------------------------------------------------------------
   235 // ---------------------------------------------------------------------------
   232 // CESMRViewerDescriptionField::CountComponentControls()
   236 // CESMRViewerDescriptionField::CountComponentControls()
   233 // ---------------------------------------------------------------------------
   237 // ---------------------------------------------------------------------------
   400 //
   404 //
   401 void CESMRViewerDescriptionField::HandleLongtapEventL(
   405 void CESMRViewerDescriptionField::HandleLongtapEventL(
   402         const TPoint& aPosition )
   406         const TPoint& aPosition )
   403     {
   407     {
   404     FUNC_LOG;
   408     FUNC_LOG;
   405     
   409 
   406     if ( iRichTextViewer->Rect().Contains( aPosition ) )
   410     if ( iRichTextViewer->Rect().Contains( aPosition ) )
   407         {
   411         {
   408         if( iRichTextViewer->LinkSelectedL() )
   412         if( iRichTextViewer->LinkSelectedL() )
   409         	{
   413         	{
   410 			HandleTactileFeedbackL();        
   414 			HandleTactileFeedbackL();
   411         	}
   415         	}
   412         		
   416 
   413         }
   417         }
   414     }
   418     }
   415 
   419 
   416 // ---------------------------------------------------------------------------
   420 // ---------------------------------------------------------------------------
   417 // CESMRViewerDescriptionField::AddShowOnMapLinkL
   421 // CESMRViewerDescriptionField::AddShowOnMapLinkL
   578         }
   582         }
   579 
   583 
   580     return *iUrlParser;
   584     return *iUrlParser;
   581     }
   585     }
   582 
   586 
       
   587 // ---------------------------------------------------------------------------
       
   588 // CESMRViewerDescriptionField::SupportsLongTapFunctionalityL
       
   589 // ---------------------------------------------------------------------------
       
   590 //
       
   591 TBool CESMRViewerDescriptionField::SupportsLongTapFunctionalityL(
       
   592 		const TPointerEvent &aPointerEvent )
       
   593 	{
       
   594     FUNC_LOG;
       
   595     TBool ret( EFalse );
       
   596 
       
   597     if ( iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) )
       
   598         {
       
   599         if( iRichTextViewer->PointerEventOccuresOnALinkL( aPointerEvent ) )
       
   600         	{
       
   601 			ret = ETrue;
       
   602         	}
       
   603         }
       
   604 
       
   605     return ret;
       
   606 	}
       
   607 
   583 //EOF
   608 //EOF
   584 
   609