emailcontacts/contactactionservice/src/CFscFieldPropertyGroup.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 00:02:40 +0200
changeset 4 e7aa27f58ae1
parent 0 8466d47a6819
permissions -rw-r--r--
Revision: 201003 Kit: 201005

/*
* Copyright (c) 2008 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:  Implementation field property group.
 *
*/


#include "emailtrace.h"
#include "CFscFieldPropertyGroup.h"

// System includes
#include <barsread.h>

// --------------------------------------------------------------------------
// CFscFieldPropertyGroup::CFscFieldPropertyGroup
// --------------------------------------------------------------------------
//
CFscFieldPropertyGroup::CFscFieldPropertyGroup()
    {
    FUNC_LOG;
    }

// --------------------------------------------------------------------------
// CFscFieldPropertyGroup::~CFscFieldPropertyGroup
// --------------------------------------------------------------------------
//
CFscFieldPropertyGroup::~CFscFieldPropertyGroup()
    {
    FUNC_LOG;
    iProperties.Close();
    delete iLabel;
    }

// --------------------------------------------------------------------------
// CFscFieldPropertyGroup::ConstructL
// --------------------------------------------------------------------------
//
inline void CFscFieldPropertyGroup::ConstructL(TResourceReader& aReader)
    {
    FUNC_LOG;
    aReader.ReadInt8(); // read version number
    iGroupId = static_cast<TPbk2FieldGroupId>(aReader.ReadInt8() );
    iLabel = aReader.ReadHBufC16L();
    iIconId = TPbk2IconId(aReader);
    iAddItemOrdering = aReader.ReadInt8();
    }

// --------------------------------------------------------------------------
// CFscFieldPropertyGroup::NewLC
// --------------------------------------------------------------------------
//
CFscFieldPropertyGroup* CFscFieldPropertyGroup::NewLC(
        TResourceReader& aReader)
    {
    FUNC_LOG;
    CFscFieldPropertyGroup* self = new ( ELeave ) CFscFieldPropertyGroup;
    CleanupStack::PushL(self);
    self->ConstructL(aReader);
    return self;
    }

// --------------------------------------------------------------------------
// CFscFieldPropertyGroup::Count
// --------------------------------------------------------------------------
//
 TInt CFscFieldPropertyGroup::Count() const
    {
    FUNC_LOG;
    return iProperties.Count();
    }

// --------------------------------------------------------------------------
// CFscFieldPropertyGroup::At
// --------------------------------------------------------------------------
//
 const MPbk2FieldProperty& CFscFieldPropertyGroup::At
( TInt aIndex ) const
    {
    FUNC_LOG;
    return *iProperties[aIndex];
    }

// --------------------------------------------------------------------------
// CFscFieldPropertyGroup::AddFieldPropertyL
// --------------------------------------------------------------------------
//  
void CFscFieldPropertyGroup::AddFieldPropertyL(
        const MPbk2FieldProperty& aProperty)
    {
    FUNC_LOG;
    iProperties.AppendL( &aProperty);
    }

// End of File