phonebookui/Phonebook/View/inc/CPbkChineseFindPrimitives.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 *    Chinese find primitives implementation for Phonebook.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CPbkChineseFindPrimitives_H__
       
    21 #define __CPbkChineseFindPrimitives_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <cntviewbase.h>
       
    25 #include "MPbkFindPrimitives.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CFindUtil;
       
    29 class MPbkContactNameFormat;
       
    30 class CPbkViewContactNameFormatter;
       
    31 
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * Chinese find primitives implementation.
       
    37  */
       
    38 NONSHARABLE_CLASS(CPbkChineseFindPrimitives) : 
       
    39         public CBase, public MPbkFindPrimitives
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42         /**
       
    43          * Creates a new instance of this class.
       
    44 		 * @param aNameFormatter contact name formatter
       
    45          */
       
    46         static CPbkChineseFindPrimitives* NewL
       
    47             (MPbkContactNameFormat& aContactNameFormatter);
       
    48 		
       
    49         /**
       
    50          * Destructor.
       
    51          */
       
    52         ~CPbkChineseFindPrimitives();
       
    53         
       
    54     public:  // from MPbkFindPrimitives
       
    55         void SetContactViewSortOrderL(const RContactViewSortOrder& aSortOrder);
       
    56         TBool IsFindMatchL
       
    57             (const CViewContact& aViewContact, const TDesC& aFindText);
       
    58         void GetInitialMatchesL
       
    59             (CContactViewBase& aView,
       
    60             const TDesC& aFindText,
       
    61             RPointerArray<CViewContact>& aMatchedContacts);
       
    62         TBool MatchesInitialFindTextL(const TDesC& aText);
       
    63         TBool MatchesInitialFindTextL(const CViewContact& aViewContact);
       
    64 
       
    65     private:  // Implementation       
       
    66 		CPbkChineseFindPrimitives();
       
    67         void ConstructL(MPbkContactNameFormat& aContactNameFormatter);
       
    68         const TDesC& ContactTitleL(const CViewContact& aViewContact);
       
    69         static TBool IsWordSeparator(TChar aCh);
       
    70         TBool IsMatchL(const TDesC& aTargetText, const TDesC& aFindText);
       
    71 
       
    72     private:  // Data
       
    73 		/// Own: find util
       
    74 		CFindUtil* iFindUtil;
       
    75 		/// Ref: contact name formatter
       
    76         CPbkViewContactNameFormatter* iViewContactNameFormatter;
       
    77 		/// Own: view sort order
       
    78         RContactViewSortOrder iContactViewSortOrder;
       
    79 		/// Own: initial find text
       
    80         HBufC* iInitialFindText;
       
    81     };
       
    82 
       
    83 #endif // __CPbkChineseFindPrimitives_H__
       
    84 
       
    85 // End of File