phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CGroupMembersView.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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:  Virtual Phonebook group members view
       
    15 *
       
    16 */
       
    17  
       
    18 
       
    19 #ifndef CGROUPMEMBERSVIEW_H
       
    20 #define CGROUPMEMBERSVIEW_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "CViewBase.h"
       
    24 
       
    25 #include <MVPbkContactViewObserver.h>
       
    26 
       
    27 namespace VPbkCntModel {
       
    28 
       
    29 
       
    30 /**
       
    31  * Virtual phonebook group members view
       
    32  */
       
    33 NONSHARABLE_CLASS( CGroupMembersView ): 
       
    34         public CViewBase,
       
    35         public MVPbkContactViewObserver
       
    36     {
       
    37     public:  // Constructor and destructor
       
    38         /**
       
    39          * Creates new instance of this class
       
    40          * @param aParentStore Store where to get the group members
       
    41          * @param aGroupId Identification of the group
       
    42          * @param aObserver Observer that gets notifications
       
    43          * @param aSortOrder Order of the results in the view
       
    44          * @return A new instance of this class
       
    45          */
       
    46         static CGroupMembersView* NewLC(
       
    47                 CContactStore& aParentStore,
       
    48                 TContactItemId aGroupId,
       
    49                 MVPbkContactViewObserver& aObserver,
       
    50                 const MVPbkFieldTypeList& aSortOrder);
       
    51         ~CGroupMembersView();
       
    52 
       
    53     private: // From CViewBase
       
    54         TVPbkContactViewType Type() const;
       
    55         void DoInitializeViewL(
       
    56                 const CVPbkContactViewDefinition& aViewDefinition,
       
    57                 RContactViewSortOrder& aViewSortOrder );
       
    58         void DoTeardownView();
       
    59         TBool DoChangeSortOrderL(
       
    60                 const CVPbkContactViewDefinition& aViewDefinition,
       
    61                 RContactViewSortOrder& aSortOrder );
       
    62 
       
    63     private: // From MVPbkContactViewObserver
       
    64         void ContactViewReady(MVPbkContactViewBase&) 
       
    65             {}
       
    66         void ContactViewUnavailable(MVPbkContactViewBase&)
       
    67             {}
       
    68         void ContactAddedToView(MVPbkContactViewBase&, TInt, const MVPbkContactLink&)
       
    69             {}
       
    70         void ContactRemovedFromView(MVPbkContactViewBase&, TInt, const MVPbkContactLink&)
       
    71             {}
       
    72         void ContactViewError(MVPbkContactViewBase&, TInt, TBool)
       
    73             {}
       
    74 
       
    75     private: // Implementation
       
    76         CGroupMembersView(
       
    77                 CContactStore& aParentStore,
       
    78                 TContactItemId aGroupId);
       
    79         void ConstructL(MVPbkContactViewObserver& aObserver, const MVPbkFieldTypeList& aSortOrder);
       
    80 
       
    81     private: // Data
       
    82         /// Own: contact base view
       
    83         CViewBase* iBaseView;
       
    84         /// Ref: group identification
       
    85         TContactItemId iGroupId;
       
    86     };
       
    87 
       
    88 } // namespace VPbkCntModel
       
    89 
       
    90 #endif // CGROUPMEMBERSVIEW_H
       
    91 
       
    92 // End of file