|
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 * Concrete Phonebook contact name formatting interface for |
|
16 * APAC region variant. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __CPBKCHINACONTACTNAMEFORMATTER_H__ |
|
22 #define __CPBKCHINACONTACTNAMEFORMATTER_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include "CPbkContactNameFormatterBase.h" |
|
26 #include "TPbkTitleFieldFilter.h" |
|
27 #include <cntviewbase.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /// Maximum of 2 fields (last name + first name) are used to format a title |
|
35 const TInt KApacMaxTitleFields = 2; |
|
36 |
|
37 /** |
|
38 * Phonebook contact name formatting implementation class. This class |
|
39 * encapsulates contact name formatting rules in Series60 Phonebook |
|
40 * application. |
|
41 */ |
|
42 NONSHARABLE_CLASS(CPbkChinaContactNameFormatter) : |
|
43 public CPbkContactNameFormatterBase |
|
44 { |
|
45 public: // constructor and destructor |
|
46 /** |
|
47 * Constructor. |
|
48 * |
|
49 * @param aUnnamedText text to use for unnamed contacts. |
|
50 */ |
|
51 static CPbkChinaContactNameFormatter* NewL |
|
52 (const TDesC& aUnnamedText, const RContactViewSortOrder& aSortOrder); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CPbkChinaContactNameFormatter(); |
|
58 |
|
59 public: // from MPbkContactNameFormat |
|
60 void GetContactTitle |
|
61 (const MPbkFieldDataArray& aContactData, TDes& aTitle) const; |
|
62 const MPbkFieldDataArray& FilterContactTitleFields |
|
63 (const MPbkFieldDataArray& aContactData) const; |
|
64 void GetContactListTitle |
|
65 (const MPbkFieldDataArray& aContactData, TDes& aTitle) const; |
|
66 const MPbkFieldDataArray& FilterContactFieldsForFind |
|
67 (const MPbkFieldDataArray& aContactData) const; |
|
68 |
|
69 private: // from CPbkContactNameFormatterBase |
|
70 TBool RequiresSpaceBetweenNames(const TDesC& aLastName, const TDesC& aFirstName) const; |
|
71 |
|
72 private: // implementation |
|
73 CPbkChinaContactNameFormatter(); |
|
74 void ConstructL(const TDesC& aUnnamedText, const RContactViewSortOrder& aSortOrder); |
|
75 void DoGetContactTitle |
|
76 (const MPbkFieldDataArray& aContactData, TDes& aTitle) const; |
|
77 |
|
78 |
|
79 private: // data members |
|
80 typedef TPbkTitleFieldFilter<KApacMaxTitleFields> TTitleFieldFilter; |
|
81 /// Own: title field filter |
|
82 TTitleFieldFilter* iTitleFieldFilter; |
|
83 /// Ref: views contact sort order |
|
84 RContactViewSortOrder iSortOrder; |
|
85 |
|
86 }; |
|
87 |
|
88 |
|
89 #endif // __CPBKCHINACONTACTNAMEFORMATTER_H__ |
|
90 |
|
91 // End of File |