phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactstoreuris.h
changeset 0 5f000ab63145
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:  Contact store Uris
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTCONTACTSTOREURIS_H
       
    20 #define CPHCNTCONTACTSTOREURIS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "tphcntcontactstorestate.h"
       
    25 
       
    26 class CVPbkContactStoreUriArray;
       
    27 class TVPbkContactStoreUriPtr;
       
    28 class MPhCntContactStoreEventObserver;
       
    29 
       
    30 /**
       
    31  *  Updates list of active contact store uris.
       
    32  *
       
    33  *  @lib PhoneCntFiner.lib
       
    34  *  @since S60 v3.2
       
    35  */
       
    36 NONSHARABLE_CLASS( CPhCntContactStoreUris ): public CBase
       
    37     {
       
    38 
       
    39 public:
       
    40 
       
    41     static CPhCntContactStoreUris* NewL();
       
    42 
       
    43     virtual ~CPhCntContactStoreUris();
       
    44 
       
    45     /**
       
    46      * Gives reference to all contact store uris that
       
    47      * are used with contact matching.
       
    48      *
       
    49      * @since S60 v3.2
       
    50      * @return Uris of contact stores.
       
    51      */
       
    52     CVPbkContactStoreUriArray& ContactStores() const;
       
    53     
       
    54     /**
       
    55      * Gives URIs to currently active contact stores. The Uris
       
    56      * are in priority order ie the first uri is a uri to a contact store, 
       
    57      * where contact matching should be tried first
       
    58      *
       
    59      * @since S60 v3.2
       
    60      * @return Uris of contact stores currently active, ownership is given to client.
       
    61      */
       
    62     CVPbkContactStoreUriArray* ActiveContactStoresL() const;
       
    63     
       
    64     /**
       
    65      * Indication that contact store is ready to be used.
       
    66      *
       
    67      * @since S60 v3.2
       
    68      * @aContactStoreUri URI of the contact store.
       
    69      */
       
    70     void StoreReady( TVPbkContactStoreUriPtr& aContactStoreUri );
       
    71     
       
    72     /**
       
    73      * Indication that contact store has become unavailable.
       
    74      *
       
    75      * @since S60 v3.2
       
    76      * @aContactStoreUri URI of the contact store.
       
    77      */
       
    78     void StoreUnavailable( TVPbkContactStoreUriPtr& aContactStoreUri );
       
    79     
       
    80     /**
       
    81      * Sets observer for contact store events.
       
    82      *
       
    83      * @since S60 v3.2
       
    84      * @param aObserver Observer of the events.
       
    85      */
       
    86     void SetObserver( MPhCntContactStoreEventObserver& aObserver );
       
    87     
       
    88     /**
       
    89      * Returns array of additional contact stores.
       
    90      *
       
    91      * @since S60 v3.2
       
    92      * @return Reference to Uris of additional contact stores
       
    93      */
       
    94     const CVPbkContactStoreUriArray& AdditionalContactStores() const;
       
    95 
       
    96     /**
       
    97      * Adds contact store to the base set of stores.
       
    98      *
       
    99      * @since   S60 v9.1
       
   100      * @param   aContactStoreUri    Contact store to add.
       
   101      */
       
   102     void AddContactStoreL( 
       
   103         const TVPbkContactStoreUriPtr& aContactStoreUri );
       
   104     
       
   105     /**
       
   106      * Removes contact store from the base set of stores.
       
   107      *
       
   108      * @since   S60 v9.1
       
   109      * @param   aContactStoreUri    Contact store to remove.
       
   110      */
       
   111     void RemoveContactStore( 
       
   112         const TVPbkContactStoreUriPtr& aContactStoreUri );
       
   113 
       
   114 private:
       
   115 
       
   116     CPhCntContactStoreUris();
       
   117 
       
   118     void ConstructL();
       
   119     
       
   120     void SetContactStoreAvailability( 
       
   121         TVPbkContactStoreUriPtr& aStoreUri, 
       
   122         TBool aIsAvailable );
       
   123         
       
   124     /**
       
   125      * Reads additional contact store URIs from CenRep.
       
   126      *
       
   127      * @since S60 v3.2
       
   128      * @param aProductSpecificList Product specific list of additional stores
       
   129      */
       
   130     void ReadAdditionalContactStoreL( TDes* aProductSpecificList );
       
   131     
       
   132     /**
       
   133      * Parses the additional contact store names from the string
       
   134      * fetched from CenRep.
       
   135      *
       
   136      * @since S60 v3.2
       
   137      * @param aProductSpecificList  Reference to product specific 
       
   138      *                              list of additional stores
       
   139      */
       
   140     void ParseStoresL( const TDesC& aProductSpecificList );
       
   141 
       
   142     /**
       
   143      * Implements TIdentityRelation for class TPhCntContactStoreState.
       
   144      *
       
   145      * @since S60 v9.1
       
   146      * @param aState1   First state object to compare.
       
   147      * @param aState2   Second state object to compare.
       
   148      * @return ETrue if objects are same.
       
   149      */
       
   150     static TBool MatchUris( 
       
   151         const TPhCntContactStoreState& aState1,
       
   152         const TPhCntContactStoreState& aState2 );
       
   153         
       
   154 private: // data
       
   155 
       
   156     /**
       
   157      * Contact store uris used with contact matching.
       
   158      * own.
       
   159      */
       
   160     CVPbkContactStoreUriArray* iContactStoreUriArray;
       
   161     
       
   162     /**
       
   163      * Contact store uris used with contact matching.
       
   164      * own.
       
   165      */
       
   166     CVPbkContactStoreUriArray* iAdditionalContactStoreUriArray;
       
   167 
       
   168     
       
   169     /**
       
   170      * Contact stores states in priority order.
       
   171      * Own.
       
   172      */
       
   173     RArray<TPhCntContactStoreState> iContactStoreStates;
       
   174     
       
   175     /**
       
   176      * Observer for contact store events.
       
   177      * Not own.
       
   178      */
       
   179     MPhCntContactStoreEventObserver* iObserver;
       
   180     
       
   181     };
       
   182 
       
   183 
       
   184 #endif // CPHCNTCONTACTSTOREURIS_H