phoneengine/PhoneCntFinder/ContactService/inc/MPhCntContactManager.h
changeset 0 5f000ab63145
child 58 40a3f856b14d
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Interface for phonebook services.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPHCNTCONTACTMANAGER_H
       
    20 #define MPHCNTCONTACTMANAGER_H
       
    21 
       
    22 #include <cntdef.h>
       
    23 #include <VPbkContactView.hrh>
       
    24 
       
    25 class MVPbkContactLink;
       
    26 class MVPbkSingleContactOperationObserver;
       
    27 class MVPbkContactOperationBase;
       
    28 class MVPbkContactStoreList;
       
    29 class MVPbkContactFindObserver;
       
    30 class MPhCntContactMatchStrategy;
       
    31 class MPbk2ContactNameFormatter;
       
    32 class CVPbkContactIdConverter;
       
    33 class MVPbkContactLinkArray;
       
    34 class MVPbkContactFindObserver;
       
    35 class MPbk2ImageOperation;
       
    36 class MPbk2ImageGetObserver;
       
    37 class MVPbkFieldType;
       
    38 class MVPbkStoreContact;
       
    39 class MVPbkStoreContactField;
       
    40 class CVPbkFieldTypeSelector;
       
    41 class MPhCntStoreLoaderObserver;
       
    42 class CPhCntContactStoreUris;
       
    43 
       
    44 /**
       
    45  * Interface for phonebook services.
       
    46  *
       
    47  * @since S60 v3.1
       
    48  * @lib PhoneCntFinder.lib
       
    49  */
       
    50 NONSHARABLE_CLASS(  MPhCntContactManager )
       
    51     {
       
    52 public:
       
    53     
       
    54     /**
       
    55      * Retrieves contact from phonebook.
       
    56      * 
       
    57      * @since S60 v3.1
       
    58      * @param aLink Link to the contact.
       
    59      * @param aObserver Observer for the retrieval.
       
    60      * @return Handle to the retrieval operation.
       
    61      */
       
    62     virtual MVPbkContactOperationBase* RetrieveContactL(
       
    63         const MVPbkContactLink& aLink,
       
    64         MVPbkSingleContactOperationObserver& aObserver) = 0;
       
    65         
       
    66     /**
       
    67      * Gives the list of contact stores.
       
    68      * 
       
    69      * @since S60 v3.1
       
    70      * @return List of contact stores.
       
    71      */
       
    72     virtual MVPbkContactStoreList& ContactStoresL() const = 0;
       
    73     
       
    74     /**
       
    75      * Factory method for creating contact match strategy.
       
    76      *
       
    77      * @since S60 v3.1
       
    78      * @param aObserver Contact match strategy observer.
       
    79      * @return New contact match strategy instance.
       
    80      */
       
    81     virtual MPhCntContactMatchStrategy* CreateContactMatchStrategyL(
       
    82         MVPbkContactFindObserver& aObserver,
       
    83         TBool aRemoveDuplicates )= 0;
       
    84     
       
    85     /**
       
    86      * Gives access to contact name formatter.
       
    87      *
       
    88      * @since S60 v3.1
       
    89      * @return Contact name formatter.
       
    90      */    
       
    91     virtual MPbk2ContactNameFormatter& ContactNameFormatter() = 0;
       
    92     
       
    93     /**
       
    94      * Converts contact ids to contact links.
       
    95      * 
       
    96      * @since S60 v3.1
       
    97      * @param aContactId Array of contact ids.
       
    98      * @return Array of contact links. Ownership given.
       
    99      */
       
   100     virtual MVPbkContactLinkArray* ConvertContactIdsToLinksL(  
       
   101         const CArrayFix<TContactItemId>& aContactId ) const = 0;
       
   102         
       
   103     /**
       
   104      * Converts contact id to contact link.
       
   105      * 
       
   106      * @since S60 v3.1
       
   107      * @param aContactId Contact id from Contact DB.
       
   108      * @return Concact link, ownership is given to caller.
       
   109      * If the aContactId is KNullContactId then then returned value is NULL.
       
   110      */
       
   111     virtual MVPbkContactLink* ConvertContactIdToLinkL( 
       
   112         TContactItemId aContactId ) const = 0;
       
   113         
       
   114     /**
       
   115      * Converts contact link to contact id.
       
   116      *
       
   117      * @since S60 v3.1
       
   118      * @param aContactLink Reference to contactlink.
       
   119      * @return Contact id.
       
   120      */
       
   121     virtual TContactItemId ConvertContactLinkToContactId(
       
   122         const MVPbkContactLink& aContactLink ) const = 0;
       
   123         
       
   124     /**
       
   125      * Converts packed link descriptor to contact link.
       
   126      * 
       
   127      * @since S60 v3.2
       
   128      * @param aPackeLink Link prepresented as desctiptor.
       
   129      * @return Contact link. Returns null if aPackedLink length is 0.
       
   130      */
       
   131     virtual MVPbkContactLink* ConvertDescriptorToLinkL( 
       
   132         const TDesC8& aPackedLink ) const = 0;
       
   133         
       
   134     /**
       
   135      * Retrieves contact, which has been assinged to speeddial position
       
   136      * aSpeedDialPosition.
       
   137      *
       
   138      * @since S60 v3.1
       
   139      * @param aSpeedDialPosition Speed dial position.
       
   140      * @param aObserver Observer for operation.
       
   141      * @return Operation, ownership is given to caller.
       
   142      */
       
   143     virtual MVPbkContactOperationBase* RetrieveSpeedDialContactLinkL(
       
   144         const TInt aSpeedDialPosition,
       
   145         MVPbkContactFindObserver& aObserver ) = 0;
       
   146 
       
   147 	/**
       
   148      * Indicates whether the speed dial attribute has been set for the given position.
       
   149      *
       
   150      * @since S60 v3.2
       
   151      * @see MPhCntContactManager.
       
   152      * @param aSpeedDialPosition Speed dial position.
       
   153      * @param aField Field to be evaluated.
       
   154      * @return ETrue if aField has a matching speed dial position,
       
   155      *         EFalse otherwise.     
       
   156      */    
       
   157 	virtual TBool HasSpeedDialL(      
       
   158 		const TInt aSpeedDialPosition,  
       
   159 		const MVPbkStoreContactField& aField ) = 0;        
       
   160 
       
   161     /**
       
   162      * Retrieves contacts image. To cancel the thumbnail
       
   163      * fetch, delete operation.
       
   164      *
       
   165      * @since S60 v3.1
       
   166      * @param aContact Contact, which image is fetched.
       
   167      * @param aFieldType Field type.
       
   168      * @param aObserver Observer of the fetch.
       
   169      */
       
   170     virtual MPbk2ImageOperation* RetrieveImageL(
       
   171         MVPbkStoreContact& aStoreContact,
       
   172         const MVPbkFieldType& aFieldType,
       
   173         MPbk2ImageGetObserver& aObserver ) = 0;
       
   174         
       
   175     /** 
       
   176      * Creates field type selector.
       
   177      *
       
   178      * @since S60 v3.2
       
   179      */    
       
   180     virtual CVPbkFieldTypeSelector* CreateFieldTypeSelectorL() const = 0;
       
   181     
       
   182     /**
       
   183      * Appends filter to selector.
       
   184      *
       
   185      * @since S60 v3.2
       
   186      * @param aSelector Selector to append the filter.
       
   187      * @param aFilter The filter to be appended.
       
   188      */
       
   189     virtual void AppendFilterToSelectorL( CVPbkFieldTypeSelector& aSelector,
       
   190         TVPbkContactViewFilter aFilter ) = 0;
       
   191    
       
   192     /**
       
   193      * Loads the store specified in the contact link and adds the store to 
       
   194      * the list of stores handled by this manager.
       
   195      *
       
   196      * @since   S60 v9.1
       
   197      * @param   aContactLink    A contact link containing store to load.
       
   198      * @param   aObserver       An observer for the loading process.
       
   199      */
       
   200     virtual void LoadContactStoreL( const TDesC8& aContactLink,
       
   201         MPhCntStoreLoaderObserver& aObserver ) = 0;
       
   202    
       
   203     /**
       
   204      * Loads the store specified by the URI and adds the store to 
       
   205      * the list of stores handled by this manager.
       
   206      *
       
   207      * @since   S60 v9.1
       
   208      * @param   aStoreUri       A URI of the store to load.
       
   209      * @param   aObserver       An observer for the loading process.
       
   210      */
       
   211     virtual void LoadContactStoreWithUriL( 
       
   212         const TDesC& aStoreUri,
       
   213         MPhCntStoreLoaderObserver& aObserver ) = 0;
       
   214 		
       
   215     /** 
       
   216      * Return contact store uri's.
       
   217      *
       
   218      * @since S60 v9.1
       
   219      */ 
       
   220     virtual CPhCntContactStoreUris& ContactStoreUrisL() = 0;
       
   221 	
       
   222 protected:
       
   223 
       
   224     MPhCntContactManager(){};
       
   225     
       
   226     virtual ~MPhCntContactManager() {};
       
   227     };
       
   228 
       
   229 #endif