phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CFilteredContactView.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Contacts Model store contact view implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VPBKCNTMODEL_CFILTEREDCONTACTVIEW_H
       
    20 #define VPBKCNTMODEL_CFILTEREDCONTACTVIEW_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "CViewBase.h"
       
    24 #include <MVPbkContactViewObserver.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CVPbkFieldTypeSelector;
       
    28 class CContactFilteredView;
       
    29 
       
    30 namespace VPbkCntModel {
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CCustomFilteredContactView;
       
    34 
       
    35 
       
    36 /**
       
    37  * Virtual phonebook filtered contact view. This class filters contacts
       
    38  * based on field types.
       
    39  */
       
    40 NONSHARABLE_CLASS( CFilteredContactView ):
       
    41         public CViewBase,
       
    42         public MVPbkContactViewObserver,
       
    43         public MVPbkContactViewObserverExtension
       
    44     {
       
    45     public: // Constructor and destructor
       
    46 
       
    47         /**
       
    48          * Creates a new instance of this class.
       
    49          *
       
    50          * @param aObserver     Observer.
       
    51          * @param aParentStore  Parent contact store.
       
    52          * @param aSortOrder    Contact view sort order.
       
    53          * @param aFilter       Contact view filter
       
    54          * @param aFs           File server session.
       
    55          * @return  A new instance of this class.
       
    56          */
       
    57         static CFilteredContactView* NewLC(
       
    58                 const CVPbkContactViewDefinition& aViewDefinition,
       
    59                 MVPbkContactViewObserver& aObserver,
       
    60                 CContactStore& aParentStore,
       
    61                 const MVPbkFieldTypeList& aSortOrder,
       
    62                 RFs& aFs );
       
    63         /**
       
    64          * Destructor.
       
    65          */
       
    66         ~CFilteredContactView();
       
    67 
       
    68     private: // From CViewBase
       
    69         TVPbkContactViewType Type() const;
       
    70         void DoInitializeViewL(
       
    71                 const CVPbkContactViewDefinition& aViewDefinition,
       
    72                 RContactViewSortOrder& aViewSortOrder );
       
    73         void DoTeardownView();
       
    74         TBool DoChangeSortOrderL(
       
    75                 const CVPbkContactViewDefinition& aViewDefinition,
       
    76                 RContactViewSortOrder& aSortOrder );
       
    77 
       
    78     private: // From MVPbkContactViewObserver
       
    79         void ContactViewReady(
       
    80                 MVPbkContactViewBase& aView );
       
    81         void ContactViewUnavailable(
       
    82                 MVPbkContactViewBase& aView );
       
    83         void ContactAddedToView(
       
    84                 MVPbkContactViewBase& aView,
       
    85                 TInt aIndex,
       
    86                 const MVPbkContactLink& aContactLink );
       
    87         void ContactRemovedFromView(
       
    88                 MVPbkContactViewBase& aView,
       
    89                 TInt aIndex,
       
    90                 const MVPbkContactLink& aContactLink );
       
    91         void ContactViewError(
       
    92                 MVPbkContactViewBase& aView,
       
    93                 TInt aError,
       
    94                 TBool aErrorNotified );
       
    95         TAny* ContactViewObserverExtension( TUid aExtensionUid );
       
    96 
       
    97     private: // From MVPbkContactViewObserverExtension
       
    98 		void FilteredContactRemovedFromView(
       
    99 				MVPbkContactViewBase& aView );
       
   100 
       
   101     private: // Implementation
       
   102         CFilteredContactView(
       
   103                 CContactStore& aParentStore,
       
   104                 RFs& aFs );
       
   105         void ConstructL(
       
   106                 const CVPbkContactViewDefinition& aViewDefinition,
       
   107                 MVPbkContactViewObserver& aObserver,
       
   108                 const MVPbkFieldTypeList& aSortOrder );
       
   109         void ConstructBaseViewsL(
       
   110                 const CVPbkContactViewDefinition& aViewDefinition,
       
   111                 MContactViewObserver& aObserver,
       
   112                 RContactViewSortOrder& aViewSortOrder );
       
   113 
       
   114     private: // Data
       
   115         /// Own: All contacts view
       
   116         CContactViewBase* iBaseView;
       
   117         /// Ref: All contacts view if shared.
       
   118         CContactNamedRemoteView* iRemoteView;
       
   119         /// Own: Also same as CViewBase::iView, the filtered view
       
   120         CContactFilteredView* iFilteredView;
       
   121         /// Own: Custom filtered contact view
       
   122         CCustomFilteredContactView* iCustomFilteredView;
       
   123         /// Own: Contacts Model contact view filter
       
   124         TUint iNativeFilter;
       
   125         /// Own: Custom filtering needed indicator
       
   126         TBool iCustomFilteringNeeded;
       
   127         /// Own: The contact view filter
       
   128         CVPbkFieldTypeSelector* iFilter;
       
   129         /// Ref: Native filtered view observer
       
   130         MContactViewObserver* iNativeObserver;
       
   131         /// Ref: File server session
       
   132         RFs& iFs;
       
   133     };
       
   134 
       
   135 } // namespace VPbkCntModel
       
   136 
       
   137 #endif // VPBKCNTMODEL_CFILTEREDCONTACTVIEW_H
       
   138 
       
   139 // End of File