ipsservices/ipssossettings/src/ipssetdatasignature.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: This file implements class CIpsSetDataSignature.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include <txtrich.h>    // CRichText
       
    21 #include <txtfmlyr.h>   // CParaFormatLayer, CCharFormatLayer
       
    22 
       
    23 #include "ipssetdatasignature.h"
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // CIpsSetDataSignature::NewL()
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 CIpsSetDataSignature* CIpsSetDataSignature::NewL()
       
    30     {
       
    31     FUNC_LOG;
       
    32     CIpsSetDataSignature* self = new ( ELeave ) CIpsSetDataSignature;
       
    33     CleanupStack::PushL( self );
       
    34     self->ConstructL();
       
    35     CleanupStack::Pop( self );
       
    36     
       
    37     return self;
       
    38     }
       
    39 
       
    40 
       
    41 // ----------------------------------------------------------------------------
       
    42 // CIpsSetDataSignature::CIpsSetDataSignature()
       
    43 // ----------------------------------------------------------------------------
       
    44 CIpsSetDataSignature::CIpsSetDataSignature()
       
    45     {
       
    46     FUNC_LOG;
       
    47     }
       
    48 
       
    49 // ----------------------------------------------------------------------------
       
    50 // CIpsSetDataSignature::CIpsSetDataSignature()
       
    51 // ----------------------------------------------------------------------------
       
    52 CIpsSetDataSignature::CIpsSetDataSignature(
       
    53     CRichText*        aRichText,
       
    54     CParaFormatLayer* aParaFormat,
       
    55     CCharFormatLayer* aCharFormat )
       
    56     :
       
    57     iRichText( aRichText ),
       
    58     iParaFormatLayer( aParaFormat ),
       
    59     iCharFormatLayer( aCharFormat )
       
    60     {
       
    61     FUNC_LOG;
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // CIpsSetDataSignature::ConstructL()
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 void CIpsSetDataSignature::ConstructL()
       
    69     {
       
    70     FUNC_LOG;
       
    71     
       
    72     }
       
    73 
       
    74 // ----------------------------------------------------------------------------
       
    75 // CIpsSetDataSignature::~CIpsSetDataSignature()
       
    76 // ----------------------------------------------------------------------------
       
    77 CIpsSetDataSignature::~CIpsSetDataSignature()
       
    78     {
       
    79     FUNC_LOG;
       
    80     delete iRichText;
       
    81     delete iParaFormatLayer;
       
    82     delete iCharFormatLayer;
       
    83     }
       
    84 
       
    85 // ----------------------------------------------------------------------------
       
    86 // CIpsSetDataSignature::CopyL()
       
    87 // ----------------------------------------------------------------------------
       
    88 void CIpsSetDataSignature::CopyL( const CIpsSetDataSignature& aSignature )
       
    89     {
       
    90     FUNC_LOG;
       
    91     delete iRichText;
       
    92     iRichText = NULL;
       
    93 
       
    94     delete iParaFormatLayer;
       
    95     iParaFormatLayer = NULL;
       
    96 
       
    97     delete iCharFormatLayer;
       
    98     iCharFormatLayer = NULL;
       
    99 
       
   100     if ( aSignature.iParaFormatLayer )
       
   101         {
       
   102         iParaFormatLayer = aSignature.iParaFormatLayer->CloneL();
       
   103         }
       
   104     if ( aSignature.iCharFormatLayer )
       
   105         {
       
   106         iCharFormatLayer = aSignature.iCharFormatLayer->CloneL();
       
   107         }
       
   108     if ( aSignature.iRichText )
       
   109         {
       
   110         iRichText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
       
   111         iRichText->AppendTakingSolePictureOwnershipL( *aSignature.iRichText );
       
   112         }
       
   113     }
       
   114         
       
   115 // ----------------------------------------------------------------------------
       
   116 // CIpsSetDataSignature::CreateEmptyRichTextL()
       
   117 // ----------------------------------------------------------------------------
       
   118 void CIpsSetDataSignature::CreateEmptyRichTextL()
       
   119     {
       
   120     FUNC_LOG;
       
   121     delete iRichText;
       
   122     iRichText = NULL;
       
   123     
       
   124     delete iParaFormatLayer;
       
   125     iParaFormatLayer = NULL;
       
   126 
       
   127     delete iCharFormatLayer;
       
   128     iCharFormatLayer = NULL;
       
   129 
       
   130     iParaFormatLayer = CParaFormatLayer::NewL();
       
   131     iCharFormatLayer = CCharFormatLayer::NewL();
       
   132     iRichText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
       
   133     }
       
   134 
       
   135 // End of File
       
   136 
       
   137