63
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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: Phonebook 2 server app contact data assign phase.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include "CPbk2SingleAssignDataPhase.h"
|
|
20 |
|
|
21 |
// Phonebook 2
|
|
22 |
#include "MPbk2ServicePhaseObserver.h"
|
|
23 |
#include "CPbk2ServerAppAppUi.h"
|
|
24 |
#include "MPbk2ContactAssigner.h"
|
|
25 |
#include "Pbk2ContactAssignerFactory.h"
|
|
26 |
#include "CPbk2ContactEditorOperator.h"
|
|
27 |
#include "MPbk2SelectFieldProperty.h"
|
|
28 |
#include "TPbk2AssignNoteService.h"
|
|
29 |
#include "Pbk2ServerApp.hrh"
|
|
30 |
#include <MPbk2DialogEliminator.h>
|
|
31 |
#include <TPbk2DestructionIndicator.h>
|
|
32 |
#include <CPbk2StoreConfiguration.h>
|
|
33 |
#include <MPbk2ApplicationServices.h>
|
|
34 |
#include <Pbk2UIControls.rsg>
|
|
35 |
#include <Pbk2ServerApp.rsg>
|
|
36 |
|
|
37 |
// Virtual Phonebook
|
|
38 |
#include <MVPbkContactLink.h>
|
|
39 |
#include <CVPbkContactLinkArray.h>
|
|
40 |
#include <MVPbkContactOperationBase.h>
|
|
41 |
#include <MVPbkStoreContact.h>
|
|
42 |
#include <MVPbkContactStore.h>
|
|
43 |
#include <CVPbkContactManager.h>
|
|
44 |
#include <MVPbkContactStoreProperties.h>
|
|
45 |
#include <VPbkContactStoreUris.h>
|
|
46 |
#include <CVPbkContactStoreUriArray.h>
|
|
47 |
|
|
48 |
// System includes
|
|
49 |
#include <AiwContactAssignDataTypes.h>
|
|
50 |
|
|
51 |
using namespace AiwContactAssign;
|
|
52 |
|
|
53 |
// --------------------------------------------------------------------------
|
|
54 |
// CPbk2SingleAssignDataPhase::CPbk2SingleAssignDataPhase
|
|
55 |
// --------------------------------------------------------------------------
|
|
56 |
//
|
|
57 |
CPbk2SingleAssignDataPhase::CPbk2SingleAssignDataPhase
|
|
58 |
( MPbk2ServicePhaseObserver& aObserver,
|
|
59 |
MVPbkStoreContact* aStoreContact,
|
|
60 |
MPbk2SelectFieldProperty* aSelectedFieldProperty,
|
|
61 |
TInt aSelectedFieldIndex, HBufC* aDataBuffer, TInt aMimeType,
|
|
62 |
TCoeHelpContext aHelpContext,
|
|
63 |
TUint aAssignFlags, TUint aNoteFlags ) :
|
|
64 |
iObserver( aObserver ),
|
|
65 |
iStoreContact( aStoreContact ),
|
|
66 |
iSelectedFieldIndex( aSelectedFieldIndex ),
|
|
67 |
iSelectedFieldProperty( aSelectedFieldProperty ),
|
|
68 |
iDataBuffer( aDataBuffer ),
|
|
69 |
iMimeType( aMimeType ),
|
|
70 |
iHelpContext( aHelpContext ),
|
|
71 |
iAssignFlags( aAssignFlags ),
|
|
72 |
iNoteFlags( aNoteFlags ),
|
|
73 |
iEikEnv( CEikonEnv::Static() )
|
|
74 |
{
|
|
75 |
}
|
|
76 |
|
|
77 |
// --------------------------------------------------------------------------
|
|
78 |
// CPbk2SingleAssignDataPhase::~CPbk2SingleAssignDataPhase
|
|
79 |
// --------------------------------------------------------------------------
|
|
80 |
//
|
|
81 |
CPbk2SingleAssignDataPhase::~CPbk2SingleAssignDataPhase()
|
|
82 |
{
|
|
83 |
if ( iContactEditorEliminator )
|
|
84 |
{
|
|
85 |
iContactEditorEliminator->ForceExit();
|
|
86 |
}
|
|
87 |
delete iResults;
|
|
88 |
delete iContactDataAssigner;
|
|
89 |
delete iStoreContact;
|
|
90 |
|
|
91 |
if ( iDestroyedPtr )
|
|
92 |
{
|
|
93 |
*iDestroyedPtr = ETrue;
|
|
94 |
}
|
|
95 |
}
|
|
96 |
|
|
97 |
// --------------------------------------------------------------------------
|
|
98 |
// CPbk2SingleAssignDataPhase::NewL
|
|
99 |
// --------------------------------------------------------------------------
|
|
100 |
//
|
|
101 |
CPbk2SingleAssignDataPhase* CPbk2SingleAssignDataPhase::NewL
|
|
102 |
( MPbk2ServicePhaseObserver& aObserver,
|
|
103 |
MVPbkStoreContact* aStoreContact,
|
|
104 |
MPbk2SelectFieldProperty* aSelectedFieldProperty,
|
|
105 |
TInt aSelectedFieldIndex, HBufC* aDataBuffer, TInt aMimeType,
|
|
106 |
TCoeHelpContext aHelpContext,
|
|
107 |
TUint aAssignFlags, TUint aNoteFlags )
|
|
108 |
{
|
|
109 |
CPbk2SingleAssignDataPhase* self =
|
|
110 |
new ( ELeave ) CPbk2SingleAssignDataPhase
|
|
111 |
( aObserver, aStoreContact, aSelectedFieldProperty,
|
|
112 |
aSelectedFieldIndex, aDataBuffer, aMimeType, aHelpContext,
|
|
113 |
aAssignFlags, aNoteFlags );
|
|
114 |
return self;
|
|
115 |
}
|
|
116 |
|
|
117 |
// --------------------------------------------------------------------------
|
|
118 |
// CPbk2SingleAssignDataPhase::LaunchServicePhaseL
|
|
119 |
// --------------------------------------------------------------------------
|
|
120 |
//
|
|
121 |
void CPbk2SingleAssignDataPhase::LaunchServicePhaseL()
|
|
122 |
{
|
|
123 |
DoAssignDataL();
|
|
124 |
}
|
|
125 |
|
|
126 |
// --------------------------------------------------------------------------
|
|
127 |
// CPbk2SingleAssignDataPhase::CancelServicePhase
|
|
128 |
// --------------------------------------------------------------------------
|
|
129 |
//
|
|
130 |
void CPbk2SingleAssignDataPhase::CancelServicePhase()
|
|
131 |
{
|
|
132 |
if ( iContactEditorEliminator )
|
|
133 |
{
|
|
134 |
// Changes won't be saved here.
|
|
135 |
iContactEditorEliminator->ForceExit();
|
|
136 |
}
|
|
137 |
// Notify observer to complete its message.
|
|
138 |
iObserver.PhaseCanceled( *this );
|
|
139 |
}
|
|
140 |
|
|
141 |
// --------------------------------------------------------------------------
|
|
142 |
// CPbk2SingleAssignDataPhase::RequestCancelL
|
|
143 |
// --------------------------------------------------------------------------
|
|
144 |
//
|
|
145 |
void CPbk2SingleAssignDataPhase::RequestCancelL( TInt aExitCommandId )
|
|
146 |
{
|
|
147 |
if ( iContactEditorEliminator )
|
|
148 |
{
|
|
149 |
// Do not notify observer about abortion here, we must let
|
|
150 |
// contact editor to do it. Otherwise the changes would not be saved.
|
|
151 |
iContactEditorEliminator->RequestExitL( aExitCommandId );
|
|
152 |
}
|
|
153 |
else
|
|
154 |
{
|
|
155 |
if ( aExitCommandId == EEikBidCancel )
|
|
156 |
{
|
|
157 |
iObserver.PhaseAborted( *this );
|
|
158 |
}
|
|
159 |
else
|
|
160 |
{
|
|
161 |
iObserver.PhaseCanceled( *this );
|
|
162 |
}
|
|
163 |
}
|
|
164 |
}
|
|
165 |
|
|
166 |
// --------------------------------------------------------------------------
|
|
167 |
// CPbk2SingleAssignDataPhase::AcceptDelayed
|
|
168 |
// --------------------------------------------------------------------------
|
|
169 |
//
|
|
170 |
void CPbk2SingleAssignDataPhase::AcceptDelayedL
|
|
171 |
( const TDesC8& /*aContactLinkBuffer*/ )
|
|
172 |
{
|
|
173 |
// Nothing to do
|
|
174 |
}
|
|
175 |
|
|
176 |
// --------------------------------------------------------------------------
|
|
177 |
// CPbk2SingleAssignDataPhase::DenyDelayed
|
|
178 |
// --------------------------------------------------------------------------
|
|
179 |
//
|
|
180 |
void CPbk2SingleAssignDataPhase::DenyDelayedL
|
|
181 |
( const TDesC8& /*aContactLinkBuffer*/ )
|
|
182 |
{
|
|
183 |
// Nothing to do
|
|
184 |
}
|
|
185 |
|
|
186 |
// --------------------------------------------------------------------------
|
|
187 |
// CPbk2SingleAssignDataPhase::Results
|
|
188 |
// --------------------------------------------------------------------------
|
|
189 |
//
|
|
190 |
MVPbkContactLinkArray* CPbk2SingleAssignDataPhase::Results() const
|
|
191 |
{
|
|
192 |
return iResults;
|
|
193 |
}
|
|
194 |
|
|
195 |
// --------------------------------------------------------------------------
|
|
196 |
// CPbk2SingleAssignDataPhase::ExtraResultData
|
|
197 |
// --------------------------------------------------------------------------
|
|
198 |
//
|
|
199 |
TInt CPbk2SingleAssignDataPhase::ExtraResultData() const
|
|
200 |
{
|
|
201 |
return iSelectedFieldIndex;
|
|
202 |
}
|
|
203 |
|
|
204 |
// --------------------------------------------------------------------------
|
|
205 |
// CPbk2SingleAssignDataPhase::TakeStoreContact
|
|
206 |
// --------------------------------------------------------------------------
|
|
207 |
//
|
|
208 |
MVPbkStoreContact* CPbk2SingleAssignDataPhase::TakeStoreContact()
|
|
209 |
{
|
|
210 |
MVPbkStoreContact* contact = iStoreContact;
|
|
211 |
iStoreContact = NULL;
|
|
212 |
return contact;
|
|
213 |
}
|
|
214 |
|
|
215 |
// --------------------------------------------------------------------------
|
|
216 |
// CPbk2SingleAssignDataPhase::FieldContent
|
|
217 |
// --------------------------------------------------------------------------
|
|
218 |
//
|
|
219 |
HBufC* CPbk2SingleAssignDataPhase::FieldContent() const
|
|
220 |
{
|
|
221 |
return NULL;
|
|
222 |
}
|
|
223 |
|
|
224 |
// --------------------------------------------------------------------------
|
|
225 |
// CPbk2SingleAssignDataPhase::AssignComplete
|
|
226 |
// --------------------------------------------------------------------------
|
|
227 |
//
|
|
228 |
void CPbk2SingleAssignDataPhase::AssignComplete
|
|
229 |
( MPbk2ContactAssigner& /*aAssigner*/, TInt aIndex )
|
|
230 |
{
|
|
231 |
// aIndex is KErrNotSupported from CPbk2ContactEmptyDataAssigner
|
|
232 |
// but iSelectedFieldIndex may still be set previously.
|
|
233 |
if (aIndex == KErrNotSupported)
|
|
234 |
{
|
|
235 |
aIndex = iSelectedFieldIndex;
|
|
236 |
}
|
|
237 |
|
|
238 |
TRAPD( err, HandleContactDataAssignedL( aIndex ) );
|
|
239 |
if ( err != KErrNone )
|
|
240 |
{
|
|
241 |
// HandleContactDataAssignedL will leave with KErrDied if
|
|
242 |
// this was destroyed, then we will not inform observer
|
|
243 |
// since iObserver is no more. Syslib's CBaActiveScheduler leaves
|
|
244 |
// with KLeaveExit (in certain situations, e.g. pressing End key
|
|
245 |
// with delete-dialog open when assigning empty contact.
|
|
246 |
if ( err != KErrDied && err != KLeaveExit )
|
|
247 |
{
|
|
248 |
iObserver.PhaseError( *this, err );
|
|
249 |
}
|
|
250 |
}
|
|
251 |
}
|
|
252 |
|
|
253 |
// --------------------------------------------------------------------------
|
|
254 |
// CPbk2SingleAssignDataPhase::AssignFailed
|
|
255 |
// --------------------------------------------------------------------------
|
|
256 |
//
|
|
257 |
void CPbk2SingleAssignDataPhase::AssignFailed
|
|
258 |
( MPbk2ContactAssigner& /*aAssigner*/, TInt aErrorCode )
|
|
259 |
{
|
|
260 |
iObserver.PhaseError( *this, aErrorCode );
|
|
261 |
}
|
|
262 |
|
|
263 |
// --------------------------------------------------------------------------
|
|
264 |
// CPbk2SingleAssignDataPhase::ContactOperationCompleted
|
|
265 |
// --------------------------------------------------------------------------
|
|
266 |
//
|
|
267 |
void CPbk2SingleAssignDataPhase::ContactOperationCompleted
|
|
268 |
( TContactOpResult aResult )
|
|
269 |
{
|
|
270 |
TInt err = KErrNone;
|
|
271 |
|
|
272 |
if ( aResult.iOpCode == EContactLock )
|
|
273 |
{
|
|
274 |
TRAP( err, DoAssignDataL() );
|
|
275 |
}
|
|
276 |
else if ( aResult.iOpCode == EContactCommit )
|
|
277 |
{
|
|
278 |
TRAP( err, FinalizeL( iStoreContact ) );
|
|
279 |
}
|
|
280 |
|
|
281 |
if ( err != KErrNone )
|
|
282 |
{
|
|
283 |
iObserver.PhaseError( *this, err );
|
|
284 |
}
|
|
285 |
}
|
|
286 |
|
|
287 |
// --------------------------------------------------------------------------
|
|
288 |
// CPbk2SingleAssignDataPhase::ContactOperationFailed
|
|
289 |
// --------------------------------------------------------------------------
|
|
290 |
//
|
|
291 |
void CPbk2SingleAssignDataPhase::ContactOperationFailed
|
|
292 |
( TContactOp /*aOpCode*/, TInt aErrorCode, TBool /*aErrorNotified*/ )
|
|
293 |
{
|
|
294 |
// Locking or committing the contact failed
|
|
295 |
iObserver.PhaseError( *this, aErrorCode );
|
|
296 |
}
|
|
297 |
|
|
298 |
// --------------------------------------------------------------------------
|
|
299 |
// CPbk2SingleAssignDataPhase::ContactEditingComplete
|
|
300 |
// --------------------------------------------------------------------------
|
|
301 |
//
|
|
302 |
void CPbk2SingleAssignDataPhase::ContactEditingComplete
|
|
303 |
( MVPbkStoreContact* aEditedContact )
|
|
304 |
{
|
|
305 |
delete iStoreContact;
|
|
306 |
iStoreContact = aEditedContact;
|
|
307 |
|
|
308 |
TRAPD( err, FinalizeL( iStoreContact ) );
|
|
309 |
|
|
310 |
if ( err != KErrNone )
|
|
311 |
{
|
|
312 |
iObserver.PhaseError( *this, err );
|
|
313 |
}
|
|
314 |
}
|
|
315 |
|
|
316 |
// --------------------------------------------------------------------------
|
|
317 |
// CPbk2SingleAssignDataPhase::ContactEditingDeletedContact
|
|
318 |
// --------------------------------------------------------------------------
|
|
319 |
//
|
|
320 |
void CPbk2SingleAssignDataPhase::ContactEditingDeletedContact
|
|
321 |
( MVPbkStoreContact* aEditedContact )
|
|
322 |
{
|
|
323 |
delete iStoreContact;
|
|
324 |
iStoreContact = aEditedContact;
|
|
325 |
|
|
326 |
// Reset note flags
|
|
327 |
iNoteFlags |= KPbk2NoteFlagContactDeleted;
|
|
328 |
|
|
329 |
// Finalize, but with no results to append
|
|
330 |
TRAPD( err, FinalizeL( NULL ) );
|
|
331 |
|
|
332 |
if ( err != KErrNone )
|
|
333 |
{
|
|
334 |
iObserver.PhaseError( *this, err );
|
|
335 |
}
|
|
336 |
}
|
|
337 |
|
|
338 |
// --------------------------------------------------------------------------
|
|
339 |
// CPbk2SingleAssignDataPhase::ContactEditingAborted
|
|
340 |
// --------------------------------------------------------------------------
|
|
341 |
//
|
|
342 |
void CPbk2SingleAssignDataPhase::ContactEditingAborted()
|
|
343 |
{
|
|
344 |
iObserver.PhaseAborted( *this );
|
|
345 |
}
|
|
346 |
|
|
347 |
// --------------------------------------------------------------------------
|
|
348 |
// CPbk2SingleAssignDataPhase::OkToExitL
|
|
349 |
// --------------------------------------------------------------------------
|
|
350 |
//
|
|
351 |
TBool CPbk2SingleAssignDataPhase::OkToExitL( TInt aCommandId )
|
|
352 |
{
|
|
353 |
return iObserver.PhaseOkToExit( *this, aCommandId );
|
|
354 |
}
|
|
355 |
|
|
356 |
// --------------------------------------------------------------------------
|
|
357 |
// CPbk2SingleAssignDataPhase::DoAssignDataL
|
|
358 |
// --------------------------------------------------------------------------
|
|
359 |
//
|
|
360 |
void CPbk2SingleAssignDataPhase::DoAssignDataL()
|
|
361 |
{
|
|
362 |
const MVPbkFieldType* fieldType = NULL;
|
|
363 |
MVPbkStoreContactField* field = NULL;
|
|
364 |
if ( iSelectedFieldProperty )
|
|
365 |
{
|
|
366 |
fieldType = iSelectedFieldProperty->SelectedFieldType();
|
|
367 |
if ( iSelectedFieldIndex >= KErrNone )
|
|
368 |
{
|
|
369 |
field = &iStoreContact->Fields().FieldAt( iSelectedFieldIndex );
|
|
370 |
}
|
|
371 |
}
|
|
372 |
|
|
373 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&>
|
|
374 |
( *iEikEnv->EikAppUi() );
|
|
375 |
|
|
376 |
delete iContactDataAssigner;
|
|
377 |
iContactDataAssigner = NULL;
|
|
378 |
iContactDataAssigner =
|
|
379 |
Pbk2ContactAssignerFactory::CreateContactDataAssignerL
|
|
380 |
( *this, iMimeType, fieldType,
|
|
381 |
appUi.ApplicationServices().ContactManager(),
|
|
382 |
appUi.ApplicationServices().FieldProperties() );
|
|
383 |
|
|
384 |
iContactDataAssigner->AssignDataL
|
|
385 |
( *iStoreContact, field, fieldType, iDataBuffer );
|
|
386 |
}
|
|
387 |
|
|
388 |
// --------------------------------------------------------------------------
|
|
389 |
// CPbk2SingleAssignDataPhase::HandleContactDataAssignedL
|
|
390 |
// --------------------------------------------------------------------------
|
|
391 |
//
|
|
392 |
void CPbk2SingleAssignDataPhase::HandleContactDataAssignedL( TInt aIndex )
|
|
393 |
{
|
|
394 |
TInt index = aIndex;
|
|
395 |
|
|
396 |
// If desired, open editor
|
|
397 |
if ( !( iAssignFlags & EDoNotOpenEditor ) )
|
|
398 |
{
|
|
399 |
if ( iAssignFlags & ECreateNewContact )
|
|
400 |
{
|
|
401 |
// If we created a new contact, set focus to first field
|
|
402 |
index = KErrNotFound;
|
|
403 |
}
|
|
404 |
|
|
405 |
TBool thisDestroyed = EFalse;
|
|
406 |
iDestroyedPtr = &thisDestroyed;
|
|
407 |
TPbk2DestructionIndicator indicator
|
|
408 |
( &thisDestroyed, iDestroyedPtr );
|
|
409 |
|
|
410 |
CPbk2ContactEditorOperator* editorOperator =
|
|
411 |
CPbk2ContactEditorOperator::NewLC( *this, *this );
|
|
412 |
iContactEditorEliminator = editorOperator;
|
|
413 |
iContactEditorEliminator->ResetWhenDestroyed
|
|
414 |
( &iContactEditorEliminator );
|
|
415 |
|
|
416 |
editorOperator->OpenEditorL(
|
|
417 |
iStoreContact, index, iAssignFlags, iHelpContext );
|
|
418 |
|
|
419 |
// index is updated when editor is closed.
|
|
420 |
iSelectedFieldIndex = index;
|
|
421 |
|
|
422 |
CleanupStack::PopAndDestroy(); // operator
|
|
423 |
|
|
424 |
if ( thisDestroyed )
|
|
425 |
{
|
|
426 |
// The calling code excepts us to leave with KErrDied if
|
|
427 |
// this was destroyed
|
|
428 |
User::Leave( KErrDied );
|
|
429 |
}
|
|
430 |
}
|
|
431 |
else
|
|
432 |
{
|
|
433 |
iStoreContact->CommitL( *this );
|
|
434 |
}
|
|
435 |
}
|
|
436 |
|
|
437 |
// --------------------------------------------------------------------------
|
|
438 |
// CPbk2SingleAssignDataPhase::AppendResultL
|
|
439 |
// --------------------------------------------------------------------------
|
|
440 |
//
|
|
441 |
void CPbk2SingleAssignDataPhase::AppendResultL
|
|
442 |
( const MVPbkStoreContact* aStoreContact )
|
|
443 |
{
|
|
444 |
if ( aStoreContact )
|
|
445 |
{
|
|
446 |
// Add the contact link to the result array
|
|
447 |
MVPbkContactLink* link = aStoreContact->CreateLinkLC();
|
|
448 |
if ( link )
|
|
449 |
{
|
|
450 |
if ( !iResults )
|
|
451 |
{
|
|
452 |
iResults = CVPbkContactLinkArray::NewL();
|
|
453 |
}
|
|
454 |
|
|
455 |
CleanupStack::Pop(); // aStoreContact->CreateLinkLC()
|
|
456 |
|
|
457 |
iResults->AppendL( link );
|
|
458 |
}
|
|
459 |
}
|
|
460 |
}
|
|
461 |
|
|
462 |
// --------------------------------------------------------------------------
|
|
463 |
// CPbk2SingleAssignDataPhase::DisplayNotesL
|
|
464 |
// --------------------------------------------------------------------------
|
|
465 |
//
|
|
466 |
void CPbk2SingleAssignDataPhase::DisplayNotesL()
|
|
467 |
{
|
|
468 |
TPbk2AssignNoteService noteService;
|
|
469 |
|
|
470 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&>
|
|
471 |
( *iEikEnv->EikAppUi() );
|
|
472 |
|
|
473 |
if ( !(iNoteFlags & KPbk2NoteFlagContactDeleted)
|
|
474 |
&&!(iAssignFlags & EskipInfoNotes) )
|
|
475 |
{
|
|
476 |
// Show note if new contact was created
|
|
477 |
if ( iNoteFlags & KPbk2NoteFlagOneContactCreated )
|
|
478 |
{
|
|
479 |
if ( IsContactInSelectedMemoryL( *iStoreContact ) )
|
|
480 |
{
|
|
481 |
noteService.ShowInformationNoteL
|
|
482 |
( R_QTN_PHOB_NOTE_CONTACT_CREATED );
|
|
483 |
}
|
|
484 |
else
|
|
485 |
{
|
|
486 |
TVPbkContactStoreUriPtr contactUri =
|
|
487 |
iStoreContact->ParentStore().StoreProperties().Uri();
|
|
488 |
|
|
489 |
CPbk2StorePropertyArray& array =
|
|
490 |
appUi.ApplicationServices().StoreProperties();
|
|
491 |
noteService.ShowInformationNoteL
|
|
492 |
( R_QTN_PHOB_NOTE_CONTACT_HIDDEN, contactUri, array );
|
|
493 |
}
|
|
494 |
}
|
|
495 |
// Show note if existing contact was updated
|
|
496 |
else
|
|
497 |
{
|
|
498 |
if ( iNoteFlags & KPbk2NoteFlagOneContactRelocated )
|
|
499 |
{
|
|
500 |
CPbk2StorePropertyArray& array =
|
|
501 |
appUi.ApplicationServices().StoreProperties();
|
|
502 |
TVPbkContactStoreUriPtr store
|
|
503 |
( VPbkContactStoreUris::DefaultCntDbUri() );
|
|
504 |
|
|
505 |
noteService.ShowInformationNoteL
|
|
506 |
( R_QTN_PHOB_NOTE_CONTACT_HIDDEN, store, array );
|
|
507 |
}
|
|
508 |
else
|
|
509 |
{
|
|
510 |
noteService.ShowInformationNoteL
|
|
511 |
( R_QTN_PHOB_NOTE_CONTACT_UPDATED );
|
|
512 |
}
|
|
513 |
}
|
|
514 |
}
|
|
515 |
}
|
|
516 |
|
|
517 |
// --------------------------------------------------------------------------
|
|
518 |
// CPbk2SingleAssignDataPhase::IsContactInSelectedMemoryL
|
|
519 |
// --------------------------------------------------------------------------
|
|
520 |
//
|
|
521 |
TBool CPbk2SingleAssignDataPhase::IsContactInSelectedMemoryL
|
|
522 |
( MVPbkStoreContact& aContact )
|
|
523 |
{
|
|
524 |
TBool result( EFalse );
|
|
525 |
|
|
526 |
TVPbkContactStoreUriPtr contactUri =
|
|
527 |
aContact.ParentStore().StoreProperties().Uri();
|
|
528 |
|
|
529 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&>
|
|
530 |
( *iEikEnv->EikAppUi() );
|
|
531 |
|
|
532 |
CVPbkContactStoreUriArray* currentConfig =
|
|
533 |
appUi.ApplicationServices().StoreConfiguration().
|
|
534 |
CurrentConfigurationL();
|
|
535 |
CleanupStack::PushL( currentConfig );
|
|
536 |
|
|
537 |
if ( currentConfig->IsIncluded( contactUri ) )
|
|
538 |
{
|
|
539 |
result = ETrue;
|
|
540 |
}
|
|
541 |
|
|
542 |
CleanupStack::PopAndDestroy( currentConfig );
|
|
543 |
return result;
|
|
544 |
}
|
|
545 |
|
|
546 |
// --------------------------------------------------------------------------
|
|
547 |
// CPbk2SingleAssignDataPhase::FinalizeL
|
|
548 |
// --------------------------------------------------------------------------
|
|
549 |
//
|
|
550 |
void CPbk2SingleAssignDataPhase::FinalizeL
|
|
551 |
( const MVPbkStoreContact* aStoreContact )
|
|
552 |
{
|
|
553 |
TBool thisDestroyed = EFalse;
|
|
554 |
iDestroyedPtr = &thisDestroyed;
|
|
555 |
|
|
556 |
AppendResultL( aStoreContact );
|
|
557 |
DisplayNotesL();
|
|
558 |
|
|
559 |
if ( !thisDestroyed )
|
|
560 |
{
|
|
561 |
iObserver.NextPhase( *this );
|
|
562 |
}
|
|
563 |
}
|
|
564 |
|
|
565 |
// End of File
|