ipsservices/ipssossettings/src/ipssetuiitemlink.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:  Implements class with container to setting items.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include <e32base.h>
       
    21 #include "ipssetutilsexception.h"
       
    22 #include "ipssetuiitemlink.h"
       
    23 #include "ipssetutilsconsts.h"
       
    24 #include "ipssetuibasearray.h"
       
    25 
       
    26 
       
    27 // ----------------------------------------------------------------------------
       
    28 // CIpsSetUiItemLink::CIpsSetUiItemLink()
       
    29 // ----------------------------------------------------------------------------
       
    30 CIpsSetUiItemLink::CIpsSetUiItemLink()
       
    31     :
       
    32     iItemAppereance( EIpsSetUiUndefined ),
       
    33     iItemLinkArray( NULL ),
       
    34     iItemSettingText( NULL )
       
    35     {
       
    36     FUNC_LOG;
       
    37     }
       
    38 
       
    39 // ----------------------------------------------------------------------------
       
    40 // CIpsSetUiItemsEditText::ConstructL()
       
    41 // ----------------------------------------------------------------------------
       
    42 //
       
    43 void CIpsSetUiItemLink::ConstructL()
       
    44     {
       
    45     FUNC_LOG;
       
    46     CIpsSetUiItem::ConstructL();
       
    47 
       
    48     iItemSettingText = new ( ELeave ) TIpsSetUtilsTextPlain();
       
    49     }
       
    50 
       
    51 // ----------------------------------------------------------------------------
       
    52 // CIpsSetUiItemLink::CIpsSetUiItemLink()
       
    53 // ----------------------------------------------------------------------------
       
    54 CIpsSetUiItemLink::~CIpsSetUiItemLink()
       
    55     {
       
    56     FUNC_LOG;
       
    57     // Check if subarray exist
       
    58     if ( iItemLinkArray )
       
    59         {
       
    60         // Check all items in array and delete any subarrays from list
       
    61         for ( TInt index = iItemLinkArray->Count()-1; index >= 0; index-- )
       
    62             {
       
    63             // Only certain type of items can contain subarrays
       
    64             CIpsSetUiItem* base = ( *iItemLinkArray )[index];
       
    65 
       
    66             delete base;
       
    67             base = NULL;
       
    68             }
       
    69         }
       
    70 
       
    71     delete iItemLinkArray;
       
    72     iItemLinkArray = NULL;
       
    73     delete iItemSettingText;
       
    74     iItemSettingText = NULL;
       
    75     }
       
    76 
       
    77 // ----------------------------------------------------------------------------
       
    78 // CIpsSetUiItemLink::NewL()
       
    79 // ----------------------------------------------------------------------------
       
    80 //
       
    81 CIpsSetUiItemLink* CIpsSetUiItemLink::NewL()
       
    82     {
       
    83     FUNC_LOG;
       
    84     CIpsSetUiItemLink* self = NewLC();
       
    85     CleanupStack::Pop( self );
       
    86 
       
    87     return self;
       
    88     }
       
    89 
       
    90 // ----------------------------------------------------------------------------
       
    91 // CIpsSetUiItemLink::NewLC()
       
    92 // ----------------------------------------------------------------------------
       
    93 //
       
    94 CIpsSetUiItemLink* CIpsSetUiItemLink::NewLC()
       
    95     {
       
    96     FUNC_LOG;
       
    97     CIpsSetUiItemLink* self =
       
    98         new ( ELeave ) CIpsSetUiItemLink();
       
    99     CleanupStack::PushL( self );
       
   100     self->ConstructL();
       
   101 
       
   102     return self;
       
   103     }
       
   104 
       
   105 // ----------------------------------------------------------------------------
       
   106 // CIpsSetUiItemLink::operator=()
       
   107 // ----------------------------------------------------------------------------
       
   108 //
       
   109 CIpsSetUiItemLink& CIpsSetUiItemLink::operator=(
       
   110     const CIpsSetUiItemLink& aBaseItem )
       
   111     {
       
   112     FUNC_LOG;
       
   113     IPS_ASSERT_DEBUG( iItemLabel, EItemText, ENullPointer );
       
   114     IPS_ASSERT_DEBUG( aBaseItem.iItemLabel, EItemText, ENullPointer );
       
   115     IPS_ASSERT_DEBUG( iItemSettingText, EItemText, ENullPointerInParam );
       
   116     IPS_ASSERT_DEBUG( aBaseItem.iItemSettingText, EItemText, ENullPointerInParam );
       
   117 
       
   118     iItemFlags = aBaseItem.iItemFlags;
       
   119     iItemType = aBaseItem.iItemType;
       
   120     iItemLabel->Copy( *aBaseItem.iItemLabel );
       
   121     iItemId = aBaseItem.iItemId;
       
   122     iItemResourceId = aBaseItem.iItemResourceId;
       
   123     iItemLinkArray = aBaseItem.iItemLinkArray;
       
   124     iItemSettingText->Copy( *aBaseItem.iItemSettingText );
       
   125     iItemAppereance = aBaseItem.iItemAppereance;
       
   126 
       
   127     return *this;
       
   128     }
       
   129 
       
   130 // End of file
       
   131