author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:15:33 +0300 | |
branch | RCL_3 |
changeset 85 | 38bb213f60ba |
parent 68 | 9da50d567e3c |
permissions | -rw-r--r-- |
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 single contact data assigner. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include "CPbk2SingleContactDataAssigner.h" |
|
20 |
||
21 |
// Phonebook 2 |
|
22 |
#include "CPbk2ServerAppAppUi.h" |
|
23 |
#include "MPbk2UiServiceObserver.h" |
|
24 |
#include "TPbk2TitlePaneOperator.h" |
|
25 |
#include "TPbk2ServerMessageDataRetriever.h" |
|
26 |
#include "CPbk2ServerAppStoreManager.h" |
|
27 |
#include "CPbk2SelectSinglePropertyPhase.h" |
|
28 |
#include "CPbk2ContactFetchPhase.h" |
|
29 |
#include "CPbk2SingleAssignDataPhase.h" |
|
30 |
#include "CPbk2SelectCreateNewPropertyPhase.h" |
|
31 |
#include "CPbk2PrepareSingleAssignPhase.h" |
|
32 |
#include "MPbk2SelectFieldProperty.h" |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
33 |
#include <Pbk2UIControls.rsg> |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
68
diff
changeset
|
34 |
#include <Pbk2ServerApp.rsg> |
63 | 35 |
#include <CPbk2StoreManager.h> |
36 |
#include <CPbk2StoreConfiguration.h> |
|
37 |
#include <MPbk2ApplicationServices.h> |
|
38 |
#include "TPbk2AssignNoteService.h" |
|
39 |
||
40 |
// Virtual Phonebook |
|
41 |
#include <CVPbkContactManager.h> |
|
42 |
#include <CVPbkContactStoreUriArray.h> |
|
43 |
#include <MVPbkContactLink.h> |
|
44 |
#include <CVPbkFieldTypeSelector.h> |
|
45 |
#include <MVPbkStoreContact.h> |
|
46 |
#include <TVPbkContactStoreUriPtr.h> |
|
47 |
#include <VPbkContactStoreUris.h> |
|
48 |
||
49 |
// System includes |
|
50 |
#include <AiwContactAssignDataTypes.h> |
|
51 |
||
52 |
using namespace AiwContactAssign; |
|
53 |
||
54 |
||
55 |
/// Unnamed namespace for local definitions |
|
56 |
namespace { |
|
57 |
||
58 |
#ifdef _DEBUG |
|
59 |
||
60 |
enum TPanicCode |
|
61 |
{ |
|
62 |
ELogicPreselectedContacts, |
|
63 |
EPanicLogicPhaseCompletion |
|
64 |
}; |
|
65 |
||
66 |
void Panic(TPanicCode aReason) |
|
67 |
{ |
|
68 |
_LIT( KPanicText, "CPbk2SingleContactDataAssigner" ); |
|
69 |
User::Panic( KPanicText, aReason ); |
|
70 |
} |
|
71 |
||
72 |
#endif // _DEBUG |
|
73 |
||
74 |
/** |
|
75 |
* Sets title pane. |
|
76 |
* |
|
77 |
* @param aDataRetriever Server message data retriever. |
|
78 |
* @param aFlags Assign flags. |
|
79 |
* @param aMessage Server message. |
|
80 |
*/ |
|
81 |
void SetTitlePaneL |
|
82 |
( TPbk2ServerMessageDataRetriever& aDataRetriever, TUint aFlags, |
|
83 |
const RMessage2& aMessage ) |
|
84 |
{ |
|
85 |
HBufC* titlePaneText = NULL; |
|
86 |
if ( !( aFlags & AiwContactAssign::EUseProviderTitle ) ) |
|
87 |
{ |
|
88 |
titlePaneText = aDataRetriever.GetTitlePaneTextL( aMessage ); |
|
89 |
TPbk2TitlePaneOperator titlePaneOperator; |
|
90 |
titlePaneOperator.SetTitlePaneL( titlePaneText ); // takes ownership |
|
91 |
} |
|
92 |
} |
|
93 |
||
94 |
} /// namespace |
|
95 |
||
96 |
||
97 |
// -------------------------------------------------------------------------- |
|
98 |
// CPbk2SingleContactDataAssigner::CPbk2SingleContactDataAssigner |
|
99 |
// -------------------------------------------------------------------------- |
|
100 |
// |
|
101 |
CPbk2SingleContactDataAssigner::CPbk2SingleContactDataAssigner |
|
102 |
( MPbk2UiServiceObserver& aObserver ) : |
|
103 |
iObserver( aObserver ) |
|
104 |
{ |
|
105 |
} |
|
106 |
||
107 |
// -------------------------------------------------------------------------- |
|
108 |
// CPbk2SingleContactDataAssigner::~CPbk2SingleContactDataAssigner |
|
109 |
// -------------------------------------------------------------------------- |
|
110 |
// |
|
111 |
CPbk2SingleContactDataAssigner::~CPbk2SingleContactDataAssigner() |
|
112 |
{ |
|
113 |
delete iSelectPropertyPhase; |
|
114 |
delete iFetchPhase; |
|
115 |
delete iPrepareAssignPhase; |
|
116 |
delete iAssignDataPhase; |
|
117 |
delete iStoreUris; |
|
118 |
delete iDataBuffer; |
|
119 |
delete iAddressSelectFilterBuffer; |
|
120 |
delete iPreselectedContact; |
|
121 |
delete iSelectFieldProperty; |
|
122 |
delete iContactViewFilter; |
|
123 |
delete iStoreManager; |
|
124 |
} |
|
125 |
||
126 |
// -------------------------------------------------------------------------- |
|
127 |
// CPbk2SingleContactDataAssigner::NewL |
|
128 |
// -------------------------------------------------------------------------- |
|
129 |
// |
|
130 |
CPbk2SingleContactDataAssigner* CPbk2SingleContactDataAssigner::NewL |
|
131 |
( const RMessage2& aFetchCompleteMessage, |
|
132 |
MPbk2UiServiceObserver& aObserver ) |
|
133 |
{ |
|
134 |
CPbk2SingleContactDataAssigner* self = |
|
135 |
new(ELeave) CPbk2SingleContactDataAssigner( aObserver ); |
|
136 |
CleanupStack::PushL( self ); |
|
137 |
self->ConstructL( aFetchCompleteMessage ); |
|
138 |
CleanupStack::Pop( self ); |
|
139 |
return self; |
|
140 |
} |
|
141 |
||
142 |
// -------------------------------------------------------------------------- |
|
143 |
// CPbk2SingleContactDataAssigner::ConstructL |
|
144 |
// -------------------------------------------------------------------------- |
|
145 |
// |
|
146 |
void CPbk2SingleContactDataAssigner::ConstructL( const RMessage2& aMessage ) |
|
147 |
{ |
|
148 |
// Retrieve data from the client-server message |
|
149 |
TPbk2ServerMessageDataRetriever dataRetriever; |
|
150 |
iAssignFlags = dataRetriever.SingleContactAssignFlagsL( aMessage ); |
|
151 |
||
152 |
// Set title pane |
|
153 |
SetTitlePaneL( dataRetriever, iAssignFlags, aMessage ); |
|
154 |
||
155 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&> |
|
156 |
( *CEikonEnv::Static()->EikAppUi() ); |
|
157 |
||
158 |
iPreselectedContact = dataRetriever.GetPreselectedContactLinksL |
|
159 |
( aMessage, appUi.ApplicationServices().ContactManager() ); |
|
160 |
iStoreUris = dataRetriever.GetContactStoreUriArrayL |
|
161 |
( aMessage, appUi.ApplicationServices().StoreConfiguration(), |
|
162 |
iPreselectedContact, iUseDeviceConfig ); |
|
163 |
||
164 |
// Assert that there aren't multiple preselected contacts |
|
165 |
__ASSERT_DEBUG( ( !iPreselectedContact || |
|
166 |
iPreselectedContact->Count() <= 1 ), |
|
167 |
Panic( ELogicPreselectedContacts ) ); |
|
168 |
||
169 |
iAddressSelectFilterBuffer = |
|
170 |
dataRetriever.GetAddressSelectFilterBufferL( aMessage ); |
|
171 |
iDataBuffer = dataRetriever.GetDataBufferL( aMessage ); |
|
172 |
iMimeType = dataRetriever.GetMimeTypeL( aMessage ); |
|
173 |
iFieldIndex = dataRetriever.GetFocusIndexL( aMessage ); |
|
174 |
||
175 |
iEditorHelpContext = dataRetriever.GetEditorHelpContextL( aMessage ); |
|
176 |
||
177 |
// Drop all non-writable stores |
|
178 |
iStoreManager = CPbk2ServerAppStoreManager::NewL |
|
179 |
( appUi.StoreManager(), |
|
180 |
appUi.ApplicationServices().ContactManager() ); |
|
181 |
iStoreManager->RemoveReadOnlyStoreUris |
|
182 |
( *iStoreUris, appUi.ApplicationServices().StoreProperties() ); |
|
183 |
||
184 |
// Retrieve view filter |
|
185 |
iContactViewFilter = |
|
186 |
dataRetriever.GetContactViewFilterForAttributeAssignL |
|
187 |
( aMessage, |
|
188 |
appUi.ApplicationServices().ContactManager().FieldTypes() ); |
|
189 |
} |
|
190 |
||
191 |
// -------------------------------------------------------------------------- |
|
192 |
// CPbk2SingleContactDataAssigner::LaunchServiceL |
|
193 |
// -------------------------------------------------------------------------- |
|
194 |
// |
|
195 |
void CPbk2SingleContactDataAssigner::LaunchServiceL() |
|
196 |
{ |
|
197 |
// Open stores |
|
198 |
iStoreManager->LoadAndOpenContactStoresL( *iStoreUris, *this, ETrue ); |
|
199 |
} |
|
200 |
||
201 |
// -------------------------------------------------------------------------- |
|
202 |
// CPbk2SingleContactDataAssigner::CancelService |
|
203 |
// -------------------------------------------------------------------------- |
|
204 |
// |
|
205 |
void CPbk2SingleContactDataAssigner::CancelService() |
|
206 |
{ |
|
207 |
if ( iAssignDataPhase ) |
|
208 |
{ |
|
209 |
iAssignDataPhase->CancelServicePhase(); |
|
210 |
} |
|
211 |
||
212 |
if ( iPrepareAssignPhase ) |
|
213 |
{ |
|
214 |
iPrepareAssignPhase->CancelServicePhase(); |
|
215 |
} |
|
216 |
||
217 |
if ( iSelectPropertyPhase ) |
|
218 |
{ |
|
219 |
iSelectPropertyPhase->CancelServicePhase(); |
|
220 |
} |
|
221 |
||
222 |
if ( iFetchPhase ) |
|
223 |
{ |
|
224 |
iFetchPhase->CancelServicePhase(); |
|
225 |
} |
|
226 |
} |
|
227 |
||
228 |
// -------------------------------------------------------------------------- |
|
229 |
// CPbk2SingleContactDataAssigner::AcceptDelayedContactsL |
|
230 |
// -------------------------------------------------------------------------- |
|
231 |
// |
|
232 |
void CPbk2SingleContactDataAssigner::AcceptDelayedContactsL |
|
233 |
( const TDesC8& /*aContactLinkBuffer*/ ) |
|
234 |
{ |
|
235 |
// Do nothing |
|
236 |
} |
|
237 |
||
238 |
// -------------------------------------------------------------------------- |
|
239 |
// CPbk2SingleContactDataAssigner::ExitServiceL |
|
240 |
// -------------------------------------------------------------------------- |
|
241 |
// |
|
242 |
void CPbk2SingleContactDataAssigner::ExitServiceL( TInt aExitCommandId ) |
|
243 |
{ |
|
244 |
if ( iAssignDataPhase ) |
|
245 |
{ |
|
246 |
iAssignDataPhase->RequestCancelL( aExitCommandId ); |
|
247 |
} |
|
248 |
||
249 |
if ( iPrepareAssignPhase ) |
|
250 |
{ |
|
251 |
iPrepareAssignPhase->RequestCancelL( aExitCommandId ); |
|
252 |
} |
|
253 |
||
254 |
if ( iSelectPropertyPhase ) |
|
255 |
{ |
|
256 |
iSelectPropertyPhase->RequestCancelL( aExitCommandId ); |
|
257 |
} |
|
258 |
||
259 |
if ( iFetchPhase ) |
|
260 |
{ |
|
261 |
iFetchPhase->RequestCancelL( aExitCommandId ); |
|
262 |
} |
|
263 |
} |
|
264 |
||
265 |
// -------------------------------------------------------------------------- |
|
266 |
// CPbk2SingleContactDataAssigner::ServiceResults |
|
267 |
// -------------------------------------------------------------------------- |
|
268 |
// |
|
269 |
void CPbk2SingleContactDataAssigner::ServiceResults(TServiceResults* aResults) const |
|
270 |
{ |
|
271 |
if ( iAssignDataPhase ) |
|
272 |
{ |
|
273 |
aResults->iLinkArray = iAssignDataPhase->Results(); |
|
274 |
aResults->iExtraData = iAssignDataPhase->ExtraResultData(); |
|
275 |
aResults->iFieldContent = iAssignDataPhase->FieldContent(); |
|
276 |
} |
|
277 |
} |
|
278 |
||
279 |
// -------------------------------------------------------------------------- |
|
280 |
// CPbk2SingleContactDataAssigner::NextPhase |
|
281 |
// -------------------------------------------------------------------------- |
|
282 |
// |
|
283 |
void CPbk2SingleContactDataAssigner::NextPhase |
|
284 |
( MPbk2ServicePhase& aPhase ) |
|
285 |
{ |
|
286 |
TInt err = KErrNone; |
|
287 |
||
288 |
if ( &aPhase == iFetchPhase ) |
|
289 |
{ |
|
290 |
MVPbkContactLinkArray* fetchResult = iFetchPhase->Results(); |
|
291 |
__ASSERT_DEBUG( fetchResult && fetchResult->Count() > 0, |
|
292 |
Panic( EPanicLogicPhaseCompletion ) ); |
|
293 |
||
294 |
TRAP( err, LaunchSelectSinglePropertyPhaseL( fetchResult ) ); |
|
295 |
} |
|
296 |
else if ( &aPhase == iSelectPropertyPhase ) |
|
297 |
{ |
|
298 |
TRAP( err, LaunchPrepareSingleAssignPhaseL |
|
299 |
( iSelectPropertyPhase->TakeStoreContact() ) ); |
|
300 |
} |
|
301 |
else if ( &aPhase == iPrepareAssignPhase ) |
|
302 |
{ |
|
303 |
TRAP( err, LaunchAssignPhaseL |
|
304 |
( iPrepareAssignPhase->TakeStoreContact() ) ); |
|
305 |
} |
|
306 |
else if ( &aPhase == iAssignDataPhase ) |
|
307 |
{ |
|
308 |
iObserver.ServiceComplete(); |
|
309 |
} |
|
310 |
else |
|
311 |
{ |
|
312 |
__ASSERT_DEBUG( EFalse, Panic( EPanicLogicPhaseCompletion ) ); |
|
313 |
} |
|
314 |
||
315 |
if ( err != KErrNone ) |
|
316 |
{ |
|
317 |
iObserver.ServiceError( err ); |
|
318 |
} |
|
319 |
} |
|
320 |
||
321 |
// -------------------------------------------------------------------------- |
|
322 |
// CPbk2SingleContactDataAssigner::PreviousPhase |
|
323 |
// -------------------------------------------------------------------------- |
|
324 |
// |
|
325 |
void CPbk2SingleContactDataAssigner::PreviousPhase |
|
326 |
( MPbk2ServicePhase& aPhase ) |
|
327 |
{ |
|
328 |
TInt err = KErrNone; |
|
329 |
||
330 |
if ( &aPhase == iPrepareAssignPhase ) |
|
331 |
{ |
|
332 |
MVPbkContactLinkArray* resultLinks = aPhase.Results(); |
|
333 |
__ASSERT_DEBUG( resultLinks && resultLinks->Count() == 1, |
|
334 |
Panic( EPanicLogicPhaseCompletion ) ); |
|
335 |
||
336 |
TRAP( err, LaunchSelectSinglePropertyPhaseL( resultLinks ) ); |
|
337 |
} |
|
338 |
||
339 |
if ( err != KErrNone ) |
|
340 |
{ |
|
341 |
iObserver.ServiceError( err ); |
|
342 |
} |
|
343 |
} |
|
344 |
||
345 |
// -------------------------------------------------------------------------- |
|
346 |
// CPbk2SingleContactDataAssigner::PhaseCanceled |
|
347 |
// -------------------------------------------------------------------------- |
|
348 |
// |
|
349 |
void CPbk2SingleContactDataAssigner::PhaseCanceled |
|
350 |
( MPbk2ServicePhase& /*aPhase*/ ) |
|
351 |
{ |
|
352 |
iObserver.ServiceCanceled(); |
|
353 |
} |
|
354 |
||
355 |
// -------------------------------------------------------------------------- |
|
356 |
// CPbk2SingleContactDataAssigner::PhaseAborted |
|
357 |
// -------------------------------------------------------------------------- |
|
358 |
// |
|
359 |
void CPbk2SingleContactDataAssigner::PhaseAborted |
|
360 |
( MPbk2ServicePhase& /*aPhase*/ ) |
|
361 |
{ |
|
362 |
iObserver.ServiceAborted(); |
|
363 |
} |
|
364 |
||
365 |
// -------------------------------------------------------------------------- |
|
366 |
// CPbk2SingleContactDataAssigner::PhaseError |
|
367 |
// -------------------------------------------------------------------------- |
|
368 |
// |
|
369 |
void CPbk2SingleContactDataAssigner::PhaseError |
|
370 |
( MPbk2ServicePhase& /*aPhase*/, TInt aErrorCode ) |
|
371 |
{ |
|
372 |
iObserver.ServiceError( aErrorCode ); |
|
373 |
} |
|
374 |
||
375 |
// -------------------------------------------------------------------------- |
|
376 |
// CPbk2SingleContactDataAssigner::PhaseOkToExit |
|
377 |
// -------------------------------------------------------------------------- |
|
378 |
// |
|
379 |
TBool CPbk2SingleContactDataAssigner::PhaseOkToExit |
|
380 |
( MPbk2ServicePhase& /*aPhase*/, TInt aCommandId ) |
|
381 |
{ |
|
382 |
// Deny exit and pass an asynchronous query to the consumer, |
|
383 |
// which may later approve exit |
|
384 |
iObserver.CompleteExitMessage( aCommandId ); |
|
385 |
return EFalse; |
|
386 |
} |
|
387 |
||
388 |
// -------------------------------------------------------------------------- |
|
389 |
// CPbk2SingleContactDataAssigner::PhaseAccept |
|
390 |
// -------------------------------------------------------------------------- |
|
391 |
// |
|
392 |
void CPbk2SingleContactDataAssigner::PhaseAccept |
|
393 |
( MPbk2ServicePhase& /*aPhase*/, const TDesC8& /*aMarkedEntries*/, |
|
394 |
const TDesC8& /*aLinkData*/ ) |
|
395 |
{ |
|
396 |
// Not supported in assign |
|
397 |
} |
|
398 |
||
399 |
// -------------------------------------------------------------------------- |
|
400 |
// CPbk2SingleContactDataAssigner::ContactUiReadyL |
|
401 |
// -------------------------------------------------------------------------- |
|
402 |
// |
|
403 |
void CPbk2SingleContactDataAssigner::ContactUiReadyL |
|
404 |
( MPbk2StartupMonitor& aStartupMonitor ) |
|
405 |
{ |
|
406 |
aStartupMonitor.DeregisterEvents( *this ); |
|
407 |
||
408 |
if ( iAssignFlags & ECreateNewContact ) |
|
409 |
{ |
|
410 |
CVPbkContactStoreUriArray* validStores = |
|
411 |
iStoreManager->CurrentlyValidStoresL(); |
|
412 |
CleanupStack::PushL( validStores ); |
|
413 |
||
414 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&> |
|
415 |
( *CEikonEnv::Static()->EikAppUi() ); |
|
416 |
||
417 |
// Saving store URI |
|
418 |
TVPbkContactStoreUriPtr savingStoreUri = |
|
419 |
appUi.ApplicationServices().StoreConfiguration(). |
|
420 |
DefaultSavingStoreL(); |
|
421 |
||
422 |
TPbk2AssignNoteService noteService; |
|
423 |
if ( validStores->IsIncluded ( savingStoreUri ) ) |
|
424 |
{ |
|
425 |
LaunchSelectCreateNewPropertyPhaseL( savingStoreUri ); |
|
426 |
} |
|
427 |
else if ( noteService.ShowCreateNewToPhoneQueryL() ) |
|
428 |
{ |
|
429 |
savingStoreUri.Set( |
|
430 |
TVPbkContactStoreUriPtr( |
|
431 |
VPbkContactStoreUris::DefaultCntDbUri() ) ); |
|
432 |
LaunchSelectCreateNewPropertyPhaseL( savingStoreUri ); |
|
433 |
} |
|
434 |
else |
|
435 |
{ |
|
436 |
// Canceled |
|
437 |
iObserver.ServiceCanceled(); |
|
438 |
} |
|
439 |
||
440 |
CleanupStack::PopAndDestroy( validStores ); |
|
441 |
} |
|
442 |
else |
|
443 |
{ |
|
444 |
if ( iPreselectedContact && iPreselectedContact->Count() == 1 ) |
|
445 |
{ |
|
446 |
if ( iStoreManager->ContactsAvailableL( *iPreselectedContact ) ) |
|
447 |
{ |
|
448 |
LaunchSelectSinglePropertyPhaseL( iPreselectedContact ); |
|
449 |
} |
|
450 |
else |
|
451 |
{ |
|
452 |
iObserver.ServiceError( KErrNotSupported ); |
|
453 |
} |
|
454 |
} |
|
455 |
else |
|
456 |
{ |
|
457 |
LaunchFetchPhaseL(); |
|
458 |
} |
|
459 |
} |
|
460 |
} |
|
461 |
||
462 |
// -------------------------------------------------------------------------- |
|
463 |
// CPbk2SingleContactDataAssigner::StartupCanceled |
|
464 |
// -------------------------------------------------------------------------- |
|
465 |
// |
|
466 |
void CPbk2SingleContactDataAssigner::StartupCanceled( TInt aErrorCode ) |
|
467 |
{ |
|
468 |
if ( aErrorCode == KErrCancel ) |
|
469 |
{ |
|
470 |
iObserver.ServiceCanceled(); |
|
471 |
} |
|
472 |
else |
|
473 |
{ |
|
474 |
iObserver.ServiceError( aErrorCode ); |
|
475 |
} |
|
476 |
} |
|
477 |
||
478 |
// -------------------------------------------------------------------------- |
|
479 |
// CPbk2SingleContactDataAssigner::LaunchFetchPhaseL |
|
480 |
// -------------------------------------------------------------------------- |
|
481 |
// |
|
482 |
void CPbk2SingleContactDataAssigner::LaunchFetchPhaseL() |
|
483 |
{ |
|
484 |
CPbk2FetchDlg::TParams params; |
|
485 |
params.iResId = R_PBK2_SINGLE_ENTRY_FETCH_DLG; |
|
486 |
params.iFlags = CPbk2FetchDlg::EFetchSingle; |
|
487 |
||
488 |
delete iFetchPhase; |
|
489 |
iFetchPhase = NULL; |
|
490 |
iFetchPhase = CPbk2ContactFetchPhase::NewL |
|
491 |
( *this, *iStoreManager, params, ETrue, |
|
492 |
MPbk2FetchDlgObserver::EFetchYes, iContactViewFilter, |
|
493 |
iUseDeviceConfig, iStoreUris ); |
|
494 |
||
495 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&> |
|
496 |
( *CEikonEnv::Static()->EikAppUi() ); |
|
497 |
||
498 |
// Change layout to fetch's layout |
|
499 |
appUi.ChangeStatuspaneLayoutL( |
|
500 |
CPbk2ServerAppAppUi::EStatusPaneLayoutUsual ); |
|
501 |
||
502 |
iFetchPhase->LaunchServicePhaseL(); |
|
503 |
} |
|
504 |
||
505 |
// -------------------------------------------------------------------------- |
|
506 |
// CPbk2SingleContactDataAssigner::LaunchSelectSinglePropertyPhaseL |
|
507 |
// -------------------------------------------------------------------------- |
|
508 |
// |
|
509 |
void CPbk2SingleContactDataAssigner::LaunchSelectSinglePropertyPhaseL |
|
510 |
( MVPbkContactLinkArray* aContactLinks ) |
|
511 |
{ |
|
512 |
delete iSelectPropertyPhase; |
|
513 |
iSelectPropertyPhase = NULL; |
|
514 |
||
515 |
// Prepare parameters by reseting them |
|
516 |
delete iSelectFieldProperty; |
|
517 |
iSelectFieldProperty = NULL; |
|
518 |
iSelectFieldResult = KErrNotReady; |
|
519 |
||
520 |
iSelectPropertyPhase = CPbk2SelectSinglePropertyPhase::NewL |
|
521 |
( *this, aContactLinks, iAddressSelectFilterBuffer, |
|
522 |
iSelectFieldProperty, iSelectFieldResult ); |
|
523 |
||
524 |
iRelocationFlags = CPbk2ContactRelocator::EPbk2RelocatorExistingContact; |
|
525 |
||
526 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&> |
|
527 |
( *CEikonEnv::Static()->EikAppUi() ); |
|
528 |
||
529 |
// Change layout back to regular |
|
530 |
appUi.ChangeStatuspaneLayoutL( |
|
531 |
CPbk2ServerAppAppUi::EStatusPaneLayoutEmpty ); |
|
532 |
||
533 |
iSelectPropertyPhase->LaunchServicePhaseL(); |
|
534 |
} |
|
535 |
||
536 |
// -------------------------------------------------------------------------- |
|
537 |
// CPbk2SingleContactDataAssigner::LaunchSelectCreateNewPropertyPhaseL |
|
538 |
// -------------------------------------------------------------------------- |
|
539 |
// |
|
540 |
void CPbk2SingleContactDataAssigner::LaunchSelectCreateNewPropertyPhaseL( |
|
541 |
TVPbkContactStoreUriPtr savingStoreUri ) |
|
542 |
{ |
|
543 |
delete iSelectPropertyPhase; |
|
544 |
iSelectPropertyPhase = NULL; |
|
545 |
||
546 |
// Prepare parameters by reseting them |
|
547 |
delete iSelectFieldProperty; |
|
548 |
iSelectFieldProperty = NULL; |
|
549 |
iSelectFieldResult = KErrNotReady; |
|
550 |
||
551 |
iSelectPropertyPhase = CPbk2SelectCreateNewPropertyPhase::NewL |
|
552 |
( savingStoreUri, *this, iAddressSelectFilterBuffer, |
|
553 |
iSelectFieldProperty, iSelectFieldResult, iInformationNoteFlags ); |
|
554 |
||
555 |
iRelocationFlags = CPbk2ContactRelocator::EPbk2RelocatorNewContact; |
|
556 |
||
557 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&> |
|
558 |
( *CEikonEnv::Static()->EikAppUi() ); |
|
559 |
||
560 |
// Change layout back to regular |
|
561 |
appUi.ChangeStatuspaneLayoutL( |
|
562 |
CPbk2ServerAppAppUi::EStatusPaneLayoutEmpty ); |
|
563 |
||
564 |
iSelectPropertyPhase->LaunchServicePhaseL(); |
|
565 |
} |
|
566 |
||
567 |
// -------------------------------------------------------------------------- |
|
568 |
// CPbk2SingleContactDataAssigner::LaunchPrepareSingleAssignPhaseL |
|
569 |
// -------------------------------------------------------------------------- |
|
570 |
// |
|
571 |
void CPbk2SingleContactDataAssigner::LaunchPrepareSingleAssignPhaseL |
|
572 |
( MVPbkStoreContact* aStoreContact ) |
|
573 |
{ |
|
574 |
delete iPrepareAssignPhase; |
|
575 |
iPrepareAssignPhase = NULL; |
|
576 |
||
577 |
CleanupStack::PushL( aStoreContact ); |
|
578 |
iPrepareAssignPhase = CPbk2PrepareSingleAssignPhase::NewL |
|
579 |
( *this, aStoreContact, iSelectFieldProperty, |
|
580 |
iSelectFieldResult, iFieldIndex, iInformationNoteFlags, |
|
581 |
iRelocationFlags ); |
|
582 |
CleanupStack::Pop( aStoreContact ); |
|
583 |
||
584 |
iPrepareAssignPhase->LaunchServicePhaseL(); |
|
585 |
} |
|
586 |
||
587 |
// -------------------------------------------------------------------------- |
|
588 |
// CPbk2SingleContactDataAssigner::LaunchAssignPhaseL |
|
589 |
// -------------------------------------------------------------------------- |
|
590 |
// |
|
591 |
void CPbk2SingleContactDataAssigner::LaunchAssignPhaseL |
|
592 |
( MVPbkStoreContact* aStoreContact ) |
|
593 |
{ |
|
594 |
delete iAssignDataPhase; |
|
595 |
iAssignDataPhase = NULL; |
|
596 |
||
597 |
CleanupStack::PushL( aStoreContact ); |
|
598 |
iAssignDataPhase = CPbk2SingleAssignDataPhase::NewL |
|
599 |
( *this, aStoreContact, iSelectFieldProperty, |
|
600 |
iFieldIndex, iDataBuffer, iMimeType, |
|
601 |
iEditorHelpContext, iAssignFlags, iInformationNoteFlags ); |
|
602 |
CleanupStack::Pop( aStoreContact ); |
|
603 |
||
604 |
// In case of the assign phase it is important to delete the |
|
605 |
// previous phases so that exit and cancel methods work correctly |
|
606 |
delete iPrepareAssignPhase; |
|
607 |
iPrepareAssignPhase = NULL; |
|
608 |
delete iSelectPropertyPhase; |
|
609 |
iSelectPropertyPhase = NULL; |
|
610 |
delete iFetchPhase; |
|
611 |
iFetchPhase = NULL; |
|
612 |
||
613 |
// If need to open the editor, then change StatuspaneLayout to |
|
614 |
// CPbk2ServerAppAppUi::EStatusPaneLayoutUsual |
|
615 |
if (!(iAssignFlags & EDoNotOpenEditor)) |
|
616 |
{ |
|
617 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&> |
|
618 |
( *CEikonEnv::Static()->EikAppUi() ); |
|
619 |
appUi.ChangeStatuspaneLayoutL(CPbk2ServerAppAppUi::EStatusPaneLayoutUsual); |
|
620 |
} |
|
621 |
||
622 |
iAssignDataPhase->LaunchServicePhaseL(); |
|
623 |
} |
|
624 |
||
625 |
// End of File |