phonebookui/Phonebook2/UIControls/inc/cpbk2contactviewdoublelistboxmodel.h
branchRCL_3
changeset 20 f4a778e096c2
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2009-2009 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:  Phonebook 2 contact view double list box model.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTVIEWDOUBLELISTBOXMODEL_H
       
    20 #define CPBK2CONTACTVIEWDOUBLELISTBOXMODEL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "CPbk2ContactViewListBoxModel.h"
       
    24 
       
    25 //FORWARD
       
    26 class CPbk2ThumbnailManager;
       
    27 class MPbk2ContactUiControlDoubleListboxExtension;
       
    28 class CPbk2ContactViewDoubleListboxDataElement;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  * Phonebook 2 contact view double list box model.
       
    34  */
       
    35 NONSHARABLE_CLASS(CPbk2ContactViewDoubleListBoxModel) :
       
    36     public CPbk2ContactViewListBoxModel
       
    37     {
       
    38 public:  // Constructors and destructor
       
    39 
       
    40     /**
       
    41      * Creates a new instance of this class.
       
    42      *
       
    43      * @param aParams   Parameters for the model.
       
    44      * @return  A new instance of this class.
       
    45      */
       
    46      static CPbk2ContactViewDoubleListBoxModel* NewL(
       
    47             CPbk2ContactViewListBoxModel::TParams& aParams,
       
    48             CPbk2ThumbnailManager& aThumbManager );
       
    49 
       
    50     /**
       
    51      * Destructor.
       
    52      */
       
    53     ~CPbk2ContactViewDoubleListBoxModel();
       
    54 
       
    55     
       
    56     
       
    57 protected:
       
    58     
       
    59     /**
       
    60      * Constructor
       
    61      */
       
    62     CPbk2ContactViewDoubleListBoxModel(
       
    63         CPbk2ContactViewListBoxModel::TParams& aParams,
       
    64         CPbk2ThumbnailManager& aThumbManager );
       
    65 
       
    66 protected: // new 
       
    67     
       
    68     /**
       
    69      * Format whole line buffer based on aElement's content.
       
    70      * 
       
    71      * @param aElement data element which stores the line content 
       
    72      */
       
    73     void FormatBufferFromElement(
       
    74         const CPbk2ContactViewDoubleListboxDataElement& aElement ) const;
       
    75     
       
    76     /**
       
    77      * Append text into line buffer with trailing tab character. Removes 
       
    78      * illegal characters from the aText before appending. aText is subject to
       
    79      * modifications during this call.
       
    80      * 
       
    81      * @param aText text to append into line buffer 
       
    82      */
       
    83     void AppendText( TDes& aText ) const;
       
    84     
       
    85     /*
       
    86      * Appends icon index with trailing tab character if it's found from the icon array
       
    87      * 
       
    88      * @param aIconId 	Id of the icon in icon array
       
    89      */
       
    90     void AppendIconIndexIfFound( const TPbk2IconId& aIconId ) const;
       
    91 
       
    92     void AppendThumbnailL( 
       
    93             CPbk2ContactViewDoubleListboxDataElement& aDataElement, 
       
    94             TInt aIndex,
       
    95             const MVPbkContactLink& aLink ) const;
       
    96     
       
    97     void FetchDataFromExtension(
       
    98             CPbk2ContactViewDoubleListboxDataElement& aDataElement,
       
    99             TInt aIndex,
       
   100             const MVPbkContactLink& aLink ) const;
       
   101     
       
   102 public: // From CPbk2ContactViewListBoxModel
       
   103     void FormatBufferL( 
       
   104             const TInt aIndex ) const;    
       
   105     /// See CPbk2ContactViewListBoxModel
       
   106     void FormatBufferForContactL(
       
   107         const MVPbkViewContact& aViewContact, 
       
   108         TInt aIndex ) const;
       
   109 private:	//data
       
   110 	
       
   111 	//REF:	thumbnail manager
       
   112 	CPbk2ThumbnailManager& iThumbManager;
       
   113     
       
   114 	/// Ref
       
   115 	MPbk2ContactUiControlDoubleListboxExtension* iDoubleListExtensionPoint;
       
   116 	
       
   117     };
       
   118 
       
   119 #endif // CPBK2CONTACTVIEWDOUBLELISTBOXMODEL_H
       
   120 
       
   121 // End of File