|
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: Utilities for contact management. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VPBKUTILS_H |
|
20 #define VPBKUTILS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32def.h> |
|
24 |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MVPbkFieldType; |
|
28 class MVPbkFieldTypeList; |
|
29 class MVPbkBaseContactField; |
|
30 class TResourceReader; |
|
31 class MVPbkBaseContact; |
|
32 class RFs; |
|
33 class MVPbkStoreContact; |
|
34 |
|
35 |
|
36 /** |
|
37 * Utilities for contact management. |
|
38 */ |
|
39 namespace VPbkUtils |
|
40 { |
|
41 |
|
42 /** |
|
43 * Returns the field type if aField matches one of the aFieldTypeList |
|
44 * elements otherwise returns NULL. |
|
45 * |
|
46 * @param aFieldTypeList The field type list to use. |
|
47 * @param aField The field whose type to match. |
|
48 * @return The matched field type. |
|
49 */ |
|
50 IMPORT_C const MVPbkFieldType* MatchFieldType( |
|
51 const MVPbkFieldTypeList& aFieldTypeList, |
|
52 const MVPbkBaseContactField& aField); |
|
53 |
|
54 /** |
|
55 * Checks if aField matches the required field type from aFieldTypeList |
|
56 * and the field type of aField matches to field type selector. |
|
57 * |
|
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 |
|
61 * VPbkFieldType.rh. |
|
62 * @return ETrue If field type is included. |
|
63 */ |
|
64 IMPORT_C TBool IsFieldTypeIncludedL( |
|
65 const MVPbkFieldTypeList& aFieldTypeList, |
|
66 const MVPbkBaseContactField& aField, |
|
67 TResourceReader& aResourceReader); |
|
68 |
|
69 /** |
|
70 * Checks whether the contact contains a field that matches |
|
71 * to given field type selector. |
|
72 * |
|
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 |
|
76 * VPbkFieldType.rh. |
|
77 * @return ETrue If field type is included. |
|
78 */ |
|
79 IMPORT_C TBool IsFieldTypeIncludedInContactL( |
|
80 const MVPbkFieldTypeList& aFieldTypeList, |
|
81 const MVPbkBaseContact& aContact, |
|
82 TResourceReader& aResourceReader); |
|
83 |
|
84 /** |
|
85 * Verifies the existance of the syncronization field. |
|
86 * |
|
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. |
|
91 * |
|
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. |
|
96 */ |
|
97 IMPORT_C TBool VerifySyncronizationFieldL( |
|
98 RFs& aFs, |
|
99 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
100 MVPbkStoreContact& aContact); |
|
101 |
|
102 |
|
103 } // namespace VPbkUtils |
|
104 |
|
105 #endif // VPBKUTILS_H |
|
106 |
|
107 //End of file |
|
108 |