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: Utilities for contact management.
26 // FORWARD DECLARATIONS
28 class MVPbkFieldTypeList;
29 class MVPbkBaseContactField;
30 class TResourceReader;
31 class MVPbkBaseContact;
33 class MVPbkStoreContact;
37 * Utilities for contact management.
43 * Returns the field type if aField matches one of the aFieldTypeList
44 * elements otherwise returns NULL.
46 * @param aFieldTypeList The field type list to use.
47 * @param aField The field whose type to match.
48 * @return The matched field type.
50 IMPORT_C const MVPbkFieldType* MatchFieldType(
51 const MVPbkFieldTypeList& aFieldTypeList,
52 const MVPbkBaseContactField& aField);
55 * Checks if aField matches the required field type from aFieldTypeList
56 * and the field type of aField matches to field type selector.
58 * @param aFieldTypeList A field type list for matching aField.
59 * @param aField The field whose type to check.
60 * @param aResourceReader A reader to VPBK_FIELD_TYPE_SELECTOR in
62 * @return ETrue If field type is included.
64 IMPORT_C TBool IsFieldTypeIncludedL(
65 const MVPbkFieldTypeList& aFieldTypeList,
66 const MVPbkBaseContactField& aField,
67 TResourceReader& aResourceReader);
70 * Checks whether the contact contains a field that matches
71 * to given field type selector.
73 * @param aFieldTypeList A field type list for matching aField.
74 * @param aContact The contact whose fields are cheked.
75 * @param aResourceReader A reader to VPBK_FIELD_TYPE_SELECTOR in
77 * @return ETrue If field type is included.
79 IMPORT_C TBool IsFieldTypeIncludedInContactL(
80 const MVPbkFieldTypeList& aFieldTypeList,
81 const MVPbkBaseContact& aContact,
82 TResourceReader& aResourceReader);
85 * Verifies the existance of the syncronization field.
87 * The data for the fields are defined in VPbkSyncConstants.h.
88 * Adds the field with the default value if not present.
89 * If the syncronization field is empty assigns a default value.
90 * If field contains invalid data default value is assigned.
92 * @param aFs A handle to an open file handle.
93 * @param aSupportedFieldTypeList Field types supported by the store. See
94 * MVPbkContactStoreProperties::SupportedFields.
95 * @param aContact A contact whose syncronization field and content is verified.
97 IMPORT_C TBool VerifySyncronizationFieldL(
99 const MVPbkFieldTypeList& aSupportedFieldTypeList,
100 MVPbkStoreContact& aContact);
103 } // namespace VPbkUtils
105 #endif // VPBKUTILS_H