epoc32/include/app/MVPbkContactOperationFactory.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/MVPbkContactOperationFactory.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,158 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-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:  Virtual Phonebook factory interface for asynchronous 
    1.18 +*                contact operations.
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +// 
    1.23 +
    1.24 +#ifndef MVPBKCONTACTOPERATIONFACTORY_H
    1.25 +#define MVPBKCONTACTOPERATIONFACTORY_H
    1.26 +
    1.27 +// INCLUDES
    1.28 +#include <e32cmn.h>
    1.29 +#include <bamdesca.h>
    1.30 +
    1.31 +// FORWARD DECLARATIONS
    1.32 +class MVPbkContactOperation;
    1.33 +class MVPbkContactLink;
    1.34 +class MVPbkContactLinkArray;
    1.35 +class MVPbkStoreContact;
    1.36 +class MVPbkSingleContactOperationObserver;
    1.37 +class MVPbkBatchOperationObserver;
    1.38 +class MVPbkContactFindObserver;
    1.39 +class MVPbkFieldTypeList;
    1.40 +class MVPbkContactFindFromStoresObserver;
    1.41 +
    1.42 +// CLASS DECLARATIONS
    1.43 +
    1.44 +/**
    1.45 + * A factory interface for asynchronous contact operations.
    1.46 + * This interface is used to create contact operations.
    1.47 + */
    1.48 +class MVPbkContactOperationFactory
    1.49 +    {
    1.50 +    public:  // Factories
    1.51 +        /**
    1.52 +         * Creates an operation for contact retrieval.
    1.53 +         *
    1.54 +         * @param aLink A link to the contact
    1.55 +         * @param aObserver An observer for the operation.
    1.56 +         * @return A handle to the operation or NULL if the factory
    1.57 +         *         doesn't have reference to the store of the link.
    1.58 +         */
    1.59 +        virtual MVPbkContactOperation* CreateContactRetrieverL(
    1.60 +                const MVPbkContactLink& aLink,
    1.61 +                MVPbkSingleContactOperationObserver& aObserver) =0;
    1.62 +
    1.63 +        /**
    1.64 +         * Creates an operation for deleting multiple contacts.
    1.65 +         *
    1.66 +         * @param aContactLinks An array of contact links that specify 
    1.67 +         *                      the contacts.
    1.68 +         * @param aObserver An observer for the operation.
    1.69 +         * @return A handle to the operation or NULL
    1.70 +         */
    1.71 +        virtual MVPbkContactOperation* CreateDeleteContactsOperationL(
    1.72 +                const MVPbkContactLinkArray& aContactLinks, 
    1.73 +                MVPbkBatchOperationObserver& aObserver ) =0;
    1.74 +
    1.75 +        /**
    1.76 +         * Creates an operation for committing multiple contacts.
    1.77 +         *
    1.78 +         * @param aContacts An array of contact links that specify
    1.79 +         *                  the contacts
    1.80 +         * @param aObserver An observer for the operation.
    1.81 +         * @return A handle to the operation or NULL
    1.82 +         */
    1.83 +        virtual MVPbkContactOperation* CreateCommitContactsOperationL(
    1.84 +                const TArray<MVPbkStoreContact*>& aContacts,
    1.85 +                MVPbkBatchOperationObserver& aObserver) =0;
    1.86 +
    1.87 +        /**
    1.88 +         * Creates an operation for asynchronous phone number matching.
    1.89 +         * 
    1.90 +         * @param aPhoneNumber  A phone number to search for.
    1.91 +         * @param aMaxMatchDigits   Maximum number of digits to match from 
    1.92 +         *                          the end of the number.
    1.93 +         * @param aObserver Observer for the find process.
    1.94 +         * @return A handle to the operation or NULL
    1.95 +         */
    1.96 +        virtual MVPbkContactOperation* CreateMatchPhoneNumberOperationL(
    1.97 +                const TDesC& aPhoneNumber, 
    1.98 +                TInt aMaxMatchDigits,
    1.99 +                MVPbkContactFindObserver& aObserver) =0;
   1.100 +
   1.101 +        /**
   1.102 +         * Creates an operation for asynchronous contact finding.
   1.103 +         *
   1.104 +         * @param aSearchString String to search for.
   1.105 +         * @param aFieldTypes   List of field types that the search will include.
   1.106 +         * @param aObserver Observer for the find process.
   1.107 +         * @return A handle to the operation or NULL
   1.108 +         */
   1.109 +        virtual MVPbkContactOperation* CreateFindOperationL(
   1.110 +                const TDesC& aSearchString,
   1.111 +                const MVPbkFieldTypeList& aFieldTypes,
   1.112 +                MVPbkContactFindObserver& aObserver) =0;
   1.113 +        
   1.114 +        /**
   1.115 +         * Creates an operation for asynchronous contact finding.
   1.116 +         * Finds a string containing text that is stored in one or more fields.
   1.117 +         * Client can give multiple find words. All the words must match to separated
   1.118 +         * data. E.g if there are two find words: "Jo" and "Jo" then field data
   1.119 +         * "John Johnson" matches but "John Doe" doesn't if the word parser uses
   1.120 +         * white space as a word separator.
   1.121 +         *
   1.122 +         * NOTE: The accuracy of the results depends on the ability of the store
   1.123 +         *       implementation to implement the find. The performance can vary
   1.124 +         *       too depending on the store. 
   1.125 +         *
   1.126 +         * @param aSearchStrings    Words that are compared to field data.
   1.127 +         * @param aFieldTypes   Types of the fields that are used.
   1.128 +         * @param aObserver An observer for asynchronous operation.
   1.129 +         * @param aWordParserCallBack a client implementation of word parser 
   1.130 +         *                            function that separates the field data 
   1.131 +         *                            into words. Parameter to function is 
   1.132 +         *                            TVPbkWordParserParam.
   1.133 +         * @return A handle to the operation or NULL
   1.134 +         */
   1.135 +        virtual MVPbkContactOperation* CreateFindOperationL(
   1.136 +                const MDesC16Array& aSearchStrings, 
   1.137 +                const MVPbkFieldTypeList& aFieldTypes, 
   1.138 +                MVPbkContactFindFromStoresObserver& aObserver, 
   1.139 +                const TCallBack& aWordParserCallBack ) =0;
   1.140 +            
   1.141 +        /**
   1.142 +         * Creates an operation for compressing the store.
   1.143 +         *
   1.144 +         * @param aObserver An observer for the compress operation.
   1.145 +         * @return A handle to the operation or NULL
   1.146 +         */
   1.147 +        virtual MVPbkContactOperation* CreateCompressStoresOperationL(
   1.148 +        		MVPbkBatchOperationObserver& aObserver) = 0;
   1.149 +
   1.150 +        /**
   1.151 +         * Returns an extension point for this interface or NULL.
   1.152 +         * @param aExtensionUid Uid of extension.
   1.153 +         * @return Extension point or NULL.
   1.154 +         */
   1.155 +        virtual TAny* ContactOperationFactoryExtension(
   1.156 +                TUid /*aExtensionUid*/) { return NULL; }
   1.157 +    };
   1.158 +
   1.159 +#endif // MVPBKCONTACTOPERATIONFACTORY_H
   1.160 +
   1.161 +// End of File