williamr@4: /* williamr@4: * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributors: williamr@4: * Nokia Corporation - initial contribution. williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: An interface for a list of contact stores. williamr@4: * williamr@4: */ williamr@4: williamr@4: williamr@4: #ifndef MVPBKCONTACTSTORELIST_H williamr@4: #define MVPBKCONTACTSTORELIST_H williamr@4: williamr@4: // INCLUDES williamr@4: #include williamr@4: williamr@4: // FORWARD DECLARATIONS williamr@4: class MVPbkContactStore; williamr@4: class MVPbkContactStoreListObserver; williamr@4: class TVPbkContactStoreUriPtr; williamr@4: williamr@4: williamr@4: // CLASS DECLARATIONS williamr@4: /** williamr@4: * An interface for a list of contact stores. williamr@4: * williamr@4: * The interface provides an access to multiple stores. It's possible to open williamr@4: * and close all stores in single call using this interface. When client calls williamr@4: * OpenAllL it must also calls CloseAll after usage. williamr@4: * williamr@4: * @see CVPbkContactManager::ContactStoresL williamr@4: */ williamr@4: class MVPbkContactStoreList williamr@4: { williamr@4: public: // interface williamr@4: virtual ~MVPbkContactStoreList() { } williamr@4: williamr@4: /** williamr@4: * Returns the number of stores in the list. williamr@4: * williamr@4: * @return The number of stores in the list. williamr@4: */ williamr@4: virtual TInt Count() const =0; williamr@4: williamr@4: /** williamr@4: * Returns the store in given index in the list. williamr@4: * williamr@4: * @param aIndex the index of the store in the list williamr@4: * @precond aIndex >= 0 && aIndex < Count() williamr@4: * VPbkError::Panic(VPbkError::EInvalidStoreIndex) williamr@4: * is raised if the precondition does not hold. williamr@4: * @return The store in the specified index. williamr@4: */ williamr@4: virtual MVPbkContactStore& At(TInt aIndex) const =0; williamr@4: williamr@4: /** williamr@4: * Finds the contact store corresponding to the aUri. williamr@4: * williamr@4: * @param aUri the store URI to search for. williamr@4: * @return The contact store corresponding to the aUri or NULL. williamr@4: */ williamr@4: virtual MVPbkContactStore* Find( williamr@4: const TVPbkContactStoreUriPtr& aUri) const =0; williamr@4: williamr@4: /** williamr@4: * Opens all stores in the list asynchronously. williamr@4: * williamr@4: * A client can not use stores before it has successfully opened williamr@4: * them. CloseAll must be always called by the same observer that has williamr@4: * opened stores. williamr@4: * williamr@4: * NOTE: There can be only one observer for one store list at a time. williamr@4: * williamr@4: * @param aObserver An observer for the stores. williamr@4: * @exception KErrInUse If one observer is currently opening this list. williamr@4: */ williamr@4: virtual void OpenAllL(MVPbkContactStoreListObserver& aObserver) =0; williamr@4: williamr@4: /** williamr@4: * Closes all stores in the list. williamr@4: * williamr@4: * This is safe to call in all circumstances. Implementations williamr@4: * can not trust that OpenAllL has been called before. williamr@4: * williamr@4: * @param aObserver An observer for the close process. williamr@4: */ williamr@4: virtual void CloseAll(MVPbkContactStoreListObserver& aObserver) =0; williamr@4: williamr@4: /** williamr@4: * Returns an extension point for this interface or NULL. williamr@4: * williamr@4: * @param aExtensionUid no extensions defined currently. williamr@4: * @return an extension point for this interface or NULL. williamr@4: */ williamr@4: virtual TAny* ContactStoreListExtension(TUid /*aExtensionUid*/) williamr@4: { return NULL; } williamr@4: williamr@4: }; williamr@4: williamr@4: #endif // MVPBKCONTACTSTORELIST_H williamr@4: williamr@4: //End of file