emailuis/emailui/src/ncseditor.cpp
changeset 1 12c456ceeff2
parent 0 8466d47a6819
child 2 5253a20d2a1e
equal deleted inserted replaced
0:8466d47a6819 1:12c456ceeff2
    40 // constructor
    40 // constructor
    41 // ---------------------------------------------------------------------------
    41 // ---------------------------------------------------------------------------
    42 //
    42 //
    43 CNcsEditor::CNcsEditor( MNcsFieldSizeObserver* aSizeObserver,
    43 CNcsEditor::CNcsEditor( MNcsFieldSizeObserver* aSizeObserver,
    44                         TBool aHeaderField,
    44                         TBool aHeaderField,
    45                         TNcsEditorUsage aEditorUsage ) :
    45                         TNcsEditorUsage aEditorUsage,
       
    46                         const TDesC& aCaptionText ) :
    46     MNcsControl( aSizeObserver ),
    47     MNcsControl( aSizeObserver ),
    47     iPreviousFontHeight( -1 ),
    48     iPreviousFontHeight( -1 ),
    48     iPreviousLineSpacingInTwips( -1 ),
    49     iPreviousLineSpacingInTwips( -1 ),
    49     // Platform layout change
    50     // Platform layout change
    50     iHeaderField( aHeaderField ),
    51     iHeaderField( aHeaderField ),
    51     iNcsFontType ( NcsUtility::ENcsHeaderDetailFont ),
    52     iNcsFontType ( NcsUtility::ENcsHeaderDetailFont ),
    52     iEditorUsage( aEditorUsage ),
    53     iEditorUsage( aEditorUsage ),
    53     iRealRect( 0, 0, 0, 0 )
    54     iRealRect( 0, 0, 0, 0 ),
       
    55     iCaptionText( aCaptionText.Alloc() )
    54     {
    56     {
    55     FUNC_LOG;
    57     FUNC_LOG;
    56     }
    58     }
    57 
    59 
    58 // ---------------------------------------------------------------------------
    60 // ---------------------------------------------------------------------------
    88     
    90     
    89     if ( iEditorCustomDrawer )
    91     if ( iEditorCustomDrawer )
    90         {
    92         {
    91         delete iEditorCustomDrawer;        
    93         delete iEditorCustomDrawer;        
    92         }
    94         }
       
    95     delete iCaptionText;
    93     }
    96     }
    94 
    97 
    95 // -----------------------------------------------------------------------------
    98 // -----------------------------------------------------------------------------
    96 // CNcsEditor::OpenVirtualKeyBoardL()
    99 // CNcsEditor::OpenVirtualKeyBoardL()
    97 // -----------------------------------------------------------------------------
   100 // -----------------------------------------------------------------------------
   685     if ( iEditorCustomDrawer )
   688     if ( iEditorCustomDrawer )
   686         {
   689         {
   687         iEditorCustomDrawer->UpdateLayout( GetLayout() );
   690         iEditorCustomDrawer->UpdateLayout( GetLayout() );
   688         }
   691         }
   689     }
   692     }
       
   693 
       
   694 void CNcsEditor::GetCaptionForFep(TDes& aCaption) const
       
   695     {
       
   696     const TInt maximumLength = aCaption.MaxLength();    
       
   697     if ( iCaptionText && (iCaptionText->Length() < maximumLength) )
       
   698         {
       
   699         TPtr ptr = iCaptionText->Des();
       
   700         aCaption.Copy( ptr ); 
       
   701         }                   
       
   702     }
       
   703  
       
   704 TCoeInputCapabilities CNcsEditor::InputCapabilities() const
       
   705     {
       
   706     TCoeInputCapabilities caps = CEikEdwin::InputCapabilities();
       
   707     TCoeInputCapabilities caps2 = TCoeInputCapabilities(TCoeInputCapabilities::ENone, NULL, const_cast<CNcsEditor*>(this));
       
   708     caps.MergeWith(caps2);
       
   709     return caps;
       
   710     }