2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: An interface for a list of contact stores.
19 #ifndef MVPBKCONTACTSTORELIST_H
20 #define MVPBKCONTACTSTORELIST_H
25 // FORWARD DECLARATIONS
26 class MVPbkContactStore;
27 class MVPbkContactStoreListObserver;
28 class TVPbkContactStoreUriPtr;
33 * An interface for a list of contact stores.
35 * The interface provides an access to multiple stores. It's possible to open
36 * and close all stores in single call using this interface. When client calls
37 * OpenAllL it must also calls CloseAll after usage.
39 * @see CVPbkContactManager::ContactStoresL
41 class MVPbkContactStoreList
44 virtual ~MVPbkContactStoreList() { }
47 * Returns the number of stores in the list.
49 * @return The number of stores in the list.
51 virtual TInt Count() const =0;
54 * Returns the store in given index in the list.
56 * @param aIndex the index of the store in the list
57 * @precond aIndex >= 0 && aIndex < Count()
58 * VPbkError::Panic(VPbkError::EInvalidStoreIndex)
59 * is raised if the precondition does not hold.
60 * @return The store in the specified index.
62 virtual MVPbkContactStore& At(TInt aIndex) const =0;
65 * Finds the contact store corresponding to the aUri.
67 * @param aUri the store URI to search for.
68 * @return The contact store corresponding to the aUri or NULL.
70 virtual MVPbkContactStore* Find(
71 const TVPbkContactStoreUriPtr& aUri) const =0;
74 * Opens all stores in the list asynchronously.
76 * A client can not use stores before it has successfully opened
77 * them. CloseAll must be always called by the same observer that has
80 * NOTE: There can be only one observer for one store list at a time.
82 * @param aObserver An observer for the stores.
83 * @exception KErrInUse If one observer is currently opening this list.
85 virtual void OpenAllL(MVPbkContactStoreListObserver& aObserver) =0;
88 * Closes all stores in the list.
90 * This is safe to call in all circumstances. Implementations
91 * can not trust that OpenAllL has been called before.
93 * @param aObserver An observer for the close process.
95 virtual void CloseAll(MVPbkContactStoreListObserver& aObserver) =0;
98 * Returns an extension point for this interface or NULL.
100 * @param aExtensionUid no extensions defined currently.
101 * @return an extension point for this interface or NULL.
103 virtual TAny* ContactStoreListExtension(TUid /*aExtensionUid*/)
108 #endif // MVPBKCONTACTSTORELIST_H