epoc32/include/app/TVPbkStoreContactAnalyzer.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/TVPbkStoreContactAnalyzer.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,183 @@
     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:  VPbk store contact analyzer.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef TVPBKStORECONTACTANALYZER_H
    1.23 +#define TVPBKStORECONTACTANALYZER_H
    1.24 +
    1.25 +//  INCLUDES
    1.26 +#include <e32def.h>
    1.27 +
    1.28 +//  VPbk includes
    1.29 +#include <VPbkFieldTypeSelectorFactory.h>
    1.30 +
    1.31 +// FORWARD DECLARATIONS
    1.32 +class CVPbkContactManager;
    1.33 +class MVPbkStoreContact;
    1.34 +class MVPbkContactFieldSelector;
    1.35 +class MVPbkFieldTypeList;
    1.36 +class MVPbkBaseContactFieldCollection;
    1.37 +class MVPbkBaseContactField;
    1.38 +class CVPbkFieldTypeSelector;
    1.39 +class MVPbkFieldTypeSelector;
    1.40 +class MVPbkFieldType;
    1.41 +class TVPbkFieldTypeSelector;
    1.42 +
    1.43 +// CLASS DECLARATION
    1.44 +
    1.45 +/**
    1.46 + * VPbk store contact analyzer.
    1.47 + */
    1.48 +class TVPbkStoreContactAnalyzer
    1.49 +    {
    1.50 +    public: // Constructors and destructor
    1.51 +
    1.52 +        /**
    1.53 +         * Constructor.
    1.54 +         *
    1.55 +         * @param aContactManager   Virtual Phonebook contact manager.
    1.56 +         * @param aContact          Store contact.
    1.57 +         */
    1.58 +        IMPORT_C TVPbkStoreContactAnalyzer(
    1.59 +                const CVPbkContactManager& aContactManager,
    1.60 +                const MVPbkStoreContact* aContact );
    1.61 +
    1.62 +    public: // Interface
    1.63 +
    1.64 +        /**
    1.65 +         * Analyses if the contact has a field with type specified
    1.66 +         * in aFieldTypeSelector.
    1.67 +         *
    1.68 +         * @param aFieldTypeSelector    Predefined field type selector.
    1.69 +         * @param aStartIndex   Starts looking up the specified field from
    1.70 +         *                      this field index.
    1.71 +         * @param aContact      The contact to analyze. If NULL the contact
    1.72 +         *                      got from the constructor is used.
    1.73 +         * @return  Field index if contact has field specified in aResId,
    1.74 +         *          otherwise KErrNotFound.
    1.75 +         */
    1.76 +        IMPORT_C TInt HasFieldL(
    1.77 +                VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector,
    1.78 +                TInt aStartIndex = 0,
    1.79 +                const MVPbkStoreContact* aContact = NULL ) const;
    1.80 +        
    1.81 +        /**
    1.82 +         * Analyses if the contact has a action type with type specified
    1.83 +         * in aActionTypeSelector.
    1.84 +         *
    1.85 +         * @param aActionTypeSelector   Predefined contact action type selector.
    1.86 +         * @param aStartIndex   Starts looking up the specified field from
    1.87 +         *                      this field index.
    1.88 +         * @param aContact      The contact to analyze. If NULL the contact
    1.89 +         *                      got from the constructor is used.
    1.90 +         * @return  Field index if contact has field specified in aResId,
    1.91 +         *          otherwise KErrNotFound.
    1.92 +         */
    1.93 +        IMPORT_C TInt HasFieldL(
    1.94 +                VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector,
    1.95 +                TInt aStartIndex = 0,
    1.96 +                const MVPbkStoreContact* aContact = NULL ) const;
    1.97 +
    1.98 +        /**
    1.99 +         * Analyses if the contact supports field with type specified
   1.100 +         * in aFieldTypeSelector.
   1.101 +         *
   1.102 +         * @param aFieldTypeSelector    Predefined field type selector.
   1.103 +         * @param aContact      The contact to analyze. If NULL the
   1.104 +         *                      contact got from constructor is used.
   1.105 +         * @return  ETrue if the field type is supported by the contact,
   1.106 +         *          otherwise EFalse.
   1.107 +         */
   1.108 +        IMPORT_C TBool IsFieldTypeSupportedL(
   1.109 +                VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector,
   1.110 +                const MVPbkStoreContact* aContact = NULL ) const;
   1.111 +
   1.112 +        /**
   1.113 +         * Analyses if the contact supports action types with type specified
   1.114 +         * in aActionTypeSelector.
   1.115 +         *
   1.116 +         * @param aActionTypeSelector    Predefined contact action type selector.
   1.117 +         * @param aContact      The contact to analyze. If NULL the
   1.118 +         *                      contact got from constructor is used.
   1.119 +         * @return  ETrue if the action type is supported by the contact,
   1.120 +         *          otherwise EFalse.
   1.121 +         */
   1.122 +        IMPORT_C TBool IsFieldTypeSupportedL(
   1.123 +                VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector,
   1.124 +                const MVPbkStoreContact* aContact = NULL ) const;
   1.125 +
   1.126 +        /**
   1.127 +         * Checks if the aFieldType is same as specified in aFieldTypeSelector.
   1.128 +         * Returns ETrue is same, otherwise EFalse.
   1.129 +         *
   1.130 +         * @param aFieldType   The field type to check.
   1.131 +         * @param aFieldTypeSelector   Predefined field type selector.
   1.132 +         * @return  ETrue if the field type is included.
   1.133 +         */
   1.134 +        IMPORT_C TBool IsFieldTypeIncludedL(
   1.135 +                const MVPbkFieldType& aFieldType,
   1.136 +                VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector ) const;
   1.137 +
   1.138 +        /**
   1.139 +         * Checks if the aFieldType is same as specified in aActionTypeSelector.
   1.140 +         * Returns ETrue is same, otherwise EFalse.
   1.141 +         *
   1.142 +         * @param aFieldType   The field type to check.
   1.143 +         * @param aActionTypeSelector   Predefined field type selector.
   1.144 +         * @return  ETrue if the field type is included.
   1.145 +         */
   1.146 +        IMPORT_C TBool IsFieldTypeIncludedL(
   1.147 +                const MVPbkFieldType& aFieldType,
   1.148 +                VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector ) const;
   1.149 +
   1.150 +        /**
   1.151 +         * Checks if the aField's field type is same as specified in
   1.152 +         * aFieldTypeSelector. Returns ETrue is same, otherwise EFalse.
   1.153 +         *
   1.154 +         * @param aField       The field whose type to check.
   1.155 +         * @param aFieldTypeSelector       Selector's resource id.
   1.156 +         * @return  ETrue if the field type is included.
   1.157 +         */
   1.158 +        IMPORT_C TBool IsFieldTypeIncludedL(
   1.159 +                const MVPbkBaseContactField& aField,
   1.160 +                VPbkFieldTypeSelectorFactory::TVPbkFieldTypeSelector aFieldTypeSelector ) const;
   1.161 +
   1.162 +        /**
   1.163 +         * Checks if the aField's field type is same as specified in
   1.164 +         * aActionTypeSelector. Returns ETrue is same, otherwise EFalse.
   1.165 +         *
   1.166 +         * @param aField       The field whose type to check.
   1.167 +         * @param aActionTypeSelector       Selector's resource id.
   1.168 +         * @return  ETrue if the field type is included.
   1.169 +         */
   1.170 +        IMPORT_C TBool IsFieldTypeIncludedL(
   1.171 +                const MVPbkBaseContactField& aField,
   1.172 +                VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionTypeSelector ) const;
   1.173 +
   1.174 +    private: // Implementation
   1.175 +        TVPbkStoreContactAnalyzer();
   1.176 +
   1.177 +    private: // Data
   1.178 +        /// Ref: Virtual Phonebook contact manager
   1.179 +        const CVPbkContactManager& iContactManager;
   1.180 +        /// Ref: The contact to analyze
   1.181 +        const MVPbkStoreContact* iContact;
   1.182 +    };
   1.183 +
   1.184 +#endif // TVPBKStORECONTACTANALYZER_H
   1.185 +
   1.186 +// End of File