phonebookui/Phonebook/View/inc/CPbkContactGroupListModel.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *    Phonebook contact view listbox model.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CPbkContactGroupListModel_H__
       
    21 #define __CPbkContactGroupListModel_H__
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include "CPbkContactViewListModelBase.h"
       
    26 #include <cntdef.h>         // TContactItemId
       
    27 #include "PbkIconId.hrh"    // TPbkIconId
       
    28 
       
    29 
       
    30 //  FORWARD DECLARATIONS
       
    31 class CContactViewBase;
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * Listbox model for CPbkContactViewListControl.
       
    38  */
       
    39 NONSHARABLE_CLASS(CPbkContactGroupListModel) : 
       
    40         public CPbkContactViewListModelBase
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         /**
       
    44          * Creates a new instance of this class.
       
    45 		 * @param aGroupView reference to contact model view
       
    46          */
       
    47         static CPbkContactGroupListModel* NewL(CContactViewBase& aGroupView);
       
    48 
       
    49         /**
       
    50          * Destructor.
       
    51          */ 
       
    52         ~CPbkContactGroupListModel();
       
    53 
       
    54     private:  // from CPbkContactGroupListModelBase
       
    55         void FormatBufferForContactL(const CViewContact& aViewContact) const;
       
    56         void FormatBufferForGroupL(const CViewContact& aViewContact) const;
       
    57         void FormatEmptyBuffer() const;
       
    58 
       
    59     private:  // Implementation
       
    60         CPbkContactGroupListModel(CContactViewBase& aView);
       
    61         void ConstructL();
       
    62         void AppendName(const TDesC& aName) const;
       
    63 
       
    64     private:  // Data
       
    65         enum 
       
    66             {
       
    67             /// Maximum length of a formatted list box item text 
       
    68             KMaxListBoxText = 256
       
    69             };
       
    70         /// Own: buffer for formatted list box item text
       
    71         TBuf<KMaxListBoxText> iFormattingBuffer;
       
    72         /// Own: index of the group label field
       
    73         TInt iGroupLabelFieldIndex;
       
    74     };
       
    75 
       
    76 
       
    77 #endif // __CPbkContactGroupListModel_H__
       
    78 
       
    79 // End of File