|
1 /* |
|
2 * Copyright (c) 2006 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: Contact store |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHCNTCONTACTSTORES_H |
|
20 #define CPHCNTCONTACTSTORES_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <MVPbkContactStoreListObserver.h> |
|
24 #include <MVPbkSingleContactOperationObserver.h> |
|
25 #include "MPhCntContactStores.h" |
|
26 |
|
27 class MVPbkContactLink; |
|
28 class MPhCntContactManager; |
|
29 class MPhCntContactFetchObserver; |
|
30 |
|
31 |
|
32 /** |
|
33 * Contact store, where contact can be fetched. |
|
34 * |
|
35 * @lib PhoneCntFinder |
|
36 * @since S60 v3.1 |
|
37 */ |
|
38 NONSHARABLE_CLASS( CPhCntContactStores ): |
|
39 public CBase, |
|
40 public MPhCntContactStores, |
|
41 public MVPbkSingleContactOperationObserver |
|
42 { |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Static constructor. |
|
47 * |
|
48 * @since S60 v3.1 |
|
49 * @param aContactManager Contact manager. |
|
50 */ |
|
51 static CPhCntContactStores* NewL( MPhCntContactManager& aContactManager ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 * |
|
56 * @since S60 v3.1 |
|
57 */ |
|
58 ~CPhCntContactStores(); |
|
59 |
|
60 // from base class MPhCntContactStores |
|
61 |
|
62 /** |
|
63 * From MPhCntContactStores. |
|
64 * |
|
65 * @since S60 v3.1 |
|
66 * @see MPhCntContactStores |
|
67 */ |
|
68 TBool IsRequestActive() const; |
|
69 |
|
70 /** |
|
71 * From MPhCntContactStores. |
|
72 * |
|
73 * @since S60 v3.1 |
|
74 * @see MPhCntContactStores |
|
75 */ |
|
76 void CancelRequest(); |
|
77 |
|
78 /** |
|
79 * From MPhCntContactStores. |
|
80 * |
|
81 * @since S60 v3.1 |
|
82 * @see MPhCntContactStores |
|
83 */ |
|
84 void FetchContactL( const MVPbkContactLink& aLink, |
|
85 MPhCntContactFetchObserver& aObserver ); |
|
86 |
|
87 /** |
|
88 * From MPhCntContactStores. |
|
89 * |
|
90 * @since S60 v3.1 |
|
91 * @see MPhCntContactStores |
|
92 */ |
|
93 void FetchFirstContactL( const TDesC8& aContactLinks, |
|
94 MPhCntContactFetchObserver& aObserver ); |
|
95 |
|
96 /** |
|
97 * From MPhCntContactStores. |
|
98 * |
|
99 * @since S60 v3.1 |
|
100 * @see MPhCntContactStores |
|
101 */ |
|
102 CVPbkContactLinkArray* CreateContactLinkArrayL( |
|
103 const TDesC8& aContactLinks ); |
|
104 |
|
105 // From base class MVPbkSingeContactOperationObserver |
|
106 |
|
107 /** |
|
108 * From MVPbkSingeContactOperationObserver. |
|
109 * |
|
110 * @since S60 v3.1 |
|
111 * @see MVPbkSingeContactOperationObserver |
|
112 */ |
|
113 void VPbkSingleContactOperationComplete( |
|
114 MVPbkContactOperationBase& aOperation, |
|
115 MVPbkStoreContact* aContact); |
|
116 |
|
117 /** |
|
118 * From MVPbkSingeContactOperationObserver. |
|
119 * |
|
120 * @since S60 v3.1 |
|
121 * @see MVPbkSingeContactOperationObserver |
|
122 */ |
|
123 void VPbkSingleContactOperationFailed( |
|
124 MVPbkContactOperationBase& aOperation, |
|
125 TInt aError ); |
|
126 |
|
127 protected: |
|
128 |
|
129 CPhCntContactStores( MPhCntContactManager& aContactManager ); |
|
130 |
|
131 void ConstructL(); |
|
132 |
|
133 private: |
|
134 |
|
135 /** |
|
136 * Handle to virtual phonebook. |
|
137 * Not Own. |
|
138 */ |
|
139 MPhCntContactManager& iContactManager; |
|
140 |
|
141 /** |
|
142 * Contact fetch operation observer. |
|
143 * Not own. |
|
144 */ |
|
145 MPhCntContactFetchObserver* iContactFetchObserver; |
|
146 |
|
147 /** |
|
148 * Contact operation |
|
149 * Own |
|
150 */ |
|
151 MVPbkContactOperationBase* iRetrieveContactOperation; |
|
152 |
|
153 /** |
|
154 * Link is stored here during the fetch. |
|
155 * Own. |
|
156 */ |
|
157 MVPbkContactLink* iLink; |
|
158 |
|
159 }; |
|
160 |
|
161 |
|
162 #endif // CPHCNTCONTACTSTORES_H |