|
1 /* |
|
2 * Copyright (c) 2007-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: Implementation of comm launcher view plugin |
|
15 * |
|
16 */ |
|
17 #include "ccappcommlauncherplugin.h" |
|
18 #include "ccappcommlaunchersetdefault.h" |
|
19 |
|
20 #include <MVPbkContactLinkArray.h> |
|
21 #include <MVPbkContactStoreProperties.h> |
|
22 #include <MVPbkContactStore.h> |
|
23 #include <MVPbkStoreContact.h> |
|
24 #include <MVPbkContactOperationBase.h> |
|
25 |
|
26 #include <CVPbkContactManager.h> |
|
27 #include <CPbk2ApplicationServices.h> |
|
28 #include <CVPbkDefaultAttribute.h> |
|
29 #include <CVPbkFieldTypeSelector.h> |
|
30 #include <VPbkContactStoreUris.h> |
|
31 |
|
32 #include <Pbk2DataCaging.hrh> |
|
33 #include <featmgr.h> |
|
34 |
|
35 const TInt KGranularity = 4; |
|
36 _LIT(KPbk2CommandsDllResFileName, "Pbk2Commands.rsc"); |
|
37 _LIT(KPbk2UiControlsDllResFileName, "Pbk2UiControls.rsc"); |
|
38 _LIT(KPbk2CommonUiDllResFileName, "Pbk2CommonUi.rsc" ); |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // CCCAppCommLauncherLSetDefault::CCCAppCommLauncherLSetDefault |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 CCCAppCommLauncherLSetDefault::CCCAppCommLauncherLSetDefault( |
|
45 CCCAppCommLauncherPlugin& aPlugin ) |
|
46 : |
|
47 iPlugin(aPlugin), |
|
48 iCommandsResourceFile( *CCoeEnv::Static() ), |
|
49 iUiControlsResourceFile( *CCoeEnv::Static() ), |
|
50 iCommonUiResourceFile( *CCoeEnv::Static() ) |
|
51 { |
|
52 |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // CCCAppCommLauncherLSetDefault::~CCCAppCommLauncherLSetDefault |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 CCCAppCommLauncherLSetDefault::~CCCAppCommLauncherLSetDefault() |
|
60 { |
|
61 delete iDefaultActions; |
|
62 delete iWaitFinish; |
|
63 |
|
64 delete iRetrieveOperation; |
|
65 delete iSetAttributeOperation; |
|
66 delete iLinks; |
|
67 delete iStoreContact; |
|
68 |
|
69 // Close contact store |
|
70 if( iContactStore ) |
|
71 { |
|
72 iContactStore->Close( *this ); |
|
73 } |
|
74 |
|
75 if(iCmsWrapper) |
|
76 { |
|
77 iCmsWrapper->Release(); |
|
78 } |
|
79 delete iContactLinkArrayDes; |
|
80 |
|
81 Release( iAppServices ); |
|
82 iCommandsResourceFile.Close(); |
|
83 iUiControlsResourceFile.Close(); |
|
84 iCommonUiResourceFile.Close(); |
|
85 } |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // CCCAppCommLauncherLSetDefault::NewL |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 CCCAppCommLauncherLSetDefault* CCCAppCommLauncherLSetDefault::NewL( |
|
92 CCCAppCommLauncherPlugin& aPlugin ) |
|
93 { |
|
94 CCCAppCommLauncherLSetDefault* self = |
|
95 new( ELeave ) CCCAppCommLauncherLSetDefault( aPlugin ); |
|
96 CleanupStack::PushL( self ); |
|
97 self->ConstructL(); |
|
98 CleanupStack::Pop( self ); |
|
99 |
|
100 return self; |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // CCCAppCommLauncherLSetDefault::ConstructL |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 void CCCAppCommLauncherLSetDefault::ConstructL() |
|
108 { |
|
109 //iPbkCmd = CCCAppCommLauncherPbkCmd::NewL( iPlugin ); |
|
110 iWaitFinish = new (ELeave) CActiveSchedulerWait(); |
|
111 |
|
112 iCommandsResourceFile.OpenL( |
|
113 KPbk2RomFileDrive, KDC_RESOURCE_FILES_DIR, KPbk2CommandsDllResFileName ); |
|
114 iUiControlsResourceFile.OpenL( |
|
115 KPbk2RomFileDrive, KDC_RESOURCE_FILES_DIR, KPbk2UiControlsDllResFileName ); |
|
116 iCommonUiResourceFile.OpenL( |
|
117 KPbk2RomFileDrive, KDC_RESOURCE_FILES_DIR, KPbk2CommonUiDllResFileName ); |
|
118 iAppServices = CPbk2ApplicationServices::InstanceL(); |
|
119 |
|
120 iCmsWrapper = CCCAppCmsContactFetcherWrapper::InstanceL(); |
|
121 |
|
122 iContactLinkArrayDes = iCmsWrapper->ContactIdentifierLC(); |
|
123 CleanupStack::Pop(iContactLinkArrayDes); |
|
124 |
|
125 iDefaultActions = |
|
126 new( ELeave ) CArrayFixFlat<VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector>( KGranularity ); |
|
127 |
|
128 } |
|
129 |
|
130 // --------------------------------------------------------------------------- |
|
131 // CCCAppCommLauncherLSetDefault::VPbkSingleContactOperationComplete |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 void CCCAppCommLauncherLSetDefault::VPbkSingleContactOperationComplete( |
|
135 MVPbkContactOperationBase& /*aOperation*/, |
|
136 MVPbkStoreContact* aContact) |
|
137 { |
|
138 delete iRetrieveOperation; |
|
139 iRetrieveOperation = NULL; |
|
140 |
|
141 delete iStoreContact; |
|
142 iStoreContact = aContact; |
|
143 |
|
144 TInt index; |
|
145 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector callSelector = VPbkFieldTypeSelectorFactory::EVoiceCallSelector; |
|
146 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector messageSelector = VPbkFieldTypeSelectorFactory::EUniEditorSelector; |
|
147 |
|
148 if ( !IsPhoneMemoryContact( *iStoreContact ) || |
|
149 (!IsContactActionHasField( callSelector, index ) && |
|
150 !IsContactActionHasField( messageSelector, index )) || |
|
151 (FindContactFieldWithAttributeL( MapSelectorIdToDefaultType(callSelector ) ) && |
|
152 FindContactFieldWithAttributeL( MapSelectorIdToDefaultType( messageSelector ) )) || |
|
153 (!iStoreContact) ) |
|
154 |
|
155 { |
|
156 ProcessFinished(KErrNone); |
|
157 } |
|
158 |
|
159 |
|
160 else // ( iStoreContact ) |
|
161 { |
|
162 TInt err = KErrNone; |
|
163 TRAP( err, LockContactL() ); |
|
164 if ( err != KErrNone ) |
|
165 { |
|
166 ProcessFinished( err ); |
|
167 } |
|
168 } |
|
169 } |
|
170 |
|
171 // --------------------------------------------------------------------------- |
|
172 // CCCAppCommLauncherLSetDefault::VPbkSingleContactOperationFailed |
|
173 // --------------------------------------------------------------------------- |
|
174 // |
|
175 void CCCAppCommLauncherLSetDefault::VPbkSingleContactOperationFailed( |
|
176 MVPbkContactOperationBase& /*aOperation*/, |
|
177 TInt /*aError*/) |
|
178 { |
|
179 ProcessFinished(KErrNone); |
|
180 } |
|
181 |
|
182 // -------------------------------------------------------------------------- |
|
183 // CCCAppCommLauncherLSetDefault::AttributeProcessCompleted |
|
184 // -------------------------------------------------------------------------- |
|
185 // |
|
186 void CCCAppCommLauncherLSetDefault::AttributeOperationComplete( MVPbkContactOperationBase& aOperation ) |
|
187 { |
|
188 TInt err = KErrNone; |
|
189 |
|
190 if ( &aOperation == iSetAttributeOperation ) |
|
191 { |
|
192 // Move to next attribute |
|
193 TRAP( err, SetNextL() ); |
|
194 } |
|
195 |
|
196 // Handle error |
|
197 if ( err != KErrNone ) |
|
198 { |
|
199 ProcessFinished( err ); // Complete the setting |
|
200 } |
|
201 } |
|
202 |
|
203 // -------------------------------------------------------------------------- |
|
204 // CCCAppCommLauncherLSetDefault::AttributeProcessFailed |
|
205 // -------------------------------------------------------------------------- |
|
206 // |
|
207 void CCCAppCommLauncherLSetDefault::AttributeOperationFailed( |
|
208 MVPbkContactOperationBase& aOperation, |
|
209 TInt aError ) |
|
210 { |
|
211 ProcessFinished( aError ); |
|
212 } |
|
213 |
|
214 // --------------------------------------------------------------------------- |
|
215 // CCCAppCommLauncherLSetDefault::StoreReady |
|
216 // --------------------------------------------------------------------------- |
|
217 // |
|
218 void CCCAppCommLauncherLSetDefault::StoreReady( |
|
219 MVPbkContactStore& aContactStore ) |
|
220 { |
|
221 iContactStore = &aContactStore; |
|
222 |
|
223 // operation completes by VPbkSingleContactOperationComplete |
|
224 // or VPbkSingleContactOperationFailed |
|
225 if( iRetrieveOperation ) |
|
226 { |
|
227 delete iRetrieveOperation; |
|
228 iRetrieveOperation = NULL; |
|
229 } |
|
230 |
|
231 TRAPD( err,iRetrieveOperation = iAppServices->ContactManager().RetrieveContactL( iLinks->At( 0 ), *this ); ) |
|
232 |
|
233 if( err != KErrNone ) |
|
234 { |
|
235 HandleError( err ); |
|
236 } |
|
237 } |
|
238 |
|
239 // --------------------------------------------------------------------------- |
|
240 // CCCAppCommLauncherLSetDefault::StoreUnavailable |
|
241 // --------------------------------------------------------------------------- |
|
242 // |
|
243 void CCCAppCommLauncherLSetDefault::StoreUnavailable( |
|
244 MVPbkContactStore& /*aContactStore*/, |
|
245 TInt /*aReason*/) |
|
246 { |
|
247 ProcessFinished(KErrNone); |
|
248 } |
|
249 |
|
250 // --------------------------------------------------------------------------- |
|
251 // CCCAppCommLauncherLSetDefault::HandleStoreEventL |
|
252 // --------------------------------------------------------------------------- |
|
253 // |
|
254 void CCCAppCommLauncherLSetDefault::HandleStoreEventL( |
|
255 MVPbkContactStore& /*aContactStore*/, |
|
256 TVPbkContactStoreEvent aStoreEvent) |
|
257 { |
|
258 switch ( aStoreEvent.iEventType ) |
|
259 { |
|
260 case TVPbkContactStoreEvent::EContactChanged: |
|
261 { |
|
262 // do nothing for now |
|
263 } |
|
264 break; |
|
265 default: |
|
266 break; |
|
267 } |
|
268 } |
|
269 |
|
270 // -------------------------------------------------------------------------- |
|
271 // CCCAppCommLauncherLSetDefault::ContactOperationCompleted |
|
272 // -------------------------------------------------------------------------- |
|
273 // |
|
274 void CCCAppCommLauncherLSetDefault::ContactOperationCompleted |
|
275 (TContactOpResult aResult) |
|
276 { |
|
277 if (aResult.iOpCode == EContactLock) |
|
278 { |
|
279 TRAPD( err, SetNextL() ); |
|
280 if ( err != KErrNone ) |
|
281 { |
|
282 ProcessFinished( err ); |
|
283 } |
|
284 } |
|
285 else if (aResult.iOpCode == EContactCommit) |
|
286 { |
|
287 ProcessFinished( KErrNone ); |
|
288 } |
|
289 } |
|
290 |
|
291 // -------------------------------------------------------------------------- |
|
292 // CCCAppCommLauncherLSetDefault::ContactOperationFailed |
|
293 // -------------------------------------------------------------------------- |
|
294 // |
|
295 void CCCAppCommLauncherLSetDefault::ContactOperationFailed |
|
296 ( TContactOp /*aOpCode*/, TInt aErrorCode, |
|
297 TBool /*aErrorNotified*/ ) |
|
298 { |
|
299 ProcessFinished( aErrorCode ); |
|
300 } |
|
301 |
|
302 // ---------------------------------------------------------- |
|
303 // CCCAppCommLauncherLSetDefault::WaitFinish |
|
304 // ---------------------------------------------------------- |
|
305 // |
|
306 void CCCAppCommLauncherLSetDefault::WaitFinish() |
|
307 { |
|
308 if ( iWaitFinish && !iWaitFinish->IsStarted() ) |
|
309 { |
|
310 iWaitFinish->Start(); |
|
311 } |
|
312 } |
|
313 |
|
314 // ---------------------------------------------------------- |
|
315 // CCCAppCommLauncherLSetDefault::StopWait |
|
316 // ---------------------------------------------------------- |
|
317 // |
|
318 void CCCAppCommLauncherLSetDefault::StopWait() |
|
319 { |
|
320 if ( iWaitFinish && iWaitFinish->IsStarted() ) |
|
321 { |
|
322 iWaitFinish->AsyncStop(); |
|
323 } |
|
324 } |
|
325 |
|
326 // ---------------------------------------------------------- |
|
327 // CCCAppCommLauncherLSetDefault::ExecuteAssignDefaultL |
|
328 // ---------------------------------------------------------- |
|
329 // |
|
330 void CCCAppCommLauncherLSetDefault::ExecuteAssignDefaultL() |
|
331 { |
|
332 iDefaultActions->Reset(); |
|
333 iDefaultActions->AppendL( VPbkFieldTypeSelectorFactory::EVoiceCallSelector ); |
|
334 iDefaultActions->AppendL( VPbkFieldTypeSelectorFactory::EUniEditorSelector ); |
|
335 |
|
336 if( iLinks ) |
|
337 { |
|
338 delete iLinks; |
|
339 iLinks = NULL; |
|
340 } |
|
341 |
|
342 iLinks = iAppServices->ContactManager().CreateLinksLC( *iContactLinkArrayDes ); |
|
343 |
|
344 if ( iLinks && iLinks->Count() > 0 ) |
|
345 { |
|
346 // operation completes by StoreReady, |
|
347 // StoreUnavailable or HandleStoreEventL |
|
348 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
349 } |
|
350 |
|
351 CleanupStack::Pop( 1 ); // iLinks |
|
352 } |
|
353 |
|
354 // ---------------------------------------------------------- |
|
355 // CCCAppCommLauncherLSetDefault::LockContactL |
|
356 // ---------------------------------------------------------- |
|
357 // |
|
358 void CCCAppCommLauncherLSetDefault::LockContactL() |
|
359 { |
|
360 // We must lock the contact for changes |
|
361 iStoreContact->LockL(*this); |
|
362 } |
|
363 |
|
364 // -------------------------------------------------------------------------- |
|
365 // CCCAppCommLauncherLSetDefault::FindContactFieldWithAttributeL |
|
366 // -------------------------------------------------------------------------- |
|
367 // |
|
368 TBool |
|
369 CCCAppCommLauncherLSetDefault::FindContactFieldWithAttributeL |
|
370 ( TVPbkDefaultType aDefaultType ) |
|
371 { |
|
372 TBool result = EFalse; |
|
373 |
|
374 // Loop through contact's fields and find the specified field |
|
375 const TInt fieldCount = iStoreContact->Fields().FieldCount(); |
|
376 CVPbkDefaultAttribute* attr = |
|
377 CVPbkDefaultAttribute::NewL( aDefaultType ); |
|
378 CleanupStack::PushL( attr ); |
|
379 |
|
380 for ( TInt i=0; i < fieldCount; ++i ) |
|
381 { |
|
382 MVPbkStoreContactField& candidate = |
|
383 iStoreContact->Fields().FieldAt( i ); |
|
384 |
|
385 // Check if field has default attribute defaultType |
|
386 if ( iAppServices->ContactManager().ContactAttributeManagerL().HasFieldAttributeL |
|
387 ( *attr, candidate ) ) |
|
388 { |
|
389 result = ETrue; |
|
390 break; |
|
391 } |
|
392 } |
|
393 CleanupStack::PopAndDestroy( attr ); |
|
394 return result; |
|
395 } |
|
396 |
|
397 // -------------------------------------------------------------------------- |
|
398 // CCCAppCommLauncherLSetDefault::DoSetDefaultL |
|
399 // -------------------------------------------------------------------------- |
|
400 // |
|
401 void CCCAppCommLauncherLSetDefault::DoSetDefaultL( TVPbkDefaultType aDefaultType, TInt aIndex ) |
|
402 { |
|
403 // Set given attribute to given field |
|
404 CVPbkDefaultAttribute* attr = |
|
405 CVPbkDefaultAttribute::NewL( aDefaultType ); |
|
406 CleanupStack::PushL( attr ); |
|
407 |
|
408 delete iSetAttributeOperation; |
|
409 iSetAttributeOperation = NULL; |
|
410 iSetAttributeOperation = |
|
411 iAppServices->ContactManager().ContactAttributeManagerL().SetFieldAttributeL |
|
412 ( iStoreContact->Fields().FieldAt( aIndex ), *attr, *this ); |
|
413 |
|
414 CleanupStack::PopAndDestroy( attr ); |
|
415 } |
|
416 |
|
417 // -------------------------------------------------------------------------- |
|
418 // CCCAppCommLauncherLSetDefault::SetNextL |
|
419 // -------------------------------------------------------------------------- |
|
420 // |
|
421 void CCCAppCommLauncherLSetDefault::SetNextL() |
|
422 { |
|
423 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector selector = NextAttribute(); |
|
424 |
|
425 if ( selector != VPbkFieldTypeSelectorFactory::EEmptySelector) |
|
426 { |
|
427 TInt index; |
|
428 TVPbkDefaultType defaultType = MapSelectorIdToDefaultType(selector); |
|
429 if ( IsContactActionHasField( selector, index ) && |
|
430 !FindContactFieldWithAttributeL( defaultType ) ) |
|
431 { |
|
432 DoSetDefaultL( defaultType, index ); |
|
433 } |
|
434 else |
|
435 { |
|
436 SetNextL(); |
|
437 } |
|
438 } |
|
439 else |
|
440 { |
|
441 // setting complete |
|
442 DefaultSettingCompleteL(); |
|
443 } |
|
444 } |
|
445 |
|
446 // -------------------------------------------------------------------------- |
|
447 // CCCAppCommLauncherLSetDefault::IsContactActionHasField |
|
448 // -------------------------------------------------------------------------- |
|
449 // |
|
450 TBool CCCAppCommLauncherLSetDefault::IsContactActionHasField( |
|
451 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aContactAction, TInt& aIndex) |
|
452 { |
|
453 CVPbkFieldTypeSelector* selector = VPbkFieldTypeSelectorFactory |
|
454 ::BuildContactActionTypeSelectorL( |
|
455 aContactAction, iAppServices->ContactManager().FieldTypes()); |
|
456 |
|
457 const MVPbkStoreContactFieldCollection& fields = iStoreContact->Fields(); |
|
458 TBool result = EFalse; |
|
459 TInt count = fields.FieldCount(); |
|
460 |
|
461 for (TInt i = 0; i < count; ++i) |
|
462 { |
|
463 const MVPbkStoreContactField& field = fields.FieldAt(i); |
|
464 if (selector->IsFieldIncluded(field)) |
|
465 { |
|
466 result = ETrue; |
|
467 aIndex = i; |
|
468 break; |
|
469 } |
|
470 } |
|
471 delete selector; |
|
472 return result; |
|
473 } |
|
474 |
|
475 // --------------------------------------------------------------------------- |
|
476 // CCCAppCommLauncherLSetDefault::MapSelectorIdToDefaultType |
|
477 // --------------------------------------------------------------------------- |
|
478 // |
|
479 TVPbkDefaultType CCCAppCommLauncherLSetDefault::MapSelectorIdToDefaultType( |
|
480 const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID ) |
|
481 { |
|
482 TVPbkDefaultType defaultType = EVPbkDefaultTypeUndefined; |
|
483 switch ( aSelectorID ) |
|
484 { |
|
485 case VPbkFieldTypeSelectorFactory::EVoiceCallSelector: |
|
486 { |
|
487 defaultType = EVPbkDefaultTypePhoneNumber; |
|
488 break; |
|
489 } |
|
490 case VPbkFieldTypeSelectorFactory::EUniEditorSelector: |
|
491 { |
|
492 if (FeatureManager::FeatureSupported(KFeatureIdMMS)) |
|
493 { |
|
494 defaultType = EVPbkDefaultTypeMms; |
|
495 } |
|
496 else if (FeatureManager::FeatureSupported(KFeatureIdEmailOverSms)) |
|
497 { |
|
498 defaultType = EVPbkDefaultTypeEmailOverSms; |
|
499 } |
|
500 else |
|
501 { |
|
502 defaultType = EVPbkDefaultTypeSms; |
|
503 } |
|
504 break; |
|
505 } |
|
506 default: |
|
507 break; |
|
508 } |
|
509 return defaultType; |
|
510 } |
|
511 |
|
512 // --------------------------------------------------------------------------- |
|
513 // CCCAppCommLauncherLSetDefault::NextAttribute |
|
514 // --------------------------------------------------------------------------- |
|
515 // |
|
516 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector |
|
517 CCCAppCommLauncherLSetDefault::NextAttribute() |
|
518 { |
|
519 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector selector = VPbkFieldTypeSelectorFactory::EEmptySelector; |
|
520 |
|
521 TInt count = 0; |
|
522 if ( iDefaultActions ) |
|
523 { |
|
524 count = iDefaultActions->Count(); |
|
525 } |
|
526 |
|
527 if ( count > 0 ) |
|
528 { |
|
529 selector = iDefaultActions->At( count - 1 ); // zero-based |
|
530 iDefaultActions->Delete( count -1 ); // zero-based |
|
531 } |
|
532 return selector; |
|
533 } |
|
534 |
|
535 // --------------------------------------------------------------------------- |
|
536 // CCCAppCommLauncherLSetDefault::DefaultSettingCompleteL |
|
537 // --------------------------------------------------------------------------- |
|
538 // |
|
539 void CCCAppCommLauncherLSetDefault::DefaultSettingCompleteL() |
|
540 { |
|
541 // commit the contact |
|
542 iStoreContact->CommitL( *this ); |
|
543 } |
|
544 |
|
545 // -------------------------------------------------------------------------- |
|
546 // CCCAppCommLauncherLSetDefault::ProcessFinished |
|
547 // -------------------------------------------------------------------------- |
|
548 // |
|
549 void CCCAppCommLauncherLSetDefault::ProcessFinished( TInt aError ) |
|
550 { |
|
551 if ( aError == KErrNone) |
|
552 { |
|
553 |
|
554 } |
|
555 |
|
556 /*if ( aError != KErrNone ) |
|
557 { |
|
558 CCoeEnv::Static()->HandleError( aError ); |
|
559 }*/ |
|
560 |
|
561 iPlugin.DefaultSettingComplete(); |
|
562 } |
|
563 |
|
564 // --------------------------------------------------------------------------- |
|
565 // CCCAppCommLauncherLSetDefault::HandleError |
|
566 // --------------------------------------------------------------------------- |
|
567 // |
|
568 void CCCAppCommLauncherLSetDefault::HandleError( TInt aError ) |
|
569 { |
|
570 CCoeEnv::Static()->HandleError( aError ); |
|
571 } |
|
572 |
|
573 // -------------------------------------------------------------------------- |
|
574 // CCCAppCommLauncherLSetDefault::IsPhoneMemoryContact |
|
575 // -------------------------------------------------------------------------- |
|
576 // |
|
577 TBool CCCAppCommLauncherLSetDefault::IsPhoneMemoryContact( |
|
578 const MVPbkStoreContact& aContact) const |
|
579 { |
|
580 TBool ret = EFalse; |
|
581 |
|
582 TVPbkContactStoreUriPtr uri = |
|
583 aContact.ParentStore().StoreProperties().Uri(); |
|
584 |
|
585 TVPbkContactStoreUriPtr phoneMemoryUri |
|
586 ( VPbkContactStoreUris::DefaultCntDbUri() ); |
|
587 |
|
588 if (uri.Compare( phoneMemoryUri, |
|
589 TVPbkContactStoreUriPtr::EContactStoreUriStoreType ) == 0) |
|
590 { |
|
591 ret = ETrue; |
|
592 } |
|
593 |
|
594 return ret; |
|
595 } |