63
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
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".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: A class for store list implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CVPBKCONTACTSTORELIST_H
|
|
20 |
#define CVPBKCONTACTSTORELIST_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <MVPbkContactStoreList.h>
|
|
24 |
#include <MVPbkContactStoreObserver.h>
|
|
25 |
|
|
26 |
class TVPbkContactStoreUriPtr;
|
|
27 |
class CVPbkContactStoreUriArray;
|
|
28 |
|
|
29 |
|
|
30 |
/**
|
|
31 |
* A class for store list implementation
|
|
32 |
*
|
|
33 |
* @lib VPbkEng.lib
|
|
34 |
*/
|
|
35 |
class CVPbkContactStoreList :
|
|
36 |
public CBase,
|
|
37 |
public MVPbkContactStoreList,
|
|
38 |
private MVPbkContactStoreObserver
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
/**
|
|
42 |
* Constructor.
|
|
43 |
* @return A new instance of this class
|
|
44 |
*/
|
|
45 |
IMPORT_C static CVPbkContactStoreList* NewL();
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Destructor. Destroys all stores.
|
|
49 |
*/
|
|
50 |
virtual ~CVPbkContactStoreList();
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Appends a new store to the list. Ownership is taken.
|
|
54 |
*
|
|
55 |
* @param aStore a new store to the list. Ownership is taken.
|
|
56 |
*/
|
|
57 |
IMPORT_C void AppendL( MVPbkContactStore* aStore );
|
|
58 |
|
|
59 |
public: // from MVPbkContactStoreList
|
|
60 |
TInt Count() const;
|
|
61 |
MVPbkContactStore& At( TInt aIndex ) const;
|
|
62 |
MVPbkContactStore* Find( const TVPbkContactStoreUriPtr& aUri ) const;
|
|
63 |
void OpenAllL( MVPbkContactStoreListObserver& aObserver );
|
|
64 |
void CloseAll( MVPbkContactStoreListObserver& aObserver );
|
|
65 |
|
|
66 |
private: // from MVPbkContactStoreObserver
|
|
67 |
void StoreReady( MVPbkContactStore& aContactStore );
|
|
68 |
void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason );
|
|
69 |
void HandleStoreEventL(
|
|
70 |
MVPbkContactStore& aContactStore,
|
|
71 |
TVPbkContactStoreEvent aStoreEvent);
|
|
72 |
|
|
73 |
private: // implementation
|
|
74 |
void SignalOpenComplete();
|
|
75 |
|
|
76 |
private: // implementation
|
|
77 |
CVPbkContactStoreList();
|
|
78 |
|
|
79 |
private: // data
|
|
80 |
/// Own: an array that owns the store instances
|
|
81 |
RPointerArray<MVPbkContactStore> iStores;
|
|
82 |
/// Ref: a references to the stores that are opened
|
|
83 |
RPointerArray<MVPbkContactStore> iStoresToOpen;
|
|
84 |
/// Ref: the observer of this list.
|
|
85 |
MVPbkContactStoreListObserver* iObserver;
|
|
86 |
};
|
|
87 |
|
|
88 |
|
|
89 |
#endif // CVPBKCONTACTSTORELIST_H
|
|
90 |
|
|
91 |
// End of File
|