author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:28:47 +0100 | |
branch | RCL_3 |
changeset 45 | a9c0808a1095 |
parent 27 | 02682e02e51f |
permissions | -rw-r--r-- |
5 | 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: Implementation of the add contact observer functionality. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
//User include |
|
20 |
#include "addcontactobserver.h" |
|
21 |
#include "contactcallback.h" |
|
22 |
||
23 |
//System include |
|
24 |
#include "contactservice.h"// for iContactService |
|
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
25 |
#include <MVPbkContactStore.h>// for iContactStore |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
26 |
#include <MVPbkStoreContact.h>// used in many function to get the store contact |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
27 |
#include <MVPbkContactOperationBase.h>//for observer |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
28 |
#include <MVPbkContactLink.h>//for param in ContactsSaved() |
5 | 29 |
#include <MVPbkContactGroup.h> |
30 |
#include <MVPbkContactFieldTextData.h> |
|
31 |
#include <MVPbkContactFieldData.h> |
|
32 |
#include <MVPbkContactFieldBinaryData.h> |
|
33 |
#include <MVPbkContactFieldDateTimeData.h> |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
34 |
#include <MVPbkContactFieldUriData.h> |
5 | 35 |
|
36 |
/* |
|
37 |
------------------------------------------------------------------------------------- |
|
38 |
CAddContactObserver::NewL( CContactService* aContactService, |
|
39 |
MVPbkContactStore* aContactStore, |
|
40 |
CSingleContact* aStoreContact, |
|
41 |
const TDesC8& aGroupId, |
|
42 |
const TDesC& aGroupLabel, |
|
43 |
TInt aTransId, |
|
44 |
MContactCallback* aCallback) |
|
45 |
Description : Static method to create instance of add contact observer. |
|
46 |
Return values : CAddContactObserver* |
|
47 |
------------------------------------------------------------------------------------- |
|
48 |
*/ |
|
49 |
CAddContactObserver* CAddContactObserver::NewL(CContactService* aContactService, |
|
50 |
MVPbkContactStore* aContactStore, |
|
51 |
CSingleContact* aStoreContact, |
|
52 |
const TDesC8& aGroupId, |
|
53 |
const TDesC& aGroupLabel, |
|
54 |
TInt aTransId, |
|
55 |
MContactCallback* aCallback) |
|
56 |
{ |
|
57 |
||
58 |
CAddContactObserver* self = new( ELeave ) |
|
59 |
CAddContactObserver(aContactService, |
|
60 |
aContactStore, |
|
61 |
aStoreContact, |
|
62 |
aTransId, |
|
63 |
aCallback); |
|
64 |
||
65 |
||
66 |
CleanupStack::PushL(self); |
|
67 |
self->ConstructL(aGroupId,aGroupLabel); |
|
68 |
CleanupStack::Pop(self); |
|
69 |
return self; |
|
70 |
} |
|
71 |
||
72 |
/* |
|
73 |
------------------------------------------------------------------------------------- |
|
74 |
CAddContactObserver::CAddContactObserver(CVPbkContactManager* aContactManager, |
|
75 |
MVPbkContactStore* aContactStore, |
|
76 |
CSingleContact* aStoreContact, |
|
77 |
TInt aTransId, |
|
78 |
MContactCallback* aCallback) |
|
79 |
Description : This is the default constructor |
|
80 |
Return values : N/A |
|
81 |
------------------------------------------------------------------------------------- |
|
82 |
*/ |
|
83 |
||
84 |
CAddContactObserver::CAddContactObserver( CContactService* aContactService, |
|
85 |
MVPbkContactStore* aContactStore, |
|
86 |
CSingleContact* aStoreContact, |
|
87 |
TInt aTransId, |
|
88 |
MContactCallback* aCallback ) |
|
89 |
{ |
|
90 |
iContactService = aContactService; |
|
91 |
iContactStore = aContactStore; |
|
92 |
iStoreContact = aStoreContact; |
|
93 |
iGroupId = NULL; |
|
94 |
iGroupLabel = NULL; |
|
95 |
iTransId = aTransId; |
|
96 |
iCallback = aCallback; |
|
97 |
iLockFlag = EFalse; |
|
98 |
iContact = NULL; |
|
99 |
iGroup = NULL; |
|
100 |
iOp = NULL; |
|
101 |
iErrorID = 0; |
|
102 |
} |
|
103 |
||
104 |
void CAddContactObserver::ConstructL(const TDesC8& aGroupId, |
|
105 |
const TDesC& aGroupLabel) |
|
106 |
{ |
|
107 |
iGroupId = HBufC8 :: NewL(aGroupId.Length()); |
|
108 |
*iGroupId = aGroupId; |
|
109 |
||
110 |
iGroupLabel = HBufC :: NewL(aGroupLabel.Length()); |
|
111 |
*iGroupLabel = aGroupLabel; |
|
112 |
} |
|
113 |
||
114 |
||
115 |
/* |
|
116 |
------------------------------------------------------------------------------------- |
|
117 |
CAddContactObserver::~CAddContactObserver() |
|
118 |
Description : Destructor |
|
119 |
Return values : N/A |
|
120 |
------------------------------------------------------------------------------------- |
|
121 |
*/ |
|
122 |
||
123 |
CAddContactObserver::~CAddContactObserver() |
|
124 |
{ |
|
125 |
delete iGroupId; |
|
126 |
delete iGroupLabel; |
|
127 |
delete iContact; |
|
128 |
delete iGroup; |
|
129 |
if(iOp) |
|
130 |
{ |
|
131 |
delete iOp; |
|
132 |
} |
|
133 |
||
134 |
if(iContactStore) |
|
135 |
{ |
|
136 |
iContactStore->Close(*this); |
|
137 |
} |
|
138 |
} |
|
139 |
||
140 |
/* |
|
141 |
------------------------------------------------------------------------------------- |
|
142 |
CAddContactObserver::Cancel() |
|
143 |
Description : Cancel implementation relevant to AddObserver |
|
144 |
Return values : KErrorNone on Success and KErrGeneral on Failure |
|
145 |
------------------------------------------------------------------------------------- |
|
146 |
*/ |
|
147 |
||
148 |
void CAddContactObserver::Cancel() |
|
149 |
{ |
|
150 |
iCallback->HandleReturnValue(EOpCancel, KErrNone, iTransId); |
|
151 |
delete this; |
|
152 |
} |
|
153 |
||
154 |
/* |
|
155 |
------------------------------------------------------------------------------------- |
|
156 |
CAddContactObserver::CreateAndAddFieldToContactL() |
|
157 |
Description : This method creates the contact field and adds to the data base. |
|
158 |
Return values : N/A |
|
159 |
------------------------------------------------------------------------------------- |
|
160 |
*/ |
|
161 |
void CAddContactObserver::CreateAndAddFieldToContactL() |
|
162 |
{ |
|
163 |
TPtrC8 fieldKey(KNullDesC8); |
|
164 |
TPtrC label(KNullDesC); |
|
165 |
TPtrC value(KNullDesC); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
166 |
TBool labelFound = EFalse; |
5 | 167 |
iErrorID = 0; |
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
168 |
TBuf16<100> bufVal; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
169 |
int len =0; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
170 |
TBool xspidField = EFalse; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
171 |
TBool secTime = EFalse; |
5 | 172 |
TInt fieldCount = iStoreContact->FieldCount(); |
173 |
const CVPbkContactManager* contactManager = &(iContactService->GetContactManager()); |
|
174 |
for(TInt index = 0; index < fieldCount; index++) |
|
175 |
{ |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
176 |
xspidField = EFalse; |
5 | 177 |
CSingleContactField* field = iStoreContact->FieldAt(index); |
178 |
||
179 |
field->GetFieldDataL(fieldKey, label, value); |
|
180 |
TInt fieldTypeResId = CSearchFields::GetIdFromFieldKey(fieldKey); |
|
181 |
iErrorID = fieldTypeResId; |
|
182 |
MVPbkStoreContactField* cntField = |
|
183 |
iContact->CreateFieldLC( * contactManager->FieldTypes().Find( fieldTypeResId ) ); |
|
184 |
||
185 |
iErrorID = 0; |
|
186 |
||
187 |
TVPbkFieldStorageType storageType = cntField->FieldData().DataType(); |
|
188 |
||
189 |
if( EVPbkFieldStorageTypeBinary == storageType ) |
|
190 |
{ |
|
191 |
//(MVPbkContactFieldBinaryData::Cast(cntField->FieldData())).SetBinaryDataL( value8bit ); |
|
192 |
} |
|
193 |
else if( EVPbkFieldStorageTypeDateTime == storageType ) |
|
194 |
{ |
|
195 |
TTime timeVal = field->GetDateTime(); |
|
196 |
(MVPbkContactFieldDateTimeData::Cast(cntField->FieldData())).SetDateTime( timeVal ); |
|
197 |
} |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
198 |
else if(EVPbkFieldStorageTypeUri == storageType ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
199 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
200 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
201 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
202 |
xspidField = ETrue; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
203 |
RPointerArray<HBufC> xspidArray; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
204 |
//CleanupClosePushL(xspidArray); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
205 |
field->GetXspidDataL(xspidArray); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
206 |
TInt count = xspidArray.Count(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
207 |
for(int i=0; i<count; i++) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
208 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
209 |
if(secTime != EFalse) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
210 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
211 |
fieldTypeResId = CSearchFields::GetIdFromFieldKey(fieldKey); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
212 |
iErrorID = fieldTypeResId; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
213 |
cntField = iContact->CreateFieldLC( * contactManager->FieldTypes().Find( fieldTypeResId ) ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
214 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
215 |
iErrorID = 0; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
216 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
217 |
storageType = cntField->FieldData().DataType(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
218 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
219 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
220 |
secTime = ETrue; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
221 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
222 |
HBufC* val = xspidArray[i]; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
223 |
bufVal.Copy(val->Des()); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
224 |
TDes16 desVal = bufVal; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
225 |
TPtrC ptrVal; //desVal.Left(0); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
226 |
TInt valLen = val->Length(); |
27
02682e02e51f
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
227 |
//(MVPbkContactFieldUriData::Cast(cntField->FieldData())).SetUriL( bufVal ); |
02682e02e51f
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
228 |
(static_cast<MVPbkContactFieldUriData&>(cntField->FieldData())).SetUriL( bufVal ); |
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
229 |
len = val->Find(_L(":")); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
230 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
231 |
if(len != -1) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
232 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
233 |
TInt trimLen = valLen - len; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
234 |
ptrVal.Set(val->Left(valLen - (trimLen))); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
235 |
len =0; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
236 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
237 |
TRAP_IGNORE(cntField->SetFieldLabelL(ptrVal)); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
238 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
239 |
iContact->AddFieldL(cntField); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
240 |
CleanupStack::Pop(); //cntField |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
241 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
242 |
else |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
243 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
244 |
CleanupStack::Pop(); //cntField |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
245 |
User::Leave(KErrArgument); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
246 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
247 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
248 |
// delete val; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
249 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
250 |
xspidArray.Reset(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
251 |
//CleanupStack::Pop(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
252 |
} |
5 | 253 |
else |
254 |
{ |
|
255 |
(MVPbkContactFieldTextData::Cast(cntField->FieldData())).SetTextL( value ); |
|
256 |
} |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
257 |
if(xspidField == EFalse) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
258 |
{ |
5 | 259 |
TRAP_IGNORE(cntField->SetFieldLabelL(label)); |
260 |
||
261 |
iContact->AddFieldL(cntField); |
|
262 |
||
263 |
CleanupStack::Pop(); //cntField |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
264 |
} |
5 | 265 |
} |
266 |
} |
|
267 |
||
268 |
||
269 |
/* |
|
270 |
------------------------------------------------------------------------------------- |
|
271 |
CAddContactObserver::DoAddL() |
|
272 |
Description : Called for 1) Adding a new contact/group to the contacts database. |
|
273 |
2) Editing a contact/group from the contacts database. |
|
274 |
Return values : N/A |
|
275 |
------------------------------------------------------------------------------------- |
|
276 |
*/ |
|
277 |
void CAddContactObserver::DoAddL() |
|
278 |
{ |
|
279 |
//if iStoreContact is non-null pointer then it is a new contact or existing contact. |
|
280 |
if( iStoreContact ) |
|
281 |
{ |
|
282 |
//get contact id from the contact. |
|
283 |
TPtrC8 cntId = iStoreContact->GetContactId(); |
|
284 |
//If cntId is null then it is new contact, get the fields from the CSingleContact |
|
285 |
//create new contact, add the fields to it and commit the contact. |
|
286 |
if( cntId == KNullDesC8 ) |
|
287 |
{ |
|
288 |
iContact = iContactStore->CreateNewContactLC(); |
|
289 |
CleanupStack::Pop(); //contact |
|
290 |
||
291 |
CreateAndAddFieldToContactL(); |
|
292 |
||
293 |
iContact->CommitL(*this); |
|
294 |
||
295 |
} |
|
296 |
else //Edit contact : retrieve contact and update the fields and commit. |
|
297 |
{ |
|
298 |
const CVPbkContactManager* contactManager = &(iContactService->GetContactManager()); |
|
299 |
MVPbkContactLinkArray* linkArray = contactManager->CreateLinksLC(cntId); |
|
300 |
const MVPbkContactLink* link = &(linkArray->At(0)); |
|
301 |
CleanupStack::Pop(); //linkArray |
|
302 |
MVPbkContactOperationBase* iOp =contactManager->RetrieveContactL(*link, *this); |
|
303 |
} |
|
304 |
} |
|
305 |
//group id is not null and grp label is not null then exiting grp, |
|
306 |
//retrieve the grp,and edit the label. |
|
307 |
else if( *iGroupId != KNullDesC8 && *iGroupLabel != KNullDesC ) |
|
308 |
{ |
|
309 |
const CVPbkContactManager* contactManager = &(iContactService->GetContactManager()); |
|
310 |
MVPbkContactLinkArray* linkArray = contactManager->CreateLinksLC(*iGroupId); |
|
311 |
const MVPbkContactLink* link = &(linkArray->At(0)); |
|
312 |
CleanupStack::Pop(); //linkArray |
|
313 |
contactManager->RetrieveContactL(*link, *this); |
|
314 |
} |
|
315 |
//if grp id is null and grp label is non-null then, create new grp and set the label. |
|
316 |
else if( *iGroupId == KNullDesC8 && *iGroupLabel != KNullDesC ) |
|
317 |
{ |
|
318 |
iGroup = iContactStore->CreateNewContactGroupLC(); |
|
319 |
iGroup->SetGroupLabelL(*iGroupLabel); |
|
320 |
iGroup->CommitL( *this ); |
|
321 |
CleanupStack::Pop(); //group |
|
322 |
} |
|
323 |
} |
|
324 |
||
325 |
/* |
|
326 |
------------------------------------------------------------------------------------- |
|
327 |
CAddContactObserver::DoCommitL() |
|
328 |
Description : Commit contact to the contacts database. |
|
329 |
Return values : TInt |
|
330 |
------------------------------------------------------------------------------------- |
|
331 |
*/ |
|
332 |
TInt CAddContactObserver::DoCommitL( TContactOpResult aResult ) |
|
333 |
{ |
|
334 |
TInt retVal = KErrGeneral; |
|
335 |
||
336 |
//if lockflag is true, opcode is EContactLock, group id is not null |
|
337 |
//and grp label is not null then exiting grp, get ptr to grp from |
|
338 |
//contact and edit the label and commit the same. |
|
339 |
if( iLockFlag && |
|
340 |
aResult.iOpCode == EContactLock && |
|
341 |
((*iGroupId != KNullDesC8) && (*iGroupLabel != KNullDesC)) ) |
|
342 |
{ |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
343 |
MVPbkContactGroup* grpintf = iContact->Group(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
344 |
if(grpintf != NULL) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
345 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
346 |
grpintf->SetGroupLabelL(*iGroupLabel); |
5 | 347 |
(iContact->Group())->CommitL(*this); |
348 |
//set lock flag to false, as it is done. |
|
349 |
iLockFlag = EFalse; |
|
350 |
//set return value to ErrNone...completed successfully. |
|
351 |
retVal = KErrNone; |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
352 |
} |
5 | 353 |
} |
354 |
//lock is success, so update the fields in the contact and commit. |
|
355 |
else if( iLockFlag && aResult.iOpCode == EContactLock ) |
|
356 |
{ |
|
357 |
//remove all the fields from the original contact. |
|
358 |
iContact->RemoveAllFields(); |
|
359 |
||
360 |
//add new fields to the contact; |
|
361 |
CreateAndAddFieldToContactL( ); |
|
362 |
||
363 |
//added all the fields...commit the contact. |
|
364 |
iContact->CommitL( *this ); |
|
365 |
//set lock flag to false, as it is done. |
|
366 |
iLockFlag = EFalse; |
|
367 |
//set return value to ErrNone...completed successfully. |
|
368 |
retVal = KErrNone; |
|
369 |
} |
|
370 |
else if( aResult.iOpCode == EContactCommit ) |
|
371 |
{ |
|
372 |
retVal = KErrNone; |
|
373 |
} |
|
374 |
||
375 |
return retVal; |
|
376 |
} |
|
377 |
||
378 |
/* |
|
379 |
------------------------------------------------------------------------------------- |
|
380 |
void CAddContactObserver::DoEditContactOrGroupL(MVPbkStoreContact* aContact) |
|
381 |
Description : This method is used to edit the group,it locks |
|
382 |
the contact to be edited and performs the edit operation. |
|
383 |
Return values : N/A |
|
384 |
------------------------------------------------------------------------------------- |
|
385 |
*/ |
|
386 |
void CAddContactObserver::DoEditContactOrGroupL(MVPbkStoreContact* aContact) |
|
387 |
{ |
|
388 |
//Edit contact : lock the contact for edit operation. |
|
389 |
iLockFlag = ETrue; |
|
390 |
aContact->LockL(*this); |
|
391 |
if(!iContact ) |
|
392 |
{ |
|
393 |
iContact = aContact; |
|
394 |
} |
|
395 |
} |
|
396 |
||
397 |
||
398 |
/* |
|
399 |
------------------------------------------------------------------------------------- |
|
400 |
CAddContactObserver::ContactOperationCompleted( TContactOpResult aResult ) |
|
401 |
Description : Virtual Phonebook Observer method called back once |
|
402 |
the contact operation is completed successfully. |
|
403 |
Return values : N/A |
|
404 |
------------------------------------------------------------------------------------- |
|
405 |
*/ |
|
406 |
void CAddContactObserver::ContactOperationCompleted( TContactOpResult aResult ) |
|
407 |
{ |
|
408 |
//if lock operation is successfull then it enters here... |
|
409 |
//call DoCommitL(), to commit the contact into the contact store. |
|
410 |
TRAPD(error, error = DoCommitL(aResult)); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
411 |
if(error == KErrNone) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
412 |
{ |
5 | 413 |
//notify the user with the status of the operation. |
414 |
if((aResult.iOpCode != EContactLock) || (error != KErrNone)) |
|
415 |
{ |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
416 |
//iContactService->RequestComplete(iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
417 |
//iCallback->HandleReturnValue(EOpComplete, error, iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
418 |
if(iGroupLabel->Compare(KNullDesC) != 0) //.Compare(KNullDesC)) != 0) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
419 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
420 |
if(iGroup != NULL) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
421 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
422 |
iContactService->RequestComplete(iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
423 |
MVPbkContactLink* link = iGroup->CreateLinkLC(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
424 |
HBufC8* grpId = link->PackLC(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
425 |
CleanupStack::Pop(grpId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
426 |
iCallback->HandleReturnId(error, grpId, iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
427 |
CleanupStack::PopAndDestroy(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
428 |
//delete grpId; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
429 |
delete this; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
430 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
431 |
else |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
432 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
433 |
iContactService->RequestComplete(iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
434 |
iCallback->HandleReturnValue(EOpComplete, error, iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
435 |
delete this; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
436 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
437 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
438 |
else |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
439 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
440 |
if(iContact != NULL) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
441 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
442 |
iContactService->RequestComplete(iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
443 |
MVPbkContactLink* link = iContact->CreateLinkLC(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
444 |
HBufC8* cntId = link->PackLC(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
445 |
CleanupStack::Pop(cntId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
446 |
iCallback->HandleReturnId(error, cntId, iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
447 |
CleanupStack::PopAndDestroy(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
448 |
// delete cntId; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
449 |
delete this; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
450 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
451 |
else |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
452 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
453 |
iContactService->RequestComplete(iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
454 |
iCallback->HandleReturnValue(EOpComplete, error, iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
455 |
delete this; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
456 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
457 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
458 |
} |
5 | 459 |
} |
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
460 |
else |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
461 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
462 |
iContactService->RequestComplete(iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
463 |
iCallback->HandleReturnValue(EOpError, error, iTransId); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
464 |
delete this; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
465 |
} |
5 | 466 |
} |
467 |
||
468 |
/* |
|
469 |
------------------------------------------------------------------------------------- |
|
470 |
CAddContactObserver::ContactOperationFailed(TContactOp aOpCode, |
|
471 |
TInt aErrorCode, |
|
472 |
TBool aErrorNotified) |
|
473 |
Description : Virtual Phonebook Observer method called back if |
|
474 |
the contact operation is Failed. |
|
475 |
Return values : N/A |
|
476 |
------------------------------------------------------------------------------------- |
|
477 |
*/ |
|
478 |
void CAddContactObserver::ContactOperationFailed(TContactOp /*aOpCode*/, |
|
479 |
TInt aErrorCode, |
|
480 |
TBool /*aErrorNotified*/) |
|
481 |
{ |
|
482 |
//operation failed....handle the error |
|
483 |
iContactService->RequestComplete(iTransId); |
|
484 |
iCallback->HandleReturnValue(EOpError, aErrorCode, iTransId); |
|
485 |
delete this; |
|
486 |
} |
|
487 |
||
488 |
/* |
|
489 |
------------------------------------------------------------------------------------- |
|
490 |
CAddContactObserver::ContactOperationFailed(TContactOp aOpCode, |
|
491 |
TInt aErrorCode, |
|
492 |
TBool aErrorNotified) |
|
493 |
Description : Virtual Phonebook Observer method called back when OpenL(), |
|
494 |
the database open operation is successfull. |
|
495 |
Return values : N/A |
|
496 |
------------------------------------------------------------------------------------- |
|
497 |
*/ |
|
498 |
void CAddContactObserver::StoreReady(MVPbkContactStore& aContactStore) |
|
499 |
{ |
|
500 |
iContactStore = &aContactStore; |
|
501 |
||
502 |
TRAPD(error, DoAddL()); |
|
503 |
||
504 |
if( error != KErrNone ) |
|
505 |
{ |
|
506 |
iContactService->RequestComplete(iTransId); |
|
507 |
if(error == KErrNotSupported && iErrorID != 0) |
|
508 |
{ |
|
509 |
iCallback->HandleReturnValue(EInvalidKey, iErrorID, iTransId); |
|
510 |
} |
|
511 |
else |
|
512 |
{ |
|
513 |
iCallback->HandleReturnValue(EOpComplete, error, iTransId); |
|
514 |
} |
|
515 |
||
516 |
delete this; |
|
517 |
} |
|
518 |
||
519 |
} |
|
520 |
||
521 |
/* |
|
522 |
------------------------------------------------------------------------------------- |
|
523 |
CAddContactObserver::StoreUnavailable(MVPbkContactStore& aContactStore, |
|
524 |
TInt aReason) |
|
525 |
Description : Virtual Phonebook Observer method called back when OpenL(), |
|
526 |
the database open operation is failed due to unavailable store. |
|
527 |
Return values : N/A |
|
528 |
------------------------------------------------------------------------------------- |
|
529 |
*/ |
|
530 |
void CAddContactObserver::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, |
|
531 |
TInt aReason) |
|
532 |
{ |
|
533 |
//store open failed.....handle the error |
|
534 |
iContactService->RequestComplete(iTransId); |
|
535 |
iCallback->HandleReturnValue(EOpError, aReason, iTransId); |
|
536 |
||
537 |
delete this; |
|
538 |
} |
|
539 |
||
540 |
/* |
|
541 |
------------------------------------------------------------------------------------- |
|
542 |
CAddContactObserver::HandleStoreEventL(MVPbkContactStore& aContactStore, |
|
543 |
TVPbkContactStoreEvent aStoreEvent) |
|
544 |
Description : Virtual Phonebook Observer method Not used here. |
|
545 |
Return values : N/A |
|
546 |
------------------------------------------------------------------------------------- |
|
547 |
*/ |
|
548 |
void CAddContactObserver::HandleStoreEventL(MVPbkContactStore& /*aContactStore*/, |
|
549 |
TVPbkContactStoreEvent /*aStoreEvent*/) |
|
550 |
{ |
|
551 |
//do nothing here |
|
552 |
} |
|
553 |
||
554 |
/* |
|
555 |
------------------------------------------------------------------------------------- |
|
556 |
CAddContactObserver::VPbkSingleContactOperationComplete |
|
557 |
(MVPbkContactOperationBase& aOperation, |
|
558 |
MVPbkStoreContact* aContact) |
|
559 |
Description : Virtual Phonebook Observer method called back when |
|
560 |
Single Contact Operation completes successfully.. |
|
561 |
Return values : N/A |
|
562 |
------------------------------------------------------------------------------------- |
|
563 |
*/ |
|
564 |
||
565 |
void CAddContactObserver::VPbkSingleContactOperationComplete |
|
566 |
(MVPbkContactOperationBase& aOperation, |
|
567 |
MVPbkStoreContact* aContact) |
|
568 |
||
569 |
{ |
|
570 |
delete &aOperation; |
|
571 |
TRAPD(error, DoEditContactOrGroupL(aContact)); |
|
572 |
if(KErrNone != error) |
|
573 |
{ |
|
574 |
iContactService->RequestComplete(iTransId); |
|
575 |
iCallback->HandleReturnValue(EOpComplete, error, iTransId); |
|
576 |
delete this; |
|
577 |
} |
|
578 |
} |
|
579 |
||
580 |
/* |
|
581 |
------------------------------------------------------------------------------------- |
|
582 |
CAddContactObserver::VPbkSingleContactOperationFailed |
|
583 |
(MVPbkContactOperationBase& aOperation, |
|
584 |
TInt aError) |
|
585 |
Description : Virtual Phonebook Observer method called back when |
|
586 |
Single Contact Operation fails. |
|
587 |
Return values : N/A |
|
588 |
------------------------------------------------------------------------------------- |
|
589 |
*/ |
|
590 |
void CAddContactObserver::VPbkSingleContactOperationFailed |
|
591 |
(MVPbkContactOperationBase& aOperation, |
|
592 |
TInt aError) |
|
593 |
{ |
|
594 |
delete &aOperation; |
|
595 |
iContactService->RequestComplete(iTransId); |
|
596 |
iCallback->HandleReturnValue(EOpError, aError, iTransId); |
|
597 |
||
598 |
delete this; |
|
599 |
} |