2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: VPbk store contact analyzer.
19 #ifndef TVPBKStORECONTACTANALYZER_H
20 #define TVPBKStORECONTACTANALYZER_H
26 #include <VPbkFieldTypeSelectorFactory.h>
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;
38 class TVPbkFieldTypeSelector;
43 * VPbk store contact analyzer.
45 class TVPbkStoreContactAnalyzer
47 public: // Constructors and destructor
52 * @param aContactManager Virtual Phonebook contact manager.
53 * @param aContact Store contact.
55 IMPORT_C TVPbkStoreContactAnalyzer(
56 const CVPbkContactManager& aContactManager,
57 const MVPbkStoreContact* aContact );
62 * Analyses if the contact has a field with type specified
63 * in aFieldTypeSelector.
65 * @param aFieldTypeSelector Predefined field type selector.
66 * @param aStartIndex Starts looking up the specified field from
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.
73 IMPORT_C TInt HasFieldL(
74 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector,
76 const MVPbkStoreContact* aContact = NULL ) const;
79 * Analyses if the contact has a action type with type specified
80 * in aActionTypeSelector.
82 * @param aActionTypeSelector Predefined contact action type selector.
83 * @param aStartIndex Starts looking up the specified field from
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.
90 IMPORT_C TInt HasFieldL(
91 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector,
93 const MVPbkStoreContact* aContact = NULL ) const;
96 * Analyses if the contact supports field with type specified
97 * in aFieldTypeSelector.
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,
105 IMPORT_C TBool IsFieldTypeSupportedL(
106 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector,
107 const MVPbkStoreContact* aContact = NULL ) const;
110 * Analyses if the contact supports action types with type specified
111 * in aActionTypeSelector.
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,
119 IMPORT_C TBool IsFieldTypeSupportedL(
120 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector,
121 const MVPbkStoreContact* aContact = NULL ) const;
124 * Checks if the aFieldType is same as specified in aFieldTypeSelector.
125 * Returns ETrue is same, otherwise EFalse.
127 * @param aFieldType The field type to check.
128 * @param aFieldTypeSelector Predefined field type selector.
129 * @return ETrue if the field type is included.
131 IMPORT_C TBool IsFieldTypeIncludedL(
132 const MVPbkFieldType& aFieldType,
133 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector ) const;
136 * Checks if the aFieldType is same as specified in aActionTypeSelector.
137 * Returns ETrue is same, otherwise EFalse.
139 * @param aFieldType The field type to check.
140 * @param aActionTypeSelector Predefined field type selector.
141 * @return ETrue if the field type is included.
143 IMPORT_C TBool IsFieldTypeIncludedL(
144 const MVPbkFieldType& aFieldType,
145 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector ) const;
148 * Checks if the aField's field type is same as specified in
149 * aFieldTypeSelector. Returns ETrue is same, otherwise EFalse.
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.
155 IMPORT_C TBool IsFieldTypeIncludedL(
156 const MVPbkBaseContactField& aField,
157 VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector ) const;
160 * Checks if the aField's field type is same as specified in
161 * aActionTypeSelector. Returns ETrue is same, otherwise EFalse.
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.
167 IMPORT_C TBool IsFieldTypeIncludedL(
168 const MVPbkBaseContactField& aField,
169 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector ) const;
171 private: // Implementation
172 TVPbkStoreContactAnalyzer();
175 /// Ref: Virtual Phonebook contact manager
176 const CVPbkContactManager& iContactManager;
177 /// Ref: The contact to analyze
178 const MVPbkStoreContact* iContact;
181 #endif // TVPBKStORECONTACTANALYZER_H