epoc32/include/app/VPbkUtils.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/VPbkUtils.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,108 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Utilities for contact management.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef VPBKUTILS_H
    1.23 +#define VPBKUTILS_H
    1.24 +
    1.25 +// INCLUDES
    1.26 +#include <e32def.h>
    1.27 +
    1.28 +
    1.29 +// FORWARD DECLARATIONS
    1.30 +class MVPbkFieldType;
    1.31 +class MVPbkFieldTypeList;
    1.32 +class MVPbkBaseContactField;
    1.33 +class TResourceReader;
    1.34 +class MVPbkBaseContact;
    1.35 +class RFs;
    1.36 +class MVPbkStoreContact;
    1.37 +
    1.38 +
    1.39 +/**
    1.40 + * Utilities for contact management.
    1.41 + */
    1.42 +namespace VPbkUtils
    1.43 +{
    1.44 +
    1.45 +/**
    1.46 + * Returns the field type if aField matches one of the aFieldTypeList
    1.47 + * elements otherwise returns NULL.
    1.48 + *
    1.49 + * @param aFieldTypeList The field type list to use.
    1.50 + * @param aField The field whose type to match.
    1.51 + * @return The matched field type.
    1.52 + */
    1.53 +IMPORT_C const MVPbkFieldType* MatchFieldType(
    1.54 +    const MVPbkFieldTypeList& aFieldTypeList,
    1.55 +    const MVPbkBaseContactField& aField);
    1.56 +    
    1.57 +/**
    1.58 + * Checks if aField matches the required field type from aFieldTypeList
    1.59 + * and the field type of aField matches to field type selector.
    1.60 + *
    1.61 + * @param aFieldTypeList A field type list for matching aField.
    1.62 + * @param aField The field whose type to check.
    1.63 + * @param aResourceReader A reader to VPBK_FIELD_TYPE_SELECTOR in
    1.64 + *                        VPbkFieldType.rh.
    1.65 + * @return ETrue If field type is included.
    1.66 + */
    1.67 +IMPORT_C TBool IsFieldTypeIncludedL(
    1.68 +    const MVPbkFieldTypeList& aFieldTypeList,
    1.69 +    const MVPbkBaseContactField& aField,
    1.70 +    TResourceReader& aResourceReader);
    1.71 +
    1.72 +/**
    1.73 + * Checks whether the contact contains a field that matches
    1.74 + * to given field type selector.
    1.75 + *
    1.76 + * @param aFieldTypeList A field type list for matching aField.
    1.77 + * @param aContact The contact whose fields are cheked.
    1.78 + * @param aResourceReader A reader to VPBK_FIELD_TYPE_SELECTOR in
    1.79 + *                        VPbkFieldType.rh.
    1.80 + * @return ETrue If field type is included.
    1.81 + */
    1.82 +IMPORT_C TBool IsFieldTypeIncludedInContactL(
    1.83 +    const MVPbkFieldTypeList& aFieldTypeList,
    1.84 +    const MVPbkBaseContact& aContact,
    1.85 +    TResourceReader& aResourceReader);
    1.86 +
    1.87 +/**
    1.88 + * Verifies the existance of the syncronization field.
    1.89 + *
    1.90 + * The data for the fields are defined in VPbkSyncConstants.h.
    1.91 + * Adds the field with the default value if not present.
    1.92 + * If the syncronization field is empty assigns a default value.
    1.93 + * If field contains invalid data default value is assigned.
    1.94 + *
    1.95 + * @param aFs A handle to an open file handle.
    1.96 + * @param aSupportedFieldTypeList Field types supported by the store. See
    1.97 + *                                MVPbkContactStoreProperties::SupportedFields.
    1.98 + * @param aContact A contact whose syncronization field and content is verified.
    1.99 + */
   1.100 +IMPORT_C TBool VerifySyncronizationFieldL(
   1.101 +        RFs& aFs,
   1.102 +        const MVPbkFieldTypeList& aSupportedFieldTypeList,
   1.103 +        MVPbkStoreContact& aContact);
   1.104 +
   1.105 +
   1.106 +} // namespace VPbkUtils
   1.107 +
   1.108 +#endif // VPBKUTILS_H
   1.109 +
   1.110 +//End of file
   1.111 +