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 attribute address select phase.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "CPbk2AttributeAddressSelectPhase.h"
|
|
19 |
|
|
20 |
// Phonebook 2
|
|
21 |
#include "MPbk2ServicePhaseObserver.h"
|
|
22 |
#include "CPbk2ServerAppAppUi.h"
|
|
23 |
#include "CPbk2KeyEventDealer.h"
|
|
24 |
#include <MPbk2DialogEliminator.h>
|
|
25 |
#include <CPbk2AddressSelect.h>
|
|
26 |
#include <TPbk2AddressSelectParams.h>
|
|
27 |
#include <MPbk2ApplicationServices.h>
|
|
28 |
#include <Pbk2UIControls.rsg>
|
|
29 |
#include <CPbk2StoreManager.h>
|
|
30 |
|
|
31 |
// Virtual Phonebook
|
|
32 |
#include <MVPbkContactLink.h>
|
|
33 |
#include <CVPbkContactLinkArray.h>
|
|
34 |
#include <MVPbkContactOperationBase.h>
|
|
35 |
#include <MVPbkStoreContact.h>
|
|
36 |
#include <CVPbkContactManager.h>
|
|
37 |
#include <CVPbkSpeedDialAttribute.h>
|
|
38 |
#include <VPbkFieldTypeSelectorFactory.h>
|
|
39 |
#include <CVPbkFieldTypeSelector.h>
|
|
40 |
#include <VPbkFieldTypeSelectors.rsg>
|
|
41 |
#include <VPbkContactViewFilterBuilder.h>
|
|
42 |
|
|
43 |
// System includes
|
|
44 |
#include <barsread.h>
|
|
45 |
#include <avkon.rsg>
|
|
46 |
#include <featmgr.h>
|
|
47 |
|
|
48 |
/// Unnamed namespace for local definitions
|
|
49 |
namespace {
|
|
50 |
|
|
51 |
const TInt KFirstElement = 0;
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Copies a link array to another.
|
|
55 |
*
|
|
56 |
* @param aSourceLinkArray Link array which is copied
|
|
57 |
* @param aTargetLinkArray Links are copied to this
|
|
58 |
*/
|
|
59 |
void CopyContactLinksL( const MVPbkContactLinkArray& aSourceLinkArray,
|
|
60 |
CVPbkContactLinkArray& aTargetLinkArray )
|
|
61 |
{
|
|
62 |
const TInt count = aSourceLinkArray.Count();
|
|
63 |
for ( TInt i(0); i < count; ++i )
|
|
64 |
{
|
|
65 |
const MVPbkContactLink& contactLink = aSourceLinkArray.At(i);
|
|
66 |
aTargetLinkArray.AppendL( contactLink.CloneLC() );
|
|
67 |
CleanupStack::Pop(); // link
|
|
68 |
}
|
|
69 |
}
|
|
70 |
|
|
71 |
} /// namespace
|
|
72 |
|
|
73 |
// --------------------------------------------------------------------------
|
|
74 |
// CPbk2AttributeAddressSelectPhase::CPbk2AttributeAddressSelectPhase
|
|
75 |
// --------------------------------------------------------------------------
|
|
76 |
//
|
|
77 |
CPbk2AttributeAddressSelectPhase::CPbk2AttributeAddressSelectPhase
|
|
78 |
( MPbk2ServicePhaseObserver& aObserver,
|
|
79 |
TPbk2AttributeAssignData aAttributeData,
|
|
80 |
TBool aRskBack ) :
|
|
81 |
iObserver( aObserver ),
|
|
82 |
iAttributeData( aAttributeData ),
|
|
83 |
iRskBack( aRskBack )
|
|
84 |
{
|
|
85 |
}
|
|
86 |
|
|
87 |
// --------------------------------------------------------------------------
|
|
88 |
// CPbk2AttributeAddressSelectPhase::~CPbk2AttributeAddressSelectPhase
|
|
89 |
// --------------------------------------------------------------------------
|
|
90 |
//
|
|
91 |
CPbk2AttributeAddressSelectPhase::~CPbk2AttributeAddressSelectPhase()
|
|
92 |
{
|
|
93 |
if ( iAddressSelectEliminator )
|
|
94 |
{
|
|
95 |
iAddressSelectEliminator->ForceExit();
|
|
96 |
}
|
|
97 |
delete iStoreContact;
|
|
98 |
delete iRetrieveOperation;
|
|
99 |
delete iContactLinks;
|
|
100 |
delete iResults;
|
|
101 |
delete iDealer;
|
|
102 |
|
|
103 |
FeatureManager::UnInitializeLib();
|
|
104 |
}
|
|
105 |
|
|
106 |
// --------------------------------------------------------------------------
|
|
107 |
// CPbk2AttributeAddressSelectPhase::ConstructL
|
|
108 |
// --------------------------------------------------------------------------
|
|
109 |
//
|
|
110 |
inline void CPbk2AttributeAddressSelectPhase::ConstructL
|
|
111 |
( MVPbkContactLinkArray* aContactLinks )
|
|
112 |
{
|
|
113 |
iEikEnv = CEikonEnv::Static();
|
|
114 |
|
|
115 |
iContactLinks = CVPbkContactLinkArray::NewL();
|
|
116 |
if ( aContactLinks )
|
|
117 |
{
|
|
118 |
CopyContactLinksL( *aContactLinks, *iContactLinks );
|
|
119 |
}
|
|
120 |
FeatureManager::InitializeLibL();
|
|
121 |
}
|
|
122 |
|
|
123 |
// --------------------------------------------------------------------------
|
|
124 |
// CPbk2AttributeAddressSelectPhase::NewL
|
|
125 |
// --------------------------------------------------------------------------
|
|
126 |
//
|
|
127 |
CPbk2AttributeAddressSelectPhase* CPbk2AttributeAddressSelectPhase::NewL
|
|
128 |
( MPbk2ServicePhaseObserver& aObserver,
|
|
129 |
MVPbkContactLinkArray* aContactLinks,
|
|
130 |
TPbk2AttributeAssignData aAttributeData,
|
|
131 |
TBool aRskBack )
|
|
132 |
{
|
|
133 |
CPbk2AttributeAddressSelectPhase* self =
|
|
134 |
new ( ELeave ) CPbk2AttributeAddressSelectPhase
|
|
135 |
( aObserver, aAttributeData, aRskBack );
|
|
136 |
CleanupStack::PushL( self );
|
|
137 |
self->ConstructL( aContactLinks );
|
|
138 |
CleanupStack::Pop( self );
|
|
139 |
return self;
|
|
140 |
}
|
|
141 |
|
|
142 |
// --------------------------------------------------------------------------
|
|
143 |
// CPbk2AttributeAddressSelectPhase::LaunchServicePhaseL
|
|
144 |
// --------------------------------------------------------------------------
|
|
145 |
//
|
|
146 |
void CPbk2AttributeAddressSelectPhase::LaunchServicePhaseL()
|
|
147 |
{
|
|
148 |
RetrieveContactL();
|
|
149 |
}
|
|
150 |
|
|
151 |
// --------------------------------------------------------------------------
|
|
152 |
// CPbk2AttributeAddressSelectPhase::CancelServicePhase
|
|
153 |
// --------------------------------------------------------------------------
|
|
154 |
//
|
|
155 |
void CPbk2AttributeAddressSelectPhase::CancelServicePhase()
|
|
156 |
{
|
|
157 |
if ( iAddressSelectEliminator )
|
|
158 |
{
|
|
159 |
iAddressSelectEliminator->ForceExit();
|
|
160 |
}
|
|
161 |
|
|
162 |
iObserver.PhaseCanceled( *this );
|
|
163 |
}
|
|
164 |
|
|
165 |
// --------------------------------------------------------------------------
|
|
166 |
// CPbk2AttributeAddressSelectPhase::RequestCancelL
|
|
167 |
// --------------------------------------------------------------------------
|
|
168 |
//
|
|
169 |
void CPbk2AttributeAddressSelectPhase::RequestCancelL( TInt aExitCommandId )
|
|
170 |
{
|
|
171 |
if ( iAddressSelectEliminator )
|
|
172 |
{
|
|
173 |
iAddressSelectEliminator->RequestExitL( aExitCommandId );
|
|
174 |
}
|
|
175 |
|
|
176 |
// Withdraw our key event agent so that it does not react to
|
|
177 |
// app shutter's escape key event simulation
|
|
178 |
delete iDealer;
|
|
179 |
iDealer = NULL;
|
|
180 |
|
|
181 |
if ( aExitCommandId == EEikBidCancel )
|
|
182 |
{
|
|
183 |
iObserver.PhaseAborted( *this );
|
|
184 |
}
|
|
185 |
else
|
|
186 |
{
|
|
187 |
iObserver.PhaseCanceled( *this );
|
|
188 |
}
|
|
189 |
}
|
|
190 |
|
|
191 |
// --------------------------------------------------------------------------
|
|
192 |
// CPbk2AttributeAddressSelectPhase::AcceptDelayed
|
|
193 |
// --------------------------------------------------------------------------
|
|
194 |
//
|
|
195 |
void CPbk2AttributeAddressSelectPhase::AcceptDelayedL
|
|
196 |
( const TDesC8& /*aContactLinkBuffer*/ )
|
|
197 |
{
|
|
198 |
// Nothing to accept
|
|
199 |
}
|
|
200 |
|
|
201 |
// --------------------------------------------------------------------------
|
|
202 |
// CPbk2AttributeAddressSelectPhase::DenyDelayed
|
|
203 |
// --------------------------------------------------------------------------
|
|
204 |
//
|
|
205 |
void CPbk2AttributeAddressSelectPhase::DenyDelayedL
|
|
206 |
( const TDesC8& /*aContactLinkBuffer*/ )
|
|
207 |
{
|
|
208 |
// Nothing to deny
|
|
209 |
}
|
|
210 |
|
|
211 |
// --------------------------------------------------------------------------
|
|
212 |
// CPbk2AttributeAddressSelectPhase::Results
|
|
213 |
// --------------------------------------------------------------------------
|
|
214 |
//
|
|
215 |
MVPbkContactLinkArray* CPbk2AttributeAddressSelectPhase::Results() const
|
|
216 |
{
|
|
217 |
return iResults;
|
|
218 |
}
|
|
219 |
|
|
220 |
// --------------------------------------------------------------------------
|
|
221 |
// CPbk2AttributeAddressSelectPhase::ExtraResultData
|
|
222 |
// --------------------------------------------------------------------------
|
|
223 |
//
|
|
224 |
TInt CPbk2AttributeAddressSelectPhase::ExtraResultData() const
|
|
225 |
{
|
|
226 |
return KErrNotSupported;
|
|
227 |
}
|
|
228 |
|
|
229 |
// --------------------------------------------------------------------------
|
|
230 |
// CPbk2AttributeAddressSelectPhase::TakeStoreContact
|
|
231 |
// --------------------------------------------------------------------------
|
|
232 |
//
|
|
233 |
MVPbkStoreContact* CPbk2AttributeAddressSelectPhase::TakeStoreContact()
|
|
234 |
{
|
|
235 |
// Not supported
|
|
236 |
return NULL;
|
|
237 |
}
|
|
238 |
|
|
239 |
// --------------------------------------------------------------------------
|
|
240 |
// CPbk2AttributeAddressSelectPhase::FieldContent
|
|
241 |
// --------------------------------------------------------------------------
|
|
242 |
//
|
|
243 |
HBufC* CPbk2AttributeAddressSelectPhase::FieldContent() const
|
|
244 |
{
|
|
245 |
return NULL;
|
|
246 |
}
|
|
247 |
|
|
248 |
// --------------------------------------------------------------------------
|
|
249 |
// CPbk2AttributeAddressSelectPhase::VPbkSingleContactOperationComplete
|
|
250 |
// --------------------------------------------------------------------------
|
|
251 |
//
|
|
252 |
void CPbk2AttributeAddressSelectPhase::VPbkSingleContactOperationComplete
|
|
253 |
( MVPbkContactOperationBase& /*aOperation*/,
|
|
254 |
MVPbkStoreContact* aContact )
|
|
255 |
{
|
|
256 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&>
|
|
257 |
( *iEikEnv->EikAppUi() );
|
|
258 |
TInt err( KErrNone );
|
|
259 |
|
|
260 |
// Contact retrieval complete
|
|
261 |
delete iStoreContact;
|
|
262 |
iStoreContact = aContact;
|
|
263 |
|
|
264 |
TRAP( err, SelectAddressesL() );
|
|
265 |
|
|
266 |
if ( err != KErrNone )
|
|
267 |
{
|
|
268 |
// Deregister store events if something went wrong.
|
|
269 |
appUi.StoreManager().DeregisterStoreEvents( *this );
|
|
270 |
iObserver.PhaseError( *this, err );
|
|
271 |
}
|
|
272 |
}
|
|
273 |
|
|
274 |
// --------------------------------------------------------------------------
|
|
275 |
// CPbk2AttributeAddressSelectPhase::VPbkSingleContactOperationFailed
|
|
276 |
// --------------------------------------------------------------------------
|
|
277 |
//
|
|
278 |
void CPbk2AttributeAddressSelectPhase::VPbkSingleContactOperationFailed
|
|
279 |
( MVPbkContactOperationBase& /*aOperation*/, TInt aError )
|
|
280 |
{
|
|
281 |
iObserver.PhaseError( *this, aError );
|
|
282 |
}
|
|
283 |
|
|
284 |
// --------------------------------------------------------------------------
|
|
285 |
// CPbk2AttributeAddressSelectPhase::Pbk2ProcessKeyEventL
|
|
286 |
// --------------------------------------------------------------------------
|
|
287 |
//
|
|
288 |
TBool CPbk2AttributeAddressSelectPhase::Pbk2ProcessKeyEventL
|
|
289 |
( const TKeyEvent& aKeyEvent, TEventCode aType )
|
|
290 |
{
|
|
291 |
TBool ret = EFalse;
|
|
292 |
|
|
293 |
if ( aType == EEventKey && aKeyEvent.iCode == EKeyEscape )
|
|
294 |
{
|
|
295 |
iObserver.PhaseOkToExit( *this, EEikBidCancel );
|
|
296 |
ret = ETrue;
|
|
297 |
}
|
|
298 |
|
|
299 |
return ret;
|
|
300 |
}
|
|
301 |
|
|
302 |
// --------------------------------------------------------------------------
|
|
303 |
// CPbk2AttributeAddressSelectPhase::StoreReady
|
|
304 |
// --------------------------------------------------------------------------
|
|
305 |
//
|
|
306 |
void CPbk2AttributeAddressSelectPhase::StoreReady(
|
|
307 |
MVPbkContactStore& /*aContactStore*/ )
|
|
308 |
{
|
|
309 |
// not interested
|
|
310 |
}
|
|
311 |
|
|
312 |
// --------------------------------------------------------------------------
|
|
313 |
// CPbk2AttributeAddressSelectPhase::StoreUnavailable
|
|
314 |
// --------------------------------------------------------------------------
|
|
315 |
//
|
|
316 |
void CPbk2AttributeAddressSelectPhase::StoreUnavailable(
|
|
317 |
MVPbkContactStore& /*aContactStore*/,
|
|
318 |
TInt /*aReason*/ )
|
|
319 |
{
|
|
320 |
// not interested
|
|
321 |
}
|
|
322 |
|
|
323 |
// --------------------------------------------------------------------------
|
|
324 |
// CPbk2AttributeAddressSelectPhase::StoreUnavailable
|
|
325 |
// --------------------------------------------------------------------------
|
|
326 |
//
|
|
327 |
void CPbk2AttributeAddressSelectPhase::HandleStoreEventL(
|
|
328 |
MVPbkContactStore& /*aContactStore*/,
|
|
329 |
TVPbkContactStoreEvent aEvent )
|
|
330 |
{
|
|
331 |
if ( aEvent.iContactLink != NULL && iStoreContact != NULL )
|
|
332 |
{
|
|
333 |
if ( aEvent.iContactLink->RefersTo( *iStoreContact ) )
|
|
334 |
{
|
|
335 |
RDebug::Print(_L("----CPbk2AttributeAddressSelectPhase::HandleStoreEventL() - dismiss dialog"));
|
|
336 |
// dismiss address selection dialog since contact was changed
|
|
337 |
if ( iAddressSelectEliminator )
|
|
338 |
{
|
|
339 |
iAddressSelectEliminator->ForceExit();
|
|
340 |
}
|
|
341 |
|
|
342 |
// observer will be notified in SelectAddressesL() after closing
|
|
343 |
// address selection dialog
|
|
344 |
}
|
|
345 |
}
|
|
346 |
}
|
|
347 |
|
|
348 |
// --------------------------------------------------------------------------
|
|
349 |
// CPbk2AttributeAddressSelectPhase::RetrieveContactL
|
|
350 |
// --------------------------------------------------------------------------
|
|
351 |
//
|
|
352 |
void CPbk2AttributeAddressSelectPhase::RetrieveContactL()
|
|
353 |
{
|
|
354 |
CPbk2ServerAppAppUi& appUi =
|
|
355 |
static_cast<CPbk2ServerAppAppUi&>
|
|
356 |
( *iEikEnv->EikAppUi() );
|
|
357 |
|
|
358 |
delete iRetrieveOperation;
|
|
359 |
iRetrieveOperation = NULL;
|
|
360 |
iRetrieveOperation = appUi.ApplicationServices().ContactManager().
|
|
361 |
RetrieveContactL( iContactLinks->At( KFirstElement ), *this );
|
|
362 |
}
|
|
363 |
|
|
364 |
// --------------------------------------------------------------------------
|
|
365 |
// CPbk2AttributeAddressSelectPhase::SelectAddressesL
|
|
366 |
// --------------------------------------------------------------------------
|
|
367 |
//
|
|
368 |
void CPbk2AttributeAddressSelectPhase::SelectAddressesL()
|
|
369 |
{
|
|
370 |
MVPbkStoreContactField* field = CheckIfFieldAlreadySelectedL();
|
|
371 |
|
|
372 |
if ( !field )
|
|
373 |
{
|
|
374 |
TInt resourceId = AddressSelectResourceId( iAttributeData );
|
|
375 |
// Field was not already selected --> querying it
|
|
376 |
TResourceReader reader;
|
|
377 |
CCoeEnv::Static()->CreateResourceReaderLC( reader, resourceId );
|
|
378 |
|
|
379 |
CPbk2ServerAppAppUi& appUi = static_cast<CPbk2ServerAppAppUi&>
|
|
380 |
( *iEikEnv->EikAppUi() );
|
|
381 |
|
|
382 |
TPbk2AddressSelectParams params
|
|
383 |
( *iStoreContact, appUi.ApplicationServices().ContactManager(),
|
|
384 |
appUi.ApplicationServices().NameFormatter(),
|
|
385 |
appUi.ApplicationServices().FieldProperties(),
|
|
386 |
reader, R_QTN_PHOB_TITLE_SELECT_DEFAULT );
|
|
387 |
params.SetTitleToIncludeContactName( EFalse );
|
|
388 |
|
|
389 |
CVPbkFieldTypeSelector* fieldTypeSelector = NULL;
|
|
390 |
|
|
391 |
// In speed dial, for voip fields we build a fieldselector
|
|
392 |
// from vpbkfieldtypeselectorfactory. This makes sure the
|
|
393 |
// right voip fields are shown in the address select dialog
|
|
394 |
if ( iAttributeData.iAttributeUid ==
|
|
395 |
TUid::Uid( KVPbkSpeedDialAttributeImplementationUID ) )
|
|
396 |
{
|
|
397 |
// Speedial specific filter
|
|
398 |
if( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
|
|
399 |
{
|
|
400 |
fieldTypeSelector = VPbkFieldTypeSelectorFactory::
|
|
401 |
BuildContactActionTypeSelectorL(
|
|
402 |
VPbkFieldTypeSelectorFactory::EVOIPCallSelector,
|
|
403 |
appUi.ApplicationServices().ContactManager().FieldTypes() );
|
|
404 |
CleanupStack::PushL( fieldTypeSelector );
|
|
405 |
}
|
|
406 |
else
|
|
407 |
{
|
|
408 |
fieldTypeSelector = CVPbkFieldTypeSelector::NewL(
|
|
409 |
appUi.ApplicationServices().ContactManager().FieldTypes() );
|
|
410 |
CleanupStack::PushL( fieldTypeSelector );
|
|
411 |
}
|
|
412 |
|
|
413 |
VPbkContactViewFilterBuilder::BuildContactViewFilterL(
|
|
414 |
*fieldTypeSelector,
|
|
415 |
EVPbkContactViewFilterPhoneNumber,
|
|
416 |
appUi.ApplicationServices().ContactManager() );
|
|
417 |
}
|
|
418 |
|
|
419 |
// Run address select
|
|
420 |
CPbk2AddressSelect* addressSelect = CPbk2AddressSelect::NewL(
|
|
421 |
params,
|
|
422 |
*fieldTypeSelector,
|
|
423 |
NULL,
|
|
424 |
NULL );
|
|
425 |
|
|
426 |
// Correct CBA buttons
|
|
427 |
TInt correctedCba = CorrectRSK( resourceId );
|
|
428 |
if ( correctedCba > KErrNone )
|
|
429 |
{
|
|
430 |
addressSelect->SetCba( correctedCba );
|
|
431 |
}
|
|
432 |
|
|
433 |
// Execute
|
|
434 |
iAddressSelectEliminator = addressSelect;
|
|
435 |
iAddressSelectEliminator->ResetWhenDestroyed
|
|
436 |
( &iAddressSelectEliminator );
|
|
437 |
appUi.StoreManager().RegisterStoreEventsL( *this );
|
|
438 |
field = addressSelect->ExecuteLD();
|
|
439 |
appUi.StoreManager().DeregisterStoreEvents( *this );
|
|
440 |
if ( fieldTypeSelector )
|
|
441 |
{
|
|
442 |
CleanupStack::PopAndDestroy( 2 ); // fieldTypeSelector, reader
|
|
443 |
}
|
|
444 |
else
|
|
445 |
{
|
|
446 |
CleanupStack::PopAndDestroy(); // reader
|
|
447 |
}
|
|
448 |
|
|
449 |
}
|
|
450 |
|
|
451 |
if ( field )
|
|
452 |
{
|
|
453 |
CleanupDeletePushL( field );
|
|
454 |
AppendResultL( field );
|
|
455 |
CleanupStack::PopAndDestroy( field );
|
|
456 |
iObserver.NextPhase( *this );
|
|
457 |
}
|
|
458 |
else
|
|
459 |
{
|
|
460 |
iObserver.PhaseCanceled( *this );
|
|
461 |
}
|
|
462 |
}
|
|
463 |
|
|
464 |
// --------------------------------------------------------------------------
|
|
465 |
// CPbk2AttributeAddressSelectPhase::CheckIfFieldAlreadySelectedL
|
|
466 |
// --------------------------------------------------------------------------
|
|
467 |
//
|
|
468 |
inline MVPbkStoreContactField*
|
|
469 |
CPbk2AttributeAddressSelectPhase::CheckIfFieldAlreadySelectedL()
|
|
470 |
{
|
|
471 |
MVPbkStoreContactField* ret = NULL;
|
|
472 |
|
|
473 |
const MVPbkContactLink& contactLink = iContactLinks->At( KFirstElement );
|
|
474 |
MVPbkStoreContactFieldCollection& fields = iStoreContact->Fields();
|
|
475 |
MVPbkStoreContactField* field = fields.RetrieveField( contactLink );
|
|
476 |
if ( field )
|
|
477 |
{
|
|
478 |
ret = field->CloneLC();
|
|
479 |
CleanupStack::Pop(); // field->CloneLC()
|
|
480 |
}
|
|
481 |
|
|
482 |
return ret;
|
|
483 |
}
|
|
484 |
|
|
485 |
// --------------------------------------------------------------------------
|
|
486 |
// CPbk2AttributeAddressSelectPhase::AddressSelectResourceId
|
|
487 |
// --------------------------------------------------------------------------
|
|
488 |
//
|
|
489 |
inline TInt CPbk2AttributeAddressSelectPhase::AddressSelectResourceId
|
|
490 |
( TPbk2AttributeAssignData aAttributeData )
|
|
491 |
{
|
|
492 |
TInt result = KErrNotFound;
|
|
493 |
|
|
494 |
if ( aAttributeData.iAttributeUid ==
|
|
495 |
TUid::Uid( KVPbkSpeedDialAttributeImplementationUID ) )
|
|
496 |
{
|
|
497 |
result = R_PBK2_PHONE_NUMBER_SELECT;
|
|
498 |
}
|
|
499 |
|
|
500 |
return result;
|
|
501 |
}
|
|
502 |
|
|
503 |
// --------------------------------------------------------------------------
|
|
504 |
// CPbk2AttributeAddressSelectPhase::CorrectRSK
|
|
505 |
// --------------------------------------------------------------------------
|
|
506 |
//
|
|
507 |
inline TInt CPbk2AttributeAddressSelectPhase::CorrectRSK
|
|
508 |
( TInt aAddressSelectResourceId )
|
|
509 |
{
|
|
510 |
TInt result = KErrNone;
|
|
511 |
|
|
512 |
if ( iRskBack )
|
|
513 |
{
|
|
514 |
switch ( aAddressSelectResourceId )
|
|
515 |
{
|
|
516 |
case R_PBK2_PHONE_NUMBER_SELECT:
|
|
517 |
{
|
|
518 |
result = R_AVKON_SOFTKEYS_SELECT_BACK__SELECT;
|
|
519 |
break;
|
|
520 |
}
|
|
521 |
|
|
522 |
default:
|
|
523 |
{
|
|
524 |
// Do nothing
|
|
525 |
break;
|
|
526 |
}
|
|
527 |
}
|
|
528 |
}
|
|
529 |
|
|
530 |
return result;
|
|
531 |
}
|
|
532 |
|
|
533 |
// --------------------------------------------------------------------------
|
|
534 |
// CPbk2AttributeAddressSelectPhase::AppendResultL
|
|
535 |
// --------------------------------------------------------------------------
|
|
536 |
//
|
|
537 |
void CPbk2AttributeAddressSelectPhase::AppendResultL
|
|
538 |
( const MVPbkStoreContactField* aField )
|
|
539 |
{
|
|
540 |
if ( aField )
|
|
541 |
{
|
|
542 |
// Add the contact link to the result array
|
|
543 |
MVPbkContactLink* link = aField->CreateLinkLC();
|
|
544 |
if ( link )
|
|
545 |
{
|
|
546 |
if ( !iResults )
|
|
547 |
{
|
|
548 |
iResults = CVPbkContactLinkArray::NewL();
|
|
549 |
}
|
|
550 |
|
|
551 |
CleanupStack::Pop(); // aField->CreateLinkLC()
|
|
552 |
|
|
553 |
iResults->AppendL( link );
|
|
554 |
}
|
|
555 |
}
|
|
556 |
}
|
|
557 |
|
|
558 |
// End of File
|