diff -r 000000000000 -r e686773b3f54 contacts_plat/virtual_phonebook_store_api/inc/CVPbkContactStoreList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contacts_plat/virtual_phonebook_store_api/inc/CVPbkContactStoreList.h Tue Feb 02 10:12:17 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A class for store list implementation +* +*/ + + +#ifndef CVPBKCONTACTSTORELIST_H +#define CVPBKCONTACTSTORELIST_H + +#include +#include +#include + +class TVPbkContactStoreUriPtr; +class CVPbkContactStoreUriArray; + + +/** + * A class for store list implementation + * + * @lib VPbkEng.lib + */ +class CVPbkContactStoreList : + public CBase, + public MVPbkContactStoreList, + private MVPbkContactStoreObserver + { + public: + /** + * Constructor. + * @return A new instance of this class + */ + IMPORT_C static CVPbkContactStoreList* NewL(); + + /** + * Destructor. Destroys all stores. + */ + virtual ~CVPbkContactStoreList(); + + /** + * Appends a new store to the list. Ownership is taken. + * + * @param aStore a new store to the list. Ownership is taken. + */ + IMPORT_C void AppendL( MVPbkContactStore* aStore ); + + public: // from MVPbkContactStoreList + TInt Count() const; + MVPbkContactStore& At( TInt aIndex ) const; + MVPbkContactStore* Find( const TVPbkContactStoreUriPtr& aUri ) const; + void OpenAllL( MVPbkContactStoreListObserver& aObserver ); + void CloseAll( MVPbkContactStoreListObserver& aObserver ); + + private: // from MVPbkContactStoreObserver + void StoreReady( MVPbkContactStore& aContactStore ); + void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason ); + void HandleStoreEventL( + MVPbkContactStore& aContactStore, + TVPbkContactStoreEvent aStoreEvent); + + private: // implementation + void SignalOpenComplete(); + + private: // implementation + CVPbkContactStoreList(); + + private: // data + /// Own: an array that owns the store instances + RPointerArray iStores; + /// Ref: a references to the stores that are opened + RPointerArray iStoresToOpen; + /// Ref: the observer of this list. + MVPbkContactStoreListObserver* iObserver; + }; + + +#endif // CVPBKCONTACTSTORELIST_H + +// End of File