contacts_plat/virtual_phonebook_store_api/inc/CVPbkContactStoreList.h
changeset 0 e686773b3f54
child 32 2828b4d142c0
--- /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 <e32base.h>
+#include <mvpbkcontactstorelist.h>
+#include <mvpbkcontactstoreobserver.h>
+
+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<MVPbkContactStore> iStores;
+        /// Ref: a references to the stores that are opened
+        RPointerArray<MVPbkContactStore> iStoresToOpen;
+        /// Ref: the observer of this list.
+        MVPbkContactStoreListObserver* iObserver;
+    };
+
+
+#endif // CVPBKCONTACTSTORELIST_H
+
+// End of File