phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CRefineView.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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_CREFINEVIEW_H
       
    20 #define VPBKCNTMODEL_CREFINEVIEW_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "CFindViewBase.h"
       
    24 
       
    25 namespace VPbkCntModel {
       
    26 
       
    27 /**
       
    28  * Virtual phonebook refine view. This is used based on CFindView search
       
    29  * results. The search is refined when user presses another character to
       
    30  * find pane.
       
    31  */
       
    32 NONSHARABLE_CLASS( CRefineView ): public CFindViewBase
       
    33     {
       
    34     public: // Constructor and destructor
       
    35 
       
    36         /**
       
    37          * Creates a new instance of this class.
       
    38          *
       
    39          * @param aFindStrings Find strings
       
    40          * @param aParentView Previous view
       
    41          * @param aBaseView Base view
       
    42          * @param aExternalViewObserver
       
    43          * @param aContactFindPolicy A policy for matching
       
    44          * @param aAlwaysIncluded Is contact one of the always incl. contacts
       
    45          * @return A new instance of this class.
       
    46          */
       
    47         static CRefineView* NewLC(
       
    48                 const MDesCArray& aFindStrings,
       
    49                 MParentViewForFiltering& aParentView,
       
    50                 CViewBase& aBaseView,
       
    51                 MVPbkContactViewObserver& aExternalViewObserver,
       
    52                 MVPbkContactFindPolicy& aContactFindPolicy,
       
    53                 MAlwaysIncludedContacts& aAlwaysIncluded );
       
    54                                 
       
    55         /**
       
    56          * Destructor.
       
    57          */
       
    58         ~CRefineView();
       
    59         
       
    60     private: // From CFindViewBase
       
    61         void MatchL( RPointerArray<CCntModelViewContact>& aMatchedContacts );
       
    62         void DoContactAddedToViewL( MVPbkContactViewBase& aView,
       
    63                 TInt aIndex, const MVPbkContactLink& aContactLink,
       
    64                 RPointerArray<CCntModelViewContact>& aMatchedContacts );       
       
    65     
       
    66     private: // From MVPbkContactViewFiltering
       
    67         void UpdateFilterL( 
       
    68             const MDesCArray& aFindWords,
       
    69             const MVPbkContactBookmarkCollection* aAlwaysIncludedContacts );
       
    70             
       
    71     private: // From MAlwaysIncludedContacts    
       
    72         TBool IsContactAlwaysIncluded( const CViewContact& aContact ) const;
       
    73         
       
    74     private: // Implementation
       
    75         CRefineView( MParentViewForFiltering& aParentView,
       
    76             CViewBase& aBaseView,
       
    77             MAlwaysIncludedContacts& aAlwaysIncluded );
       
    78         static TInt StartUpdateCallback( TAny* aThis );
       
    79         
       
    80     private: // Data
       
    81         /// Ref: An interface for checking always included
       
    82         MAlwaysIncludedContacts& iAlwaysIncluded;
       
    83         /// Own: An idle object for starting async updated.
       
    84         CIdle* iIdleUpdate;
       
    85     };
       
    86 
       
    87 } // namespace VPbkCntModel
       
    88 
       
    89 #endif // VPBKCNTMODEL_CREFINEVIEW_H
       
    90 
       
    91 // End of File