phonebookengines/VirtualPhonebook/VPbkSimStore/inc/CRefineView.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Sim store contact view implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VPBKSIMSTORE_CREFINEVIEW_H
       
    20 #define VPBKSIMSTORE_CREFINEVIEW_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "CFindViewBase.h"
       
    24 
       
    25 namespace VPbkSimStore {
       
    26 
       
    27 
       
    28 /**
       
    29  * A refined filtered view whose parent view is CFindView or CRefineView.
       
    30  *
       
    31  * This view doesn't own its contacts but only saved pointers to the
       
    32  * contacts owned by CFindView.
       
    33  */
       
    34 NONSHARABLE_CLASS( CRefineView ): public CFindViewBase
       
    35     {
       
    36     public: // Constructor and destructor
       
    37 
       
    38         /**
       
    39          * Creates a new instance of this class.
       
    40          *
       
    41          * @param aObserver     Observer.
       
    42          * @param aParentStore  Parent contact store.
       
    43          * @param aSortOrder    Contact view sort order.                 
       
    44          * @return  A new instance of this class.
       
    45          */
       
    46         static CRefineView* NewLC(
       
    47                 const MDesCArray& aFindStrings,
       
    48                 MParentViewForFiltering& aParentView,
       
    49                 CContactView& aAllContactsView,
       
    50                 MVPbkContactViewObserver& aExternalViewObserver,
       
    51                 MVPbkContactFindPolicy& aContactFindPolicy,
       
    52                 MAlwaysIncludedContacts& aAlwaysIncluded );
       
    53                 
       
    54         /**
       
    55          * Destructor.
       
    56          */
       
    57         ~CRefineView();
       
    58     
       
    59     private: // From MVPbkContactViewObserver
       
    60         void ContactViewReady( MVPbkContactViewBase& aView );
       
    61         void ContactViewReadyForFiltering( MParentViewForFiltering& aView );
       
    62         
       
    63     private: // From CFindViewBase
       
    64         void MatchL( RPointerArray<MVPbkSimContact>& aMatchedContacts );
       
    65         void DoContactAddedToViewL( MVPbkContactViewBase& aView,
       
    66                 TInt aIndex, const MVPbkContactLink& aContactLink,
       
    67                 RPointerArray<MVPbkSimContact>& aMatchedContacts );
       
    68     
       
    69     private: // From MVPbkContactViewFiltering
       
    70         void UpdateFilterL( 
       
    71             const MDesCArray& aFindWords,
       
    72             const MVPbkContactBookmarkCollection* aAlwaysIncludedContacts );
       
    73         TBool IsNativeMatchingRequestActive();
       
    74             
       
    75     private: // From MAlwaysIncludedContacts    
       
    76         TBool IsContactAlwaysIncluded( const CViewContact& aContact ) const;
       
    77         
       
    78     private: // Implementation
       
    79         CRefineView( MParentViewForFiltering& aParentView,
       
    80             CContactView& aAllContactsView,
       
    81             MAlwaysIncludedContacts& aAlwaysIncluded );
       
    82         static TInt StartUpdateCallback( TAny* aThis );
       
    83                              
       
    84     private: // Data
       
    85         /// Ref: An interface for checking always included
       
    86         MAlwaysIncludedContacts& iAlwaysIncluded;
       
    87         /// Own: An idle object for starting async updated.
       
    88         CIdle* iIdleUpdate;
       
    89     };
       
    90 
       
    91 } // namespace VPbkSimStore
       
    92 
       
    93 #endif // VPBKSIMSTORE_CREFINEVIEW_H
       
    94 
       
    95 // End of File