email/imum/Utils/Src/MuiuDynamicSettingItemBase.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:25:02 +0300
branchRCL_3
changeset 21 c6838af47512
parent 0 72b543305e3a
permissions -rw-r--r--
Revision: 201011 Kit: 201013

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  MuiuDynamicSettingItemBase.cpp
*
*/


// INCLUDE FILES
#include <e32base.h>
#include "MuiuDynamicSettingItemBase.h"
#include "MuiuDynamicSettingsArray.hrh"
#include "MuiuDynamicSettingsArray.h"
#include "MuiuDynamicHeader.h"

// EXTERNAL DATA STRUCTURES
// EXTERNAL FUNCTION PROTOTYPES
// CONSTANTS
// MACROS
// LOCAL CONSTANTS AND MACROS
// MODULE DATA STRUCTURES
// LOCAL FUNCTION PROTOTYPES
// FORWARD DECLARATIONS
// CLASS DECLARATION

// ----------------------------------------------------------------------------
// CMuiuSettingBase::CMuiuSettingBase()
// ----------------------------------------------------------------------------
CMuiuSettingBase::CMuiuSettingBase()
    :
    iItemType( EMuiuDynSetUndefined ),
    iItemLabel( NULL ),
    iItemId( TUid::Uid( 0 ) ),
    iItemResourceId( 0 )
    {
    }

// ----------------------------------------------------------------------------
// CMuiuSettingBase::ConstructL()
// ----------------------------------------------------------------------------
//
void CMuiuSettingBase::ConstructL()
    {
    iItemLabel = new ( ELeave ) TMuiuSettingsText();
    }



// ----------------------------------------------------------------------------
// CMuiuSettingBase::~CMuiuSettingBase()
// ----------------------------------------------------------------------------
//
CMuiuSettingBase::~CMuiuSettingBase()
    {
    delete iItemLabel;
    iItemLabel = NULL;
    }


// ----------------------------------------------------------------------------
// CMuiuSettingBase::NewL()
// ----------------------------------------------------------------------------
//
CMuiuSettingBase* CMuiuSettingBase::NewL()
    {
    CMuiuSettingBase* self = NewLC();
    CleanupStack::Pop( self );

    return self;
    }


// ----------------------------------------------------------------------------
// CMuiuSettingBase::NewLC()
// ----------------------------------------------------------------------------
//
CMuiuSettingBase* CMuiuSettingBase::NewLC()
    {
    CMuiuSettingBase* self =
        new ( ELeave ) CMuiuSettingBase();
    CleanupStack::PushL( self );
    self->ConstructL();

    return self;
    }

// ----------------------------------------------------------------------------
// CMuiuSettingBase::operator=()
// ----------------------------------------------------------------------------
//
CMuiuSettingBase& CMuiuSettingBase::operator=(
    const CMuiuSettingBase& aBaseItem )
    {
    __ASSERT_DEBUG( iItemLabel,
        User::Panic( KMuiuBaseItemPanic, KErrUnknown ) );
    __ASSERT_DEBUG( aBaseItem.iItemLabel,
        User::Panic( KMuiuBaseItemPanic, KErrUnknown ) );

    iItemFlags = aBaseItem.iItemFlags;
    iItemType = aBaseItem.iItemType;
    iItemLabel->Copy( *aBaseItem.iItemLabel );
    iItemId = aBaseItem.iItemId;
    iItemResourceId = aBaseItem.iItemResourceId;

    return *this;
    }

// End of file