epoc32/include/app/MVPbkContactOperationFactory.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Virtual Phonebook factory interface for asynchronous 
    15 *                contact operations.
    16 *
    17 */
    18 
    19 // 
    20 
    21 #ifndef MVPBKCONTACTOPERATIONFACTORY_H
    22 #define MVPBKCONTACTOPERATIONFACTORY_H
    23 
    24 // INCLUDES
    25 #include <e32cmn.h>
    26 #include <bamdesca.h>
    27 
    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;
    38 
    39 // CLASS DECLARATIONS
    40 
    41 /**
    42  * A factory interface for asynchronous contact operations.
    43  * This interface is used to create contact operations.
    44  */
    45 class MVPbkContactOperationFactory
    46     {
    47     public:  // Factories
    48         /**
    49          * Creates an operation for contact retrieval.
    50          *
    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.
    55          */
    56         virtual MVPbkContactOperation* CreateContactRetrieverL(
    57                 const MVPbkContactLink& aLink,
    58                 MVPbkSingleContactOperationObserver& aObserver) =0;
    59 
    60         /**
    61          * Creates an operation for deleting multiple contacts.
    62          *
    63          * @param aContactLinks An array of contact links that specify 
    64          *                      the contacts.
    65          * @param aObserver An observer for the operation.
    66          * @return A handle to the operation or NULL
    67          */
    68         virtual MVPbkContactOperation* CreateDeleteContactsOperationL(
    69                 const MVPbkContactLinkArray& aContactLinks, 
    70                 MVPbkBatchOperationObserver& aObserver ) =0;
    71 
    72         /**
    73          * Creates an operation for committing multiple contacts.
    74          *
    75          * @param aContacts An array of contact links that specify
    76          *                  the contacts
    77          * @param aObserver An observer for the operation.
    78          * @return A handle to the operation or NULL
    79          */
    80         virtual MVPbkContactOperation* CreateCommitContactsOperationL(
    81                 const TArray<MVPbkStoreContact*>& aContacts,
    82                 MVPbkBatchOperationObserver& aObserver) =0;
    83 
    84         /**
    85          * Creates an operation for asynchronous phone number matching.
    86          * 
    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
    92          */
    93         virtual MVPbkContactOperation* CreateMatchPhoneNumberOperationL(
    94                 const TDesC& aPhoneNumber, 
    95                 TInt aMaxMatchDigits,
    96                 MVPbkContactFindObserver& aObserver) =0;
    97 
    98         /**
    99          * Creates an operation for asynchronous contact finding.
   100          *
   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
   105          */
   106         virtual MVPbkContactOperation* CreateFindOperationL(
   107                 const TDesC& aSearchString,
   108                 const MVPbkFieldTypeList& aFieldTypes,
   109                 MVPbkContactFindObserver& aObserver) =0;
   110         
   111         /**
   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.
   118          *
   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. 
   122          *
   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
   131          */
   132         virtual MVPbkContactOperation* CreateFindOperationL(
   133                 const MDesC16Array& aSearchStrings, 
   134                 const MVPbkFieldTypeList& aFieldTypes, 
   135                 MVPbkContactFindFromStoresObserver& aObserver, 
   136                 const TCallBack& aWordParserCallBack ) =0;
   137             
   138         /**
   139          * Creates an operation for compressing the store.
   140          *
   141          * @param aObserver An observer for the compress operation.
   142          * @return A handle to the operation or NULL
   143          */
   144         virtual MVPbkContactOperation* CreateCompressStoresOperationL(
   145         		MVPbkBatchOperationObserver& aObserver) = 0;
   146 
   147         /**
   148          * Returns an extension point for this interface or NULL.
   149          * @param aExtensionUid Uid of extension.
   150          * @return Extension point or NULL.
   151          */
   152         virtual TAny* ContactOperationFactoryExtension(
   153                 TUid /*aExtensionUid*/) { return NULL; }
   154     };
   155 
   156 #endif // MVPBKCONTACTOPERATIONFACTORY_H
   157 
   158 // End of File