author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@4 | 1 |
/* |
williamr@4 | 2 |
* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). |
williamr@4 | 3 |
* All rights reserved. |
williamr@4 | 4 |
* This component and the accompanying materials are made available |
williamr@4 | 5 |
* under the terms of "Eclipse Public License v1.0" |
williamr@4 | 6 |
* which accompanies this distribution, and is available |
williamr@4 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@4 | 8 |
* |
williamr@4 | 9 |
* Initial Contributors: |
williamr@4 | 10 |
* Nokia Corporation - initial contribution. |
williamr@4 | 11 |
* |
williamr@4 | 12 |
* Contributors: |
williamr@4 | 13 |
* |
williamr@4 | 14 |
* Description: Utilities for contact management. |
williamr@4 | 15 |
* |
williamr@4 | 16 |
*/ |
williamr@4 | 17 |
|
williamr@4 | 18 |
|
williamr@4 | 19 |
#ifndef VPBKUTILS_H |
williamr@4 | 20 |
#define VPBKUTILS_H |
williamr@4 | 21 |
|
williamr@4 | 22 |
// INCLUDES |
williamr@4 | 23 |
#include <e32def.h> |
williamr@4 | 24 |
|
williamr@4 | 25 |
|
williamr@4 | 26 |
// FORWARD DECLARATIONS |
williamr@4 | 27 |
class MVPbkFieldType; |
williamr@4 | 28 |
class MVPbkFieldTypeList; |
williamr@4 | 29 |
class MVPbkBaseContactField; |
williamr@4 | 30 |
class TResourceReader; |
williamr@4 | 31 |
class MVPbkBaseContact; |
williamr@4 | 32 |
class RFs; |
williamr@4 | 33 |
class MVPbkStoreContact; |
williamr@4 | 34 |
|
williamr@4 | 35 |
|
williamr@4 | 36 |
/** |
williamr@4 | 37 |
* Utilities for contact management. |
williamr@4 | 38 |
*/ |
williamr@4 | 39 |
namespace VPbkUtils |
williamr@4 | 40 |
{ |
williamr@4 | 41 |
|
williamr@4 | 42 |
/** |
williamr@4 | 43 |
* Returns the field type if aField matches one of the aFieldTypeList |
williamr@4 | 44 |
* elements otherwise returns NULL. |
williamr@4 | 45 |
* |
williamr@4 | 46 |
* @param aFieldTypeList The field type list to use. |
williamr@4 | 47 |
* @param aField The field whose type to match. |
williamr@4 | 48 |
* @return The matched field type. |
williamr@4 | 49 |
*/ |
williamr@4 | 50 |
IMPORT_C const MVPbkFieldType* MatchFieldType( |
williamr@4 | 51 |
const MVPbkFieldTypeList& aFieldTypeList, |
williamr@4 | 52 |
const MVPbkBaseContactField& aField); |
williamr@4 | 53 |
|
williamr@4 | 54 |
/** |
williamr@4 | 55 |
* Checks if aField matches the required field type from aFieldTypeList |
williamr@4 | 56 |
* and the field type of aField matches to field type selector. |
williamr@4 | 57 |
* |
williamr@4 | 58 |
* @param aFieldTypeList A field type list for matching aField. |
williamr@4 | 59 |
* @param aField The field whose type to check. |
williamr@4 | 60 |
* @param aResourceReader A reader to VPBK_FIELD_TYPE_SELECTOR in |
williamr@4 | 61 |
* VPbkFieldType.rh. |
williamr@4 | 62 |
* @return ETrue If field type is included. |
williamr@4 | 63 |
*/ |
williamr@4 | 64 |
IMPORT_C TBool IsFieldTypeIncludedL( |
williamr@4 | 65 |
const MVPbkFieldTypeList& aFieldTypeList, |
williamr@4 | 66 |
const MVPbkBaseContactField& aField, |
williamr@4 | 67 |
TResourceReader& aResourceReader); |
williamr@4 | 68 |
|
williamr@4 | 69 |
/** |
williamr@4 | 70 |
* Checks whether the contact contains a field that matches |
williamr@4 | 71 |
* to given field type selector. |
williamr@4 | 72 |
* |
williamr@4 | 73 |
* @param aFieldTypeList A field type list for matching aField. |
williamr@4 | 74 |
* @param aContact The contact whose fields are cheked. |
williamr@4 | 75 |
* @param aResourceReader A reader to VPBK_FIELD_TYPE_SELECTOR in |
williamr@4 | 76 |
* VPbkFieldType.rh. |
williamr@4 | 77 |
* @return ETrue If field type is included. |
williamr@4 | 78 |
*/ |
williamr@4 | 79 |
IMPORT_C TBool IsFieldTypeIncludedInContactL( |
williamr@4 | 80 |
const MVPbkFieldTypeList& aFieldTypeList, |
williamr@4 | 81 |
const MVPbkBaseContact& aContact, |
williamr@4 | 82 |
TResourceReader& aResourceReader); |
williamr@4 | 83 |
|
williamr@4 | 84 |
/** |
williamr@4 | 85 |
* Verifies the existance of the syncronization field. |
williamr@4 | 86 |
* |
williamr@4 | 87 |
* The data for the fields are defined in VPbkSyncConstants.h. |
williamr@4 | 88 |
* Adds the field with the default value if not present. |
williamr@4 | 89 |
* If the syncronization field is empty assigns a default value. |
williamr@4 | 90 |
* If field contains invalid data default value is assigned. |
williamr@4 | 91 |
* |
williamr@4 | 92 |
* @param aFs A handle to an open file handle. |
williamr@4 | 93 |
* @param aSupportedFieldTypeList Field types supported by the store. See |
williamr@4 | 94 |
* MVPbkContactStoreProperties::SupportedFields. |
williamr@4 | 95 |
* @param aContact A contact whose syncronization field and content is verified. |
williamr@4 | 96 |
*/ |
williamr@4 | 97 |
IMPORT_C TBool VerifySyncronizationFieldL( |
williamr@4 | 98 |
RFs& aFs, |
williamr@4 | 99 |
const MVPbkFieldTypeList& aSupportedFieldTypeList, |
williamr@4 | 100 |
MVPbkStoreContact& aContact); |
williamr@4 | 101 |
|
williamr@4 | 102 |
|
williamr@4 | 103 |
} // namespace VPbkUtils |
williamr@4 | 104 |
|
williamr@4 | 105 |
#endif // VPBKUTILS_H |
williamr@4 | 106 |
|
williamr@4 | 107 |
//End of file |
williamr@4 | 108 |