author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 27 Aug 2009 07:43:07 +0300 | |
changeset 22 | fc9cf246af83 |
parent 19 | 989d2f495d90 |
child 24 | f4292e0e20df |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 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 the License "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: Observer for getlist api of contact service. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_GETLISTSTORELISTOBSERVER_H |
|
20 |
#define C_GETLISTSTORELISTOBSERVER_H |
|
21 |
||
22 |
#include <CVPbkContactManager.h> |
|
23 |
#include <MVPbkContactStoreObserver.h> |
|
24 |
||
25 |
#include "contactservice.h" |
|
26 |
#include "contactcallback.h" |
|
27 |
#include "contactservice.hrh" |
|
28 |
||
29 |
class CContactService; |
|
30 |
class CContactIter; |
|
31 |
class CContactViewObserver; |
|
32 |
||
33 |
||
34 |
/** |
|
35 |
* This class has methods for handling the return from Async open of a contacts database. |
|
36 |
*/ |
|
37 |
||
38 |
class CGetListStoreListObserver:public CBase, |
|
39 |
public MVPbkContactStoreListObserver, |
|
40 |
public MCancelAsync |
|
41 |
{ |
|
42 |
||
43 |
||
44 |
||
45 |
public: |
|
46 |
||
47 |
static CGetListStoreListObserver* NewL(const TDesC& aUri, |
|
48 |
const TDesC8& aContactId, |
|
49 |
const TDesC& aSearchVal, |
|
50 |
CSearchFields* aSearchFields, |
|
51 |
TOrder aSortOrder, |
|
52 |
MContactCallback *aCallback, |
|
53 |
CContactService *aContactService, |
|
54 |
CContactIter* aIter, |
|
55 |
Ttype atype, |
|
56 |
TInt aTransId, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
57 |
MVPbkContactStore* aContactStore, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
58 |
TCmdType val); |
19 | 59 |
|
60 |
~CGetListStoreListObserver(); |
|
61 |
||
62 |
/* |
|
63 |
* Implementation of Cancel of MCancelAsync |
|
64 |
*/ |
|
65 |
void Cancel(); |
|
66 |
||
67 |
private: // from MVPbkContactStoreListObserver |
|
68 |
||
69 |
void ConstructL(const TDesC8& aContactId, const TDesC& aSearchVal); |
|
70 |
/** |
|
71 |
* An indication that the contact store is ready. |
|
72 |
* |
|
73 |
* @param aContactStore A reference to the store sending the indication. |
|
74 |
* @return None. |
|
75 |
*/ |
|
76 |
void StoreReady( MVPbkContactStore& aContactStore ); |
|
77 |
||
78 |
/** |
|
79 |
* An indication that the contact store is not ready. |
|
80 |
* |
|
81 |
* @param aContactStore A reference to the store sending the indication. |
|
82 |
* @param aReason An error code defining the reason for unavailability. |
|
83 |
* @return None. |
|
84 |
*/ |
|
85 |
void StoreUnavailable( MVPbkContactStore& aContactStore, |
|
86 |
TInt aReason ); |
|
87 |
||
88 |
/** |
|
89 |
* An indication for a contact store event. |
|
90 |
* |
|
91 |
* @param aContactStore A reference to the store sending the indication. |
|
92 |
* @param aStoreEvent The contact store event. |
|
93 |
* @return None. |
|
94 |
*/ |
|
95 |
void HandleStoreEventL( MVPbkContactStore& aContactStore, |
|
96 |
TVPbkContactStoreEvent aStoreEvent ); |
|
97 |
||
98 |
/** |
|
99 |
* An indication that the contact store is opened successfully. |
|
100 |
* |
|
101 |
* @return None. |
|
102 |
*/ |
|
103 |
void OpenComplete(); |
|
104 |
||
105 |
private: |
|
106 |
||
107 |
CGetListStoreListObserver(const TDesC& aUri, |
|
108 |
const TDesC8& aContactId, const TDesC& aSearchVal, |
|
109 |
CSearchFields* aSearchFields, |
|
110 |
TOrder aSortOrder,MContactCallback *aCallback, |
|
111 |
CContactService *aContactService, |
|
112 |
CContactIter* aIter, enum Ttype atype, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
113 |
TInt aTransId,MVPbkContactStore* aContactStore, TCmdType val); |
19 | 114 |
|
115 |
/** |
|
116 |
* Sets the view of the database and also creates a filtered view |
|
117 |
*/ |
|
118 |
void CreateAndFilterViewL(MVPbkContactStore& aContactStore); |
|
119 |
||
120 |
||
121 |
private: |
|
122 |
//Store Uri |
|
123 |
TBufC<KMaxPath> iUri; |
|
124 |
||
125 |
//ContactId |
|
126 |
HBufC8* iContactId; |
|
127 |
||
128 |
//Search Value |
|
129 |
HBufC* iSearchVal; |
|
130 |
||
131 |
//Fields to search in |
|
132 |
CSearchFields* iSearchFields; |
|
133 |
//Default list for search fields |
|
134 |
CVPbkFieldTypeRefsList* iFieldsList; |
|
135 |
//Order in which the result is to be sorted |
|
136 |
TOrder iSortOrder; |
|
137 |
||
138 |
//Callback function |
|
139 |
MContactCallback *iCallback; |
|
140 |
||
141 |
//Pointer to Contact service |
|
142 |
CContactService *iContactService; |
|
143 |
//Output param |
|
144 |
CContactIter* iIter; |
|
145 |
||
146 |
//Search on Contacts/Groups/Databases |
|
147 |
Ttype iType; |
|
148 |
||
149 |
//Transaction Id |
|
150 |
TInt iTransId; |
|
151 |
||
152 |
/* |
|
153 |
* Pointer to contact store instance. |
|
154 |
*/ |
|
155 |
MVPbkContactStore* iContactStore; |
|
156 |
||
157 |
/* |
|
158 |
* RetrieveL() Handle |
|
159 |
*/ |
|
160 |
MVPbkContactOperationBase* iRetOp; |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
161 |
TCmdType iVal; |
19 | 162 |
}; |
163 |
||
164 |
#endif//C_GETLISTSTORELISTOBSERVER_H |