|
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: VPbk store contact analyzer. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TVPBKStORECONTACTANALYZER_H |
|
20 #define TVPBKStORECONTACTANALYZER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32def.h> |
|
24 |
|
25 // VPbk includes |
|
26 #include <VPbkFieldTypeSelectorFactory.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CVPbkContactManager; |
|
30 class MVPbkStoreContact; |
|
31 class MVPbkContactFieldSelector; |
|
32 class MVPbkFieldTypeList; |
|
33 class MVPbkBaseContactFieldCollection; |
|
34 class MVPbkBaseContactField; |
|
35 class CVPbkFieldTypeSelector; |
|
36 class MVPbkFieldTypeSelector; |
|
37 class MVPbkFieldType; |
|
38 class TVPbkFieldTypeSelector; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * VPbk store contact analyzer. |
|
44 */ |
|
45 class TVPbkStoreContactAnalyzer |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Constructor. |
|
51 * |
|
52 * @param aContactManager Virtual Phonebook contact manager. |
|
53 * @param aContact Store contact. |
|
54 */ |
|
55 IMPORT_C TVPbkStoreContactAnalyzer( |
|
56 const CVPbkContactManager& aContactManager, |
|
57 const MVPbkStoreContact* aContact ); |
|
58 |
|
59 public: // Interface |
|
60 |
|
61 /** |
|
62 * Analyses if the contact has a field with type specified |
|
63 * in aFieldTypeSelector. |
|
64 * |
|
65 * @param aFieldTypeSelector Predefined field type selector. |
|
66 * @param aStartIndex Starts looking up the specified field from |
|
67 * this field index. |
|
68 * @param aContact The contact to analyze. If NULL the contact |
|
69 * got from the constructor is used. |
|
70 * @return Field index if contact has field specified in aResId, |
|
71 * otherwise KErrNotFound. |
|
72 */ |
|
73 IMPORT_C TInt HasFieldL( |
|
74 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector, |
|
75 TInt aStartIndex = 0, |
|
76 const MVPbkStoreContact* aContact = NULL ) const; |
|
77 |
|
78 /** |
|
79 * Analyses if the contact has a action type with type specified |
|
80 * in aActionTypeSelector. |
|
81 * |
|
82 * @param aActionTypeSelector Predefined contact action type selector. |
|
83 * @param aStartIndex Starts looking up the specified field from |
|
84 * this field index. |
|
85 * @param aContact The contact to analyze. If NULL the contact |
|
86 * got from the constructor is used. |
|
87 * @return Field index if contact has field specified in aResId, |
|
88 * otherwise KErrNotFound. |
|
89 */ |
|
90 IMPORT_C TInt HasFieldL( |
|
91 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector, |
|
92 TInt aStartIndex = 0, |
|
93 const MVPbkStoreContact* aContact = NULL ) const; |
|
94 |
|
95 /** |
|
96 * Analyses if the contact supports field with type specified |
|
97 * in aFieldTypeSelector. |
|
98 * |
|
99 * @param aFieldTypeSelector Predefined field type selector. |
|
100 * @param aContact The contact to analyze. If NULL the |
|
101 * contact got from constructor is used. |
|
102 * @return ETrue if the field type is supported by the contact, |
|
103 * otherwise EFalse. |
|
104 */ |
|
105 IMPORT_C TBool IsFieldTypeSupportedL( |
|
106 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector, |
|
107 const MVPbkStoreContact* aContact = NULL ) const; |
|
108 |
|
109 /** |
|
110 * Analyses if the contact supports action types with type specified |
|
111 * in aActionTypeSelector. |
|
112 * |
|
113 * @param aActionTypeSelector Predefined contact action type selector. |
|
114 * @param aContact The contact to analyze. If NULL the |
|
115 * contact got from constructor is used. |
|
116 * @return ETrue if the action type is supported by the contact, |
|
117 * otherwise EFalse. |
|
118 */ |
|
119 IMPORT_C TBool IsFieldTypeSupportedL( |
|
120 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector, |
|
121 const MVPbkStoreContact* aContact = NULL ) const; |
|
122 |
|
123 /** |
|
124 * Checks if the aFieldType is same as specified in aFieldTypeSelector. |
|
125 * Returns ETrue is same, otherwise EFalse. |
|
126 * |
|
127 * @param aFieldType The field type to check. |
|
128 * @param aFieldTypeSelector Predefined field type selector. |
|
129 * @return ETrue if the field type is included. |
|
130 */ |
|
131 IMPORT_C TBool IsFieldTypeIncludedL( |
|
132 const MVPbkFieldType& aFieldType, |
|
133 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector ) const; |
|
134 |
|
135 /** |
|
136 * Checks if the aFieldType is same as specified in aActionTypeSelector. |
|
137 * Returns ETrue is same, otherwise EFalse. |
|
138 * |
|
139 * @param aFieldType The field type to check. |
|
140 * @param aActionTypeSelector Predefined field type selector. |
|
141 * @return ETrue if the field type is included. |
|
142 */ |
|
143 IMPORT_C TBool IsFieldTypeIncludedL( |
|
144 const MVPbkFieldType& aFieldType, |
|
145 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector ) const; |
|
146 |
|
147 /** |
|
148 * Checks if the aField's field type is same as specified in |
|
149 * aFieldTypeSelector. Returns ETrue is same, otherwise EFalse. |
|
150 * |
|
151 * @param aField The field whose type to check. |
|
152 * @param aFieldTypeSelector Selector's resource id. |
|
153 * @return ETrue if the field type is included. |
|
154 */ |
|
155 IMPORT_C TBool IsFieldTypeIncludedL( |
|
156 const MVPbkBaseContactField& aField, |
|
157 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector ) const; |
|
158 |
|
159 /** |
|
160 * Checks if the aField's field type is same as specified in |
|
161 * aActionTypeSelector. Returns ETrue is same, otherwise EFalse. |
|
162 * |
|
163 * @param aField The field whose type to check. |
|
164 * @param aActionTypeSelector Selector's resource id. |
|
165 * @return ETrue if the field type is included. |
|
166 */ |
|
167 IMPORT_C TBool IsFieldTypeIncludedL( |
|
168 const MVPbkBaseContactField& aField, |
|
169 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector ) const; |
|
170 |
|
171 private: // Implementation |
|
172 TVPbkStoreContactAnalyzer(); |
|
173 |
|
174 private: // Data |
|
175 /// Ref: Virtual Phonebook contact manager |
|
176 const CVPbkContactManager& iContactManager; |
|
177 /// Ref: The contact to analyze |
|
178 const MVPbkStoreContact* iContact; |
|
179 }; |
|
180 |
|
181 #endif // TVPBKStORECONTACTANALYZER_H |
|
182 |
|
183 // End of File |