phonebookui/Phonebook2/UIControls/inc/cpbk2contactviewdoublelistboxmodel.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 22:40:27 +0200
branchRCL_3
changeset 3 04ab22b956c2
parent 0 e686773b3f54
child 11 2828b4d142c0
permissions -rw-r--r--
Revision: 201003 Kit: 201007

/*
* Copyright (c) 2009-2009 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:  Phonebook 2 contact view double list box model.
*
*/


#ifndef CPBK2CONTACTVIEWDOUBLELISTBOXMODEL_H
#define CPBK2CONTACTVIEWDOUBLELISTBOXMODEL_H

//  INCLUDES
#include "CPbk2ContactViewListBoxModel.h"

//FORWARD
class CPbk2ThumbnailManager;
class MPbk2ContactUiControlDoubleListboxExtension;
class CPbk2ContactViewDoubleListboxDataElement;

// CLASS DECLARATION

/**
 * Phonebook 2 contact view double list box model.
 */
NONSHARABLE_CLASS(CPbk2ContactViewDoubleListBoxModel) :
    public CPbk2ContactViewListBoxModel
    {
public:  // Constructors and destructor

    /**
     * Creates a new instance of this class.
     *
     * @param aParams   Parameters for the model.
     * @return  A new instance of this class.
     */
     static CPbk2ContactViewDoubleListBoxModel* NewL(
            CPbk2ContactViewListBoxModel::TParams& aParams,
            CPbk2ThumbnailManager& aThumbManager );

    /**
     * Destructor.
     */
    ~CPbk2ContactViewDoubleListBoxModel();

    
    
protected:
    
    /**
     * Constructor
     */
    CPbk2ContactViewDoubleListBoxModel(
        CPbk2ContactViewListBoxModel::TParams& aParams,
        CPbk2ThumbnailManager& aThumbManager );

protected: // new 
    
    /**
     * Format whole line buffer based on aElement's content.
     * 
     * @param aElement data element which stores the line content 
     */
    void FormatBufferFromElement(
        const CPbk2ContactViewDoubleListboxDataElement& aElement ) const;
    
    /**
     * Append text into line buffer with trailing tab character. Removes 
     * illegal characters from the aText before appending. aText is subject to
     * modifications during this call.
     * 
     * @param aText text to append into line buffer 
     */
    void AppendText( TDes& aText ) const;
    
    /*
     * Appends icon index with trailing tab character if it's found from the icon array
     * 
     * @param aIconId 	Id of the icon in icon array
     */
    void AppendIconIndexIfFound(  const TPbk2IconId& aIconId ) const;
        
public: // From CPbk2ContactViewListBoxModel
    
    /// See CPbk2ContactViewListBoxModel
    void FormatBufferForContactL(
        const MVPbkViewContact& aViewContact, 
        TInt aIndex ) const;
    
private:	//data
	
	//REF:	thumbnail manager
	CPbk2ThumbnailManager& iThumbManager;
    
	/// Ref
	MPbk2ContactUiControlDoubleListboxExtension* iDoubleListExtensionPoint;
	
    };

#endif // CPBK2CONTACTVIEWDOUBLELISTBOXMODEL_H

// End of File