|
1 /* |
|
2 * Copyright (c) 2007-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 field selector. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2FIELDSELECTOR_H |
|
20 #define CPBK2FIELDSELECTOR_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <MVPbkContactFieldSelector.h> |
|
24 #include <CVPbkFieldTypeSelector.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MVPbkBaseContactField; |
|
28 class MVPbkFieldTypeList; |
|
29 |
|
30 // CLASS DECLARTIONS |
|
31 |
|
32 /** |
|
33 * Class for managing multiple selectors. Selectors can be included or |
|
34 * excluded. |
|
35 */ |
|
36 NONSHARABLE_CLASS( CPbk2FieldSelector ) |
|
37 : public CBase, public MVPbkContactFieldSelector |
|
38 { |
|
39 public: // C'tor and d'tor |
|
40 /** |
|
41 * Creates instance of this class. |
|
42 * New instance is left to the CleanupStack. |
|
43 */ |
|
44 static CPbk2FieldSelector* NewLC(); |
|
45 |
|
46 /** |
|
47 * Destructor |
|
48 */ |
|
49 ~CPbk2FieldSelector(); |
|
50 |
|
51 public: // Interface |
|
52 /** |
|
53 * Adds new field type selector to this field selector. |
|
54 * These fields are included to this selector. |
|
55 * @param aIncludedSelector A selector to be included to this selector. |
|
56 */ |
|
57 void AddIncludedSelector( |
|
58 CVPbkFieldTypeSelector* aIncludedSelector ); |
|
59 |
|
60 /** |
|
61 * Adds new field type selector to this field selector. |
|
62 * These fields are excluded from this selector. |
|
63 * @param aIncludedSelector |
|
64 * A selector to be excluded from this selector. |
|
65 */ |
|
66 void AddExcludedSelector( |
|
67 CVPbkFieldTypeSelector* aExcludedSelector ); |
|
68 |
|
69 public: // From MVPbkContactFieldSelector |
|
70 TBool IsFieldIncluded( |
|
71 const MVPbkBaseContactField& aField) const; |
|
72 |
|
73 private: // Implementation |
|
74 CPbk2FieldSelector(); |
|
75 TBool IsIncluded( |
|
76 TArray<CVPbkFieldTypeSelector*> aArray, |
|
77 const MVPbkBaseContactField& aField ) const; |
|
78 |
|
79 private: // Data |
|
80 // Own: array of selectors to be included to this |
|
81 RPointerArray<CVPbkFieldTypeSelector> iIncludedSelectorArray; |
|
82 // Own: array of selectors to be excluded from this |
|
83 RPointerArray<CVPbkFieldTypeSelector> iExcludedSelectorArray; |
|
84 }; |
|
85 |
|
86 #endif // CPBK2FIELDSELECTOR_H |
|
87 |
|
88 // End of file |