|
1 /* |
|
2 * Copyright (c) 2005-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: Phonebook 2 contact view builder. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2CONTACTVIEWBUILDER_H |
|
20 #define CPBK2CONTACTVIEWBUILDER_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 #include <Pbk2ContactView.hrh> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CVPbkContactManager; |
|
28 class CVPbkContactViewDefinition; |
|
29 class MVPbkContactViewBase; |
|
30 class CPbk2StorePropertyArray; |
|
31 class CVPbkContactStoreUriArray; |
|
32 class MVPbkContactViewObserver; |
|
33 class MVPbkFieldTypeList; |
|
34 class CVPbkFieldTypeSelector; |
|
35 class MVPbkContactSelector; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Phonebook 2 contact view builder. |
|
41 */ |
|
42 class CPbk2ContactViewBuilder : public CBase |
|
43 { |
|
44 public: // Construction and destruction |
|
45 |
|
46 /** |
|
47 * Creates a new instance of this class. |
|
48 * |
|
49 * @param aContactManager Virtual Phonebook contact manager. |
|
50 * @param aStoreProperties Store property array. |
|
51 * @return A new instance of this class. |
|
52 */ |
|
53 IMPORT_C static CPbk2ContactViewBuilder* NewLC( |
|
54 CVPbkContactManager& aContactManager, |
|
55 CPbk2StorePropertyArray& aStoreProperties ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CPbk2ContactViewBuilder(); |
|
61 |
|
62 public: // Interface |
|
63 |
|
64 /** |
|
65 * Creates a contact view for the stores specified in the |
|
66 * given array. |
|
67 * |
|
68 * @param aUriArray Array of URIs of stores to include |
|
69 * in the view. |
|
70 * @param aObserver Observer for the view. |
|
71 * @param aSortOrder Sort order for the view. |
|
72 * @param aFilter Field type selector used to filter the view. |
|
73 * @param aFlags TVPbkContactViewFlag flags for view modifying |
|
74 * @return The contact view. |
|
75 */ |
|
76 IMPORT_C MVPbkContactViewBase* CreateContactViewForStoresLC( |
|
77 const CVPbkContactStoreUriArray& aUriArray, |
|
78 MVPbkContactViewObserver& aObserver, |
|
79 const MVPbkFieldTypeList& aSortOrder, |
|
80 CVPbkFieldTypeSelector* aFilter, |
|
81 TUint32 aFlags ) const; |
|
82 |
|
83 /** |
|
84 * Creates a TOP-NON-TOP contact view for the stores specified in the |
|
85 * given array. |
|
86 * |
|
87 * @param aUriArray Array of URIs of stores to include |
|
88 * in the view. |
|
89 * @param aObserver Observer for the view. |
|
90 * @param aSortOrder Sort order for the view. |
|
91 * @param aFilter Field type selector used to filter the view. |
|
92 * @param aContactSelector A contact selector. |
|
93 * @return The contact view. |
|
94 */ |
|
95 IMPORT_C MVPbkContactViewBase* CreateTopNonTopContactViewForStoresLC( |
|
96 const CVPbkContactStoreUriArray& aUriArray, |
|
97 MVPbkContactViewObserver& aObserver, |
|
98 const MVPbkFieldTypeList& aSortOrder, |
|
99 CVPbkFieldTypeSelector* aFilter, |
|
100 TUint32 aFlags, |
|
101 MVPbkContactSelector& aContactSelector ) const; |
|
102 |
|
103 /** |
|
104 * Creates a group view for the stores specified in the |
|
105 * given array. |
|
106 * |
|
107 * @param aUriArray Array of URIs of stores to include |
|
108 * in the view. |
|
109 * @param aObserver Observer for the view. |
|
110 * @param aSortOrder Sort order for the view. |
|
111 * @param aFilter Field type selector used to filter the view. |
|
112 * @param aFlags TVPbkContactViewFlag flags for view modifying |
|
113 * @return The contact view. |
|
114 */ |
|
115 IMPORT_C MVPbkContactViewBase* CreateGroupViewForStoresLC( |
|
116 const CVPbkContactStoreUriArray& aUriArray, |
|
117 MVPbkContactViewObserver& aObserver, |
|
118 const MVPbkFieldTypeList& aSortOrder, |
|
119 CVPbkFieldTypeSelector* aFilter, |
|
120 TUint32 aFlags ) const; |
|
121 |
|
122 private: // Implementation |
|
123 CPbk2ContactViewBuilder( |
|
124 CVPbkContactManager& aContactManager, |
|
125 CPbk2StorePropertyArray& aStoreProperties ); |
|
126 CVPbkContactViewDefinition* BuildMainViewStructureLC( |
|
127 CVPbkFieldTypeSelector* aFilter, |
|
128 TUint32 aFlags ) const; |
|
129 MVPbkContactViewBase* CreateViewForStoresLC( |
|
130 TPbk2ContactViewType aViewType, |
|
131 const CVPbkContactStoreUriArray& aUriArray, |
|
132 MVPbkContactViewObserver& aObserver, |
|
133 const MVPbkFieldTypeList& aSortOrder, |
|
134 CVPbkFieldTypeSelector* aFilter, |
|
135 TUint32 aFlags, |
|
136 TBool aTopContacts = EFalse ) const; |
|
137 static TBool IncludeThisViewInTopContactMode( |
|
138 TPbk2ContactViewType aViewType ); |
|
139 void SetTopRelatedFilteringL( |
|
140 CVPbkContactViewDefinition& aNewSubViewDef, |
|
141 TPbk2ContactViewType aViewType, |
|
142 CVPbkFieldTypeSelector* aFilter ) const; |
|
143 |
|
144 private: // Data |
|
145 /// Ref: Virtual Phonebook contact manager |
|
146 CVPbkContactManager& iContactManager; |
|
147 /// Ref: Store property array |
|
148 CPbk2StorePropertyArray& iStoreProperties; |
|
149 mutable MVPbkContactSelector* iContactSelector; // Does not own |
|
150 }; |
|
151 |
|
152 #endif // CPBK2CONTACTVIEWBUILDER_H |
|
153 |
|
154 // End of File |