2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Virtual Phonebook factory interface for asynchronous
21 #ifndef MVPBKCONTACTOPERATIONFACTORY_H
22 #define MVPBKCONTACTOPERATIONFACTORY_H
28 // FORWARD DECLARATIONS
29 class MVPbkContactOperation;
30 class MVPbkContactLink;
31 class MVPbkContactLinkArray;
32 class MVPbkStoreContact;
33 class MVPbkSingleContactOperationObserver;
34 class MVPbkBatchOperationObserver;
35 class MVPbkContactFindObserver;
36 class MVPbkFieldTypeList;
37 class MVPbkContactFindFromStoresObserver;
42 * A factory interface for asynchronous contact operations.
43 * This interface is used to create contact operations.
45 class MVPbkContactOperationFactory
49 * Creates an operation for contact retrieval.
51 * @param aLink A link to the contact
52 * @param aObserver An observer for the operation.
53 * @return A handle to the operation or NULL if the factory
54 * doesn't have reference to the store of the link.
56 virtual MVPbkContactOperation* CreateContactRetrieverL(
57 const MVPbkContactLink& aLink,
58 MVPbkSingleContactOperationObserver& aObserver) =0;
61 * Creates an operation for deleting multiple contacts.
63 * @param aContactLinks An array of contact links that specify
65 * @param aObserver An observer for the operation.
66 * @return A handle to the operation or NULL
68 virtual MVPbkContactOperation* CreateDeleteContactsOperationL(
69 const MVPbkContactLinkArray& aContactLinks,
70 MVPbkBatchOperationObserver& aObserver ) =0;
73 * Creates an operation for committing multiple contacts.
75 * @param aContacts An array of contact links that specify
77 * @param aObserver An observer for the operation.
78 * @return A handle to the operation or NULL
80 virtual MVPbkContactOperation* CreateCommitContactsOperationL(
81 const TArray<MVPbkStoreContact*>& aContacts,
82 MVPbkBatchOperationObserver& aObserver) =0;
85 * Creates an operation for asynchronous phone number matching.
87 * @param aPhoneNumber A phone number to search for.
88 * @param aMaxMatchDigits Maximum number of digits to match from
89 * the end of the number.
90 * @param aObserver Observer for the find process.
91 * @return A handle to the operation or NULL
93 virtual MVPbkContactOperation* CreateMatchPhoneNumberOperationL(
94 const TDesC& aPhoneNumber,
96 MVPbkContactFindObserver& aObserver) =0;
99 * Creates an operation for asynchronous contact finding.
101 * @param aSearchString String to search for.
102 * @param aFieldTypes List of field types that the search will include.
103 * @param aObserver Observer for the find process.
104 * @return A handle to the operation or NULL
106 virtual MVPbkContactOperation* CreateFindOperationL(
107 const TDesC& aSearchString,
108 const MVPbkFieldTypeList& aFieldTypes,
109 MVPbkContactFindObserver& aObserver) =0;
112 * Creates an operation for asynchronous contact finding.
113 * Finds a string containing text that is stored in one or more fields.
114 * Client can give multiple find words. All the words must match to separated
115 * data. E.g if there are two find words: "Jo" and "Jo" then field data
116 * "John Johnson" matches but "John Doe" doesn't if the word parser uses
117 * white space as a word separator.
119 * NOTE: The accuracy of the results depends on the ability of the store
120 * implementation to implement the find. The performance can vary
121 * too depending on the store.
123 * @param aSearchStrings Words that are compared to field data.
124 * @param aFieldTypes Types of the fields that are used.
125 * @param aObserver An observer for asynchronous operation.
126 * @param aWordParserCallBack a client implementation of word parser
127 * function that separates the field data
128 * into words. Parameter to function is
129 * TVPbkWordParserParam.
130 * @return A handle to the operation or NULL
132 virtual MVPbkContactOperation* CreateFindOperationL(
133 const MDesC16Array& aSearchStrings,
134 const MVPbkFieldTypeList& aFieldTypes,
135 MVPbkContactFindFromStoresObserver& aObserver,
136 const TCallBack& aWordParserCallBack ) =0;
139 * Creates an operation for compressing the store.
141 * @param aObserver An observer for the compress operation.
142 * @return A handle to the operation or NULL
144 virtual MVPbkContactOperation* CreateCompressStoresOperationL(
145 MVPbkBatchOperationObserver& aObserver) = 0;
148 * Returns an extension point for this interface or NULL.
149 * @param aExtensionUid Uid of extension.
150 * @return Extension point or NULL.
152 virtual TAny* ContactOperationFactoryExtension(
153 TUid /*aExtensionUid*/) { return NULL; }
156 #endif // MVPBKCONTACTOPERATIONFACTORY_H