williamr@4: /* williamr@4: * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributors: williamr@4: * Nokia Corporation - initial contribution. williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: Virtual Phonebook factory interface for asynchronous williamr@4: * contact operations. williamr@4: * williamr@4: */ williamr@4: williamr@4: // williamr@4: williamr@4: #ifndef MVPBKCONTACTOPERATIONFACTORY_H williamr@4: #define MVPBKCONTACTOPERATIONFACTORY_H williamr@4: williamr@4: // INCLUDES williamr@4: #include williamr@4: #include williamr@4: williamr@4: // FORWARD DECLARATIONS williamr@4: class MVPbkContactOperation; williamr@4: class MVPbkContactLink; williamr@4: class MVPbkContactLinkArray; williamr@4: class MVPbkStoreContact; williamr@4: class MVPbkSingleContactOperationObserver; williamr@4: class MVPbkBatchOperationObserver; williamr@4: class MVPbkContactFindObserver; williamr@4: class MVPbkFieldTypeList; williamr@4: class MVPbkContactFindFromStoresObserver; williamr@4: williamr@4: // CLASS DECLARATIONS williamr@4: williamr@4: /** williamr@4: * A factory interface for asynchronous contact operations. williamr@4: * This interface is used to create contact operations. williamr@4: */ williamr@4: class MVPbkContactOperationFactory williamr@4: { williamr@4: public: // Factories williamr@4: /** williamr@4: * Creates an operation for contact retrieval. williamr@4: * williamr@4: * @param aLink A link to the contact williamr@4: * @param aObserver An observer for the operation. williamr@4: * @return A handle to the operation or NULL if the factory williamr@4: * doesn't have reference to the store of the link. williamr@4: */ williamr@4: virtual MVPbkContactOperation* CreateContactRetrieverL( williamr@4: const MVPbkContactLink& aLink, williamr@4: MVPbkSingleContactOperationObserver& aObserver) =0; williamr@4: williamr@4: /** williamr@4: * Creates an operation for deleting multiple contacts. williamr@4: * williamr@4: * @param aContactLinks An array of contact links that specify williamr@4: * the contacts. williamr@4: * @param aObserver An observer for the operation. williamr@4: * @return A handle to the operation or NULL williamr@4: */ williamr@4: virtual MVPbkContactOperation* CreateDeleteContactsOperationL( williamr@4: const MVPbkContactLinkArray& aContactLinks, williamr@4: MVPbkBatchOperationObserver& aObserver ) =0; williamr@4: williamr@4: /** williamr@4: * Creates an operation for committing multiple contacts. williamr@4: * williamr@4: * @param aContacts An array of contact links that specify williamr@4: * the contacts williamr@4: * @param aObserver An observer for the operation. williamr@4: * @return A handle to the operation or NULL williamr@4: */ williamr@4: virtual MVPbkContactOperation* CreateCommitContactsOperationL( williamr@4: const TArray& aContacts, williamr@4: MVPbkBatchOperationObserver& aObserver) =0; williamr@4: williamr@4: /** williamr@4: * Creates an operation for asynchronous phone number matching. williamr@4: * williamr@4: * @param aPhoneNumber A phone number to search for. williamr@4: * @param aMaxMatchDigits Maximum number of digits to match from williamr@4: * the end of the number. williamr@4: * @param aObserver Observer for the find process. williamr@4: * @return A handle to the operation or NULL williamr@4: */ williamr@4: virtual MVPbkContactOperation* CreateMatchPhoneNumberOperationL( williamr@4: const TDesC& aPhoneNumber, williamr@4: TInt aMaxMatchDigits, williamr@4: MVPbkContactFindObserver& aObserver) =0; williamr@4: williamr@4: /** williamr@4: * Creates an operation for asynchronous contact finding. williamr@4: * williamr@4: * @param aSearchString String to search for. williamr@4: * @param aFieldTypes List of field types that the search will include. williamr@4: * @param aObserver Observer for the find process. williamr@4: * @return A handle to the operation or NULL williamr@4: */ williamr@4: virtual MVPbkContactOperation* CreateFindOperationL( williamr@4: const TDesC& aSearchString, williamr@4: const MVPbkFieldTypeList& aFieldTypes, williamr@4: MVPbkContactFindObserver& aObserver) =0; williamr@4: williamr@4: /** williamr@4: * Creates an operation for asynchronous contact finding. williamr@4: * Finds a string containing text that is stored in one or more fields. williamr@4: * Client can give multiple find words. All the words must match to separated williamr@4: * data. E.g if there are two find words: "Jo" and "Jo" then field data williamr@4: * "John Johnson" matches but "John Doe" doesn't if the word parser uses williamr@4: * white space as a word separator. williamr@4: * williamr@4: * NOTE: The accuracy of the results depends on the ability of the store williamr@4: * implementation to implement the find. The performance can vary williamr@4: * too depending on the store. williamr@4: * williamr@4: * @param aSearchStrings Words that are compared to field data. williamr@4: * @param aFieldTypes Types of the fields that are used. williamr@4: * @param aObserver An observer for asynchronous operation. williamr@4: * @param aWordParserCallBack a client implementation of word parser williamr@4: * function that separates the field data williamr@4: * into words. Parameter to function is williamr@4: * TVPbkWordParserParam. williamr@4: * @return A handle to the operation or NULL williamr@4: */ williamr@4: virtual MVPbkContactOperation* CreateFindOperationL( williamr@4: const MDesC16Array& aSearchStrings, williamr@4: const MVPbkFieldTypeList& aFieldTypes, williamr@4: MVPbkContactFindFromStoresObserver& aObserver, williamr@4: const TCallBack& aWordParserCallBack ) =0; williamr@4: williamr@4: /** williamr@4: * Creates an operation for compressing the store. williamr@4: * williamr@4: * @param aObserver An observer for the compress operation. williamr@4: * @return A handle to the operation or NULL williamr@4: */ williamr@4: virtual MVPbkContactOperation* CreateCompressStoresOperationL( williamr@4: MVPbkBatchOperationObserver& aObserver) = 0; williamr@4: williamr@4: /** williamr@4: * Returns an extension point for this interface or NULL. williamr@4: * @param aExtensionUid Uid of extension. williamr@4: * @return Extension point or NULL. williamr@4: */ williamr@4: virtual TAny* ContactOperationFactoryExtension( williamr@4: TUid /*aExtensionUid*/) { return NULL; } williamr@4: }; williamr@4: williamr@4: #endif // MVPBKCONTACTOPERATIONFACTORY_H williamr@4: williamr@4: // End of File