|
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 * MPbkFindPrimitives implementation for european Phonebook. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CPbkFindPrimitives_H__ |
|
21 #define __CPbkFindPrimitives_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <cntviewbase.h> |
|
25 #include <MPbkFindPrimitives.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MPbkContactNameFormat; |
|
29 class CViewContact; |
|
30 class MPbkFieldDataArray; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * MPbkFindPrimitives implementation for european Phonebook. |
|
37 */ |
|
38 NONSHARABLE_CLASS(CPbkFindPrimitives) : |
|
39 public CBase, |
|
40 public MPbkFindPrimitives |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 /** |
|
44 * Creates a new instance of this class. |
|
45 * @param aNameFormatter contact name formatter |
|
46 */ |
|
47 static CPbkFindPrimitives* NewL(MPbkContactNameFormat& aNameFormatter); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 ~CPbkFindPrimitives(); |
|
53 |
|
54 private: // 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 CPbkFindPrimitives(MPbkContactNameFormat& aNameFormatter); |
|
67 TBool IsMatchL(const MPbkFieldDataArray& aContactData, const TDesC& aFindText); |
|
68 TBool IsMatchL(const CViewContact& aViewContact, const TDesC& aFindText); |
|
69 static TBool IsWordSeparator(TChar aCh); |
|
70 void StoreInitialFindTextL(const TDesC& aInitialFindText); |
|
71 TPtrC InitialFindText() const; |
|
72 TBool DoMatchesInitialFindText(const TDesC& aText) const; |
|
73 |
|
74 private: // Data |
|
75 /// Ref: contact name formatter |
|
76 MPbkContactNameFormat& iNameFormatter; |
|
77 /// Own: view sort order |
|
78 RContactViewSortOrder iViewSortOrder; |
|
79 /// Own: find text |
|
80 HBufC* iFindText; |
|
81 /// Own: field text |
|
82 HBufC* iFieldText; |
|
83 /// Own: initial find text |
|
84 HBufC* iInitialFindText; |
|
85 }; |
|
86 |
|
87 #endif // __CPbkFindPrimitives_H__ |
|
88 |
|
89 // End of File |