phonebookui/Phonebook2/spbcontentprovider/inc/spbcontactstorelistener.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2009 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:  .
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SPBCONTACTSTORELISTENER_H_
       
    19 #define SPBCONTACTSTORELISTENER_H_
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <MVPbkContactStoreObserver.h>
       
    24 
       
    25 // FORWARD DECLARATION
       
    26 class CSpbContent;
       
    27 class CPbk2StoreManager;
       
    28 
       
    29 /*
       
    30  * Listener of contact stores to observe phonenumber changes
       
    31  */
       
    32 NONSHARABLE_CLASS( CSpbContactStoreListener ) : 
       
    33     public CBase,
       
    34     public MVPbkContactStoreObserver
       
    35 	{
       
    36 	
       
    37 public: // Construction & destruction
       
    38 	
       
    39     static CSpbContactStoreListener* NewL(
       
    40             CPbk2StoreManager& aStoreManager,
       
    41             RPointerArray<CSpbContent>& aContentCache );
       
    42     
       
    43     ~CSpbContactStoreListener();
       
    44     
       
    45     
       
    46 public:	//from MVPbkContactStoreObserver
       
    47 	
       
    48 	void StoreReady(MVPbkContactStore& aContactStore);
       
    49 	
       
    50 	void StoreUnavailable(MVPbkContactStore& aContactStore, TInt aReason );
       
    51 	
       
    52 	void HandleStoreEventL(
       
    53         MVPbkContactStore& aContactStore, 
       
    54         TVPbkContactStoreEvent aStoreEvent);
       
    55     
       
    56 private:	// new functions
       
    57 	
       
    58 	/*
       
    59 	 * Returns content corresponding to the link
       
    60 	 */
       
    61 	CSpbContent* ContentByLink( const MVPbkContactLink& aLink );
       
    62     
       
    63 	/**
       
    64 	 * Delete content from cache corresponding to the link
       
    65 	 * @param aLink contact link to be matched with cache
       
    66 	 */
       
    67 	void DeleteContentByLink( const MVPbkContactLink& aLink );
       
    68 	
       
    69 private:    // constructors
       
    70     inline CSpbContactStoreListener(
       
    71         CPbk2StoreManager& aStoreManager,
       
    72         RPointerArray<CSpbContent>& aContentCache );
       
    73     
       
    74     inline void ConstructL();
       
    75     
       
    76 private: // data
       
    77    
       
    78     /// Ref. Store Manager
       
    79     CPbk2StoreManager& iStoreManager;
       
    80 
       
    81     /// Ref. Cached content
       
    82     RPointerArray<CSpbContent>& iContentCache;
       
    83 	};
       
    84 
       
    85 
       
    86 #endif /* SPBCONTACTSTORELISTENER_H_ */