email/imum/Utils/Src/MuiuDynamicSettingItemBase.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  MuiuDynamicSettingItemBase.cpp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <e32base.h>
       
    21 #include "MuiuDynamicSettingItemBase.h"
       
    22 #include "MuiuDynamicSettingsArray.hrh"
       
    23 #include "MuiuDynamicSettingsArray.h"
       
    24 #include "MuiuDynamicHeader.h"
       
    25 
       
    26 // EXTERNAL DATA STRUCTURES
       
    27 // EXTERNAL FUNCTION PROTOTYPES
       
    28 // CONSTANTS
       
    29 // MACROS
       
    30 // LOCAL CONSTANTS AND MACROS
       
    31 // MODULE DATA STRUCTURES
       
    32 // LOCAL FUNCTION PROTOTYPES
       
    33 // FORWARD DECLARATIONS
       
    34 // CLASS DECLARATION
       
    35 
       
    36 // ----------------------------------------------------------------------------
       
    37 // CMuiuSettingBase::CMuiuSettingBase()
       
    38 // ----------------------------------------------------------------------------
       
    39 CMuiuSettingBase::CMuiuSettingBase()
       
    40     :
       
    41     iItemType( EMuiuDynSetUndefined ),
       
    42     iItemLabel( NULL ),
       
    43     iItemId( TUid::Uid( 0 ) ),
       
    44     iItemResourceId( 0 )
       
    45     {
       
    46     }
       
    47 
       
    48 // ----------------------------------------------------------------------------
       
    49 // CMuiuSettingBase::ConstructL()
       
    50 // ----------------------------------------------------------------------------
       
    51 //
       
    52 void CMuiuSettingBase::ConstructL()
       
    53     {
       
    54     iItemLabel = new ( ELeave ) TMuiuSettingsText();
       
    55     }
       
    56 
       
    57 
       
    58 
       
    59 // ----------------------------------------------------------------------------
       
    60 // CMuiuSettingBase::~CMuiuSettingBase()
       
    61 // ----------------------------------------------------------------------------
       
    62 //
       
    63 CMuiuSettingBase::~CMuiuSettingBase()
       
    64     {
       
    65     delete iItemLabel;
       
    66     iItemLabel = NULL;
       
    67     }
       
    68 
       
    69 
       
    70 // ----------------------------------------------------------------------------
       
    71 // CMuiuSettingBase::NewL()
       
    72 // ----------------------------------------------------------------------------
       
    73 //
       
    74 CMuiuSettingBase* CMuiuSettingBase::NewL()
       
    75     {
       
    76     CMuiuSettingBase* self = NewLC();
       
    77     CleanupStack::Pop( self );
       
    78 
       
    79     return self;
       
    80     }
       
    81 
       
    82 
       
    83 // ----------------------------------------------------------------------------
       
    84 // CMuiuSettingBase::NewLC()
       
    85 // ----------------------------------------------------------------------------
       
    86 //
       
    87 CMuiuSettingBase* CMuiuSettingBase::NewLC()
       
    88     {
       
    89     CMuiuSettingBase* self =
       
    90         new ( ELeave ) CMuiuSettingBase();
       
    91     CleanupStack::PushL( self );
       
    92     self->ConstructL();
       
    93 
       
    94     return self;
       
    95     }
       
    96 
       
    97 // ----------------------------------------------------------------------------
       
    98 // CMuiuSettingBase::operator=()
       
    99 // ----------------------------------------------------------------------------
       
   100 //
       
   101 CMuiuSettingBase& CMuiuSettingBase::operator=(
       
   102     const CMuiuSettingBase& aBaseItem )
       
   103     {
       
   104     __ASSERT_DEBUG( iItemLabel,
       
   105         User::Panic( KMuiuBaseItemPanic, KErrUnknown ) );
       
   106     __ASSERT_DEBUG( aBaseItem.iItemLabel,
       
   107         User::Panic( KMuiuBaseItemPanic, KErrUnknown ) );
       
   108 
       
   109     iItemFlags = aBaseItem.iItemFlags;
       
   110     iItemType = aBaseItem.iItemType;
       
   111     iItemLabel->Copy( *aBaseItem.iItemLabel );
       
   112     iItemId = aBaseItem.iItemId;
       
   113     iItemResourceId = aBaseItem.iItemResourceId;
       
   114 
       
   115     return *this;
       
   116     }
       
   117 
       
   118 // End of file
       
   119