emailuis/uicomponents/src/fsrichtexttext.cpp
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of class CFsRichTextText
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include "fsrichtexttext.h"
       
    21 
       
    22 // ---------------------------------------------------------------------------
       
    23 // NewL
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 CFsRichTextText* CFsRichTextText::NewL()
       
    27     {
       
    28     FUNC_LOG;
       
    29     CFsRichTextText* self = new ( ELeave ) CFsRichTextText();
       
    30     CleanupStack::PushL( self );
       
    31     self->ConstructL();
       
    32     CleanupStack::Pop( self );
       
    33     return self;
       
    34     }
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // NewL
       
    38 // ---------------------------------------------------------------------------
       
    39 //    
       
    40 CFsRichTextText* CFsRichTextText::NewL( const TDesC& aText )
       
    41     {
       
    42     FUNC_LOG;
       
    43     CFsRichTextText* self = new ( ELeave ) CFsRichTextText();
       
    44     CleanupStack::PushL( self );
       
    45     self->ConstructL( aText );
       
    46     CleanupStack::Pop( self );
       
    47     return self;
       
    48     }
       
    49     
       
    50 // ---------------------------------------------------------------------------
       
    51 // NewL
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 CFsRichTextText* CFsRichTextText::NewL( 
       
    55                     const TDesC& aText, 
       
    56                     TInt aTextStyle )
       
    57     {
       
    58     FUNC_LOG;
       
    59     CFsRichTextText* self = new ( ELeave ) CFsRichTextText( aTextStyle );
       
    60     CleanupStack::PushL( self );
       
    61     self->ConstructL( aText );
       
    62     CleanupStack::Pop( self );
       
    63     return self;
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // ~CFsRichTextText
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 CFsRichTextText::~CFsRichTextText()
       
    71     {
       
    72     FUNC_LOG;
       
    73     if ( iText )
       
    74         {
       
    75         delete iText; 
       
    76         }
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // GetText
       
    81 // ---------------------------------------------------------------------------
       
    82 //    
       
    83 TDesC& CFsRichTextText::GetText() const 
       
    84     {
       
    85     FUNC_LOG;
       
    86     return *iText;
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------------------------
       
    90 // SetText
       
    91 // ---------------------------------------------------------------------------
       
    92 //    
       
    93 void CFsRichTextText::SetTextL( const TDesC& aText )
       
    94     {
       
    95     FUNC_LOG;
       
    96     iText = aText.AllocL();
       
    97     }
       
    98 
       
    99 // ---------------------------------------------------------------------------
       
   100 // GetStyleId
       
   101 // ---------------------------------------------------------------------------
       
   102 //
       
   103 TInt CFsRichTextText::GetStyleId() const
       
   104     {
       
   105     FUNC_LOG;
       
   106     return iStyle;
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // SetStyleId
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 void CFsRichTextText::SetStyleId( const TInt aTextStyleId )
       
   114     {
       
   115     FUNC_LOG;
       
   116     iStyle = aTextStyleId;
       
   117     }    
       
   118 
       
   119 // ---------------------------------------------------------------------------
       
   120 // ConstructL
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 void CFsRichTextText::ConstructL()
       
   124     {
       
   125     FUNC_LOG;
       
   126     }
       
   127 
       
   128 // ---------------------------------------------------------------------------
       
   129 // ConstructL
       
   130 // ---------------------------------------------------------------------------
       
   131 //
       
   132 void CFsRichTextText::ConstructL( const TDesC& aText )
       
   133     {
       
   134     FUNC_LOG;
       
   135     iText = aText.AllocL();
       
   136     }
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 // CFsRichTextText
       
   140 // ---------------------------------------------------------------------------
       
   141 //
       
   142 CFsRichTextText::CFsRichTextText()
       
   143     {
       
   144     FUNC_LOG;
       
   145     iType = EFsText; 
       
   146     }
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // CFsRichTextText
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 CFsRichTextText::CFsRichTextText( const TInt aTextStyle ) 
       
   153         : iStyle( aTextStyle )
       
   154     {
       
   155     FUNC_LOG;
       
   156     iType = EFsText; 
       
   157     }
       
   158    
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // CFsRichTextText
       
   162 // ---------------------------------------------------------------------------
       
   163 //  
       
   164 void CFsRichTextText::SetTextColor(TRgb aColor)
       
   165     {
       
   166     FUNC_LOG;
       
   167     iColor = aColor;
       
   168     }
       
   169 
       
   170 // ---------------------------------------------------------------------------
       
   171 // CFsRichTextText
       
   172 // ---------------------------------------------------------------------------
       
   173 //     
       
   174 TRgb CFsRichTextText::GetTextColor() const
       
   175     {
       
   176     FUNC_LOG;
       
   177     return iColor;
       
   178     }
       
   179 
       
   180 // ---------------------------------------------------------------------------
       
   181 // CFsRichTextText
       
   182 // ---------------------------------------------------------------------------
       
   183 //  
       
   184 void CFsRichTextText::SetTextDirection(TBidiText::TDirectionality aTextDirection)
       
   185     {
       
   186     FUNC_LOG;
       
   187     iTextDirection = aTextDirection;
       
   188     }
       
   189 
       
   190 // ---------------------------------------------------------------------------
       
   191 // CFsRichTextText
       
   192 // ---------------------------------------------------------------------------
       
   193 //     
       
   194 TBidiText::TDirectionality CFsRichTextText::GetTextDirection() const
       
   195     {
       
   196     FUNC_LOG;
       
   197     return iTextDirection;
       
   198     }
       
   199