epoc32/include/app/MVPbkContactStoreList.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/MVPbkContactStoreList.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,110 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  An interface for a list of contact stores.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef MVPBKCONTACTSTORELIST_H
    1.23 +#define MVPBKCONTACTSTORELIST_H
    1.24 +
    1.25 +// INCLUDES
    1.26 +#include <e32std.h>
    1.27 +
    1.28 +// FORWARD DECLARATIONS
    1.29 +class MVPbkContactStore;
    1.30 +class MVPbkContactStoreListObserver;
    1.31 +class TVPbkContactStoreUriPtr;
    1.32 +
    1.33 +
    1.34 +// CLASS DECLARATIONS
    1.35 +/**
    1.36 + * An interface for a list of contact stores.
    1.37 + *
    1.38 + * The interface provides an access to multiple stores. It's possible to open
    1.39 + * and close all stores in single call using this interface. When client calls
    1.40 + * OpenAllL it must also calls CloseAll after usage.
    1.41 + *
    1.42 + * @see CVPbkContactManager::ContactStoresL
    1.43 + */
    1.44 +class MVPbkContactStoreList
    1.45 +    {
    1.46 +    public: // interface
    1.47 +        virtual ~MVPbkContactStoreList() { }
    1.48 +
    1.49 +        /**
    1.50 +         * Returns the number of stores in the list.
    1.51 +         *
    1.52 +         * @return The number of stores in the list.
    1.53 +         */
    1.54 +        virtual TInt Count() const =0;
    1.55 +
    1.56 +        /**
    1.57 +         * Returns the store in given index in the list.
    1.58 +         *
    1.59 +         * @param aIndex the index of the store in the list
    1.60 +         * @precond aIndex >= 0 && aIndex < Count()
    1.61 +         *              VPbkError::Panic(VPbkError::EInvalidStoreIndex)
    1.62 +         *              is raised if the precondition does not hold.
    1.63 +         * @return The store in the specified index.
    1.64 +         */
    1.65 +        virtual MVPbkContactStore& At(TInt aIndex) const =0;
    1.66 +
    1.67 +        /**
    1.68 +         * Finds the contact store corresponding to the aUri.
    1.69 +         *
    1.70 +         * @param aUri the store URI to search for.
    1.71 +         * @return The contact store corresponding to the aUri or NULL.
    1.72 +         */
    1.73 +        virtual MVPbkContactStore* Find(
    1.74 +            const TVPbkContactStoreUriPtr& aUri) const =0;
    1.75 +
    1.76 +        /**
    1.77 +         * Opens all stores in the list asynchronously.
    1.78 +         *
    1.79 +         * A client can not use stores before it has successfully opened
    1.80 +         * them. CloseAll must be always called by the same observer that has
    1.81 +         * opened stores.
    1.82 +         *
    1.83 +         * NOTE: There can be only one observer for one store list at a time.
    1.84 +         *
    1.85 +         * @param aObserver An observer for the stores.
    1.86 +         * @exception KErrInUse If one observer is currently opening this list.
    1.87 +         */
    1.88 +        virtual void OpenAllL(MVPbkContactStoreListObserver& aObserver) =0;
    1.89 +
    1.90 +        /**
    1.91 +         * Closes all stores in the list.
    1.92 +         *
    1.93 +         * This is safe to call in all circumstances. Implementations
    1.94 +         * can not trust that OpenAllL has been called before.
    1.95 +         *
    1.96 +         * @param aObserver An observer for the close process.
    1.97 +         */
    1.98 +        virtual void CloseAll(MVPbkContactStoreListObserver& aObserver) =0;
    1.99 +
   1.100 +        /**
   1.101 +         * Returns an extension point for this interface or NULL.
   1.102 +         *
   1.103 +         * @param aExtensionUid no extensions defined currently.
   1.104 +         * @return an extension point for this interface or NULL.
   1.105 +         */
   1.106 +        virtual TAny* ContactStoreListExtension(TUid /*aExtensionUid*/) 
   1.107 +                { return NULL; }
   1.108 +
   1.109 +    };
   1.110 +
   1.111 +#endif // MVPBKCONTACTSTORELIST_H
   1.112 +
   1.113 +//End of file