author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@4 | 1 |
/* |
williamr@4 | 2 |
* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). |
williamr@4 | 3 |
* All rights reserved. |
williamr@4 | 4 |
* This component and the accompanying materials are made available |
williamr@4 | 5 |
* under the terms of "Eclipse Public License v1.0" |
williamr@4 | 6 |
* which accompanies this distribution, and is available |
williamr@4 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@4 | 8 |
* |
williamr@4 | 9 |
* Initial Contributors: |
williamr@4 | 10 |
* Nokia Corporation - initial contribution. |
williamr@4 | 11 |
* |
williamr@4 | 12 |
* Contributors: |
williamr@4 | 13 |
* |
williamr@4 | 14 |
* Description: An interface for a list of contact stores. |
williamr@4 | 15 |
* |
williamr@4 | 16 |
*/ |
williamr@4 | 17 |
|
williamr@4 | 18 |
|
williamr@4 | 19 |
#ifndef MVPBKCONTACTSTORELIST_H |
williamr@4 | 20 |
#define MVPBKCONTACTSTORELIST_H |
williamr@4 | 21 |
|
williamr@4 | 22 |
// INCLUDES |
williamr@4 | 23 |
#include <e32std.h> |
williamr@4 | 24 |
|
williamr@4 | 25 |
// FORWARD DECLARATIONS |
williamr@4 | 26 |
class MVPbkContactStore; |
williamr@4 | 27 |
class MVPbkContactStoreListObserver; |
williamr@4 | 28 |
class TVPbkContactStoreUriPtr; |
williamr@4 | 29 |
|
williamr@4 | 30 |
|
williamr@4 | 31 |
// CLASS DECLARATIONS |
williamr@4 | 32 |
/** |
williamr@4 | 33 |
* An interface for a list of contact stores. |
williamr@4 | 34 |
* |
williamr@4 | 35 |
* The interface provides an access to multiple stores. It's possible to open |
williamr@4 | 36 |
* and close all stores in single call using this interface. When client calls |
williamr@4 | 37 |
* OpenAllL it must also calls CloseAll after usage. |
williamr@4 | 38 |
* |
williamr@4 | 39 |
* @see CVPbkContactManager::ContactStoresL |
williamr@4 | 40 |
*/ |
williamr@4 | 41 |
class MVPbkContactStoreList |
williamr@4 | 42 |
{ |
williamr@4 | 43 |
public: // interface |
williamr@4 | 44 |
virtual ~MVPbkContactStoreList() { } |
williamr@4 | 45 |
|
williamr@4 | 46 |
/** |
williamr@4 | 47 |
* Returns the number of stores in the list. |
williamr@4 | 48 |
* |
williamr@4 | 49 |
* @return The number of stores in the list. |
williamr@4 | 50 |
*/ |
williamr@4 | 51 |
virtual TInt Count() const =0; |
williamr@4 | 52 |
|
williamr@4 | 53 |
/** |
williamr@4 | 54 |
* Returns the store in given index in the list. |
williamr@4 | 55 |
* |
williamr@4 | 56 |
* @param aIndex the index of the store in the list |
williamr@4 | 57 |
* @precond aIndex >= 0 && aIndex < Count() |
williamr@4 | 58 |
* VPbkError::Panic(VPbkError::EInvalidStoreIndex) |
williamr@4 | 59 |
* is raised if the precondition does not hold. |
williamr@4 | 60 |
* @return The store in the specified index. |
williamr@4 | 61 |
*/ |
williamr@4 | 62 |
virtual MVPbkContactStore& At(TInt aIndex) const =0; |
williamr@4 | 63 |
|
williamr@4 | 64 |
/** |
williamr@4 | 65 |
* Finds the contact store corresponding to the aUri. |
williamr@4 | 66 |
* |
williamr@4 | 67 |
* @param aUri the store URI to search for. |
williamr@4 | 68 |
* @return The contact store corresponding to the aUri or NULL. |
williamr@4 | 69 |
*/ |
williamr@4 | 70 |
virtual MVPbkContactStore* Find( |
williamr@4 | 71 |
const TVPbkContactStoreUriPtr& aUri) const =0; |
williamr@4 | 72 |
|
williamr@4 | 73 |
/** |
williamr@4 | 74 |
* Opens all stores in the list asynchronously. |
williamr@4 | 75 |
* |
williamr@4 | 76 |
* A client can not use stores before it has successfully opened |
williamr@4 | 77 |
* them. CloseAll must be always called by the same observer that has |
williamr@4 | 78 |
* opened stores. |
williamr@4 | 79 |
* |
williamr@4 | 80 |
* NOTE: There can be only one observer for one store list at a time. |
williamr@4 | 81 |
* |
williamr@4 | 82 |
* @param aObserver An observer for the stores. |
williamr@4 | 83 |
* @exception KErrInUse If one observer is currently opening this list. |
williamr@4 | 84 |
*/ |
williamr@4 | 85 |
virtual void OpenAllL(MVPbkContactStoreListObserver& aObserver) =0; |
williamr@4 | 86 |
|
williamr@4 | 87 |
/** |
williamr@4 | 88 |
* Closes all stores in the list. |
williamr@4 | 89 |
* |
williamr@4 | 90 |
* This is safe to call in all circumstances. Implementations |
williamr@4 | 91 |
* can not trust that OpenAllL has been called before. |
williamr@4 | 92 |
* |
williamr@4 | 93 |
* @param aObserver An observer for the close process. |
williamr@4 | 94 |
*/ |
williamr@4 | 95 |
virtual void CloseAll(MVPbkContactStoreListObserver& aObserver) =0; |
williamr@4 | 96 |
|
williamr@4 | 97 |
/** |
williamr@4 | 98 |
* Returns an extension point for this interface or NULL. |
williamr@4 | 99 |
* |
williamr@4 | 100 |
* @param aExtensionUid no extensions defined currently. |
williamr@4 | 101 |
* @return an extension point for this interface or NULL. |
williamr@4 | 102 |
*/ |
williamr@4 | 103 |
virtual TAny* ContactStoreListExtension(TUid /*aExtensionUid*/) |
williamr@4 | 104 |
{ return NULL; } |
williamr@4 | 105 |
|
williamr@4 | 106 |
}; |
williamr@4 | 107 |
|
williamr@4 | 108 |
#endif // MVPBKCONTACTSTORELIST_H |
williamr@4 | 109 |
|
williamr@4 | 110 |
//End of file |