equal
deleted
inserted
replaced
37 |
37 |
38 #include <MVPbkContactFieldTextData.h> |
38 #include <MVPbkContactFieldTextData.h> |
39 #include <MVPbkContactFieldUriData.h> |
39 #include <MVPbkContactFieldUriData.h> |
40 #include <MVPbkContactFieldData.h> |
40 #include <MVPbkContactFieldData.h> |
41 #include <e32base.h> |
41 #include <e32base.h> |
42 |
|
43 // For finding mailbox accounts |
|
44 #include <emailinterfacefactory.h> |
|
45 #include <memailmailbox.h> |
|
46 |
|
47 |
42 |
48 namespace { |
43 namespace { |
49 |
44 |
50 TBool IsFieldTypeVoipCapable( TInt aFieldTypeResId, TInt aVoipFlag ) |
45 TBool IsFieldTypeVoipCapable( TInt aFieldTypeResId, TInt aVoipFlag ) |
51 { |
46 { |
270 // |
265 // |
271 // ---------------------------------------------------------- |
266 // ---------------------------------------------------------- |
272 // |
267 // |
273 void CCmsServerSession::StoreOpenComplete() |
268 void CCmsServerSession::StoreOpenComplete() |
274 { |
269 { |
275 if ( !iServiceMessage.IsNull() ) |
270 if ( iServiceMessage ) |
276 { |
271 { |
277 // Some request waits when stores are opened. Handle it now. |
272 // Some request waits when stores are opened. Handle it now. |
278 DoServiceL( iServiceMessage ); |
273 DoServiceL( *iServiceMessage ); |
|
274 iServiceMessage = NULL; |
279 } |
275 } |
280 } |
276 } |
281 |
277 |
282 // ---------------------------------------------------------- |
278 // ---------------------------------------------------------- |
283 // CCmsServerSession::CmsSingleContactOperationComplete |
279 // CCmsServerSession::CmsSingleContactOperationComplete |
313 // |
309 // |
314 void CCmsServerSession::ServiceL( const RMessage2& aMessage ) |
310 void CCmsServerSession::ServiceL( const RMessage2& aMessage ) |
315 { |
311 { |
316 PRINT( _L( "Start CCmsServerSession::ServiceL()" ) ); |
312 PRINT( _L( "Start CCmsServerSession::ServiceL()" ) ); |
317 |
313 |
318 if ( !iServiceMessage.IsNull() && !iCmsServer->PhonebookProxyHandle().StoreOpenStatus() ) |
314 if ( iServiceMessage && !iCmsServer->PhonebookProxyHandle().StoreOpenStatus() ) |
319 { |
315 { |
320 // some message already waits for store opening completion |
316 // some message already waits for store opening completion |
321 aMessage.Complete( KErrNotReady ); |
317 aMessage.Complete( KErrNotReady ); |
322 return; |
318 return; |
323 } |
319 } |
324 |
320 |
325 if( !iCmsServer->PhonebookProxyHandle().StoreOpenStatus() ) |
321 if( !iCmsServer->PhonebookProxyHandle().StoreOpenStatus() ) |
326 { |
322 { |
327 // Stores are not ready yet, save message for later processing |
323 // Stores are not ready yet, save message for later processing |
328 iServiceMessage = aMessage; |
324 iServiceMessage = &aMessage; |
329 return; |
325 return; |
330 } |
326 } |
331 |
327 |
332 DoServiceL( aMessage ); |
328 DoServiceL( aMessage ); |
333 |
329 |
483 case VPbkFieldTypeSelectorFactory::EVOIPCallSelector: |
479 case VPbkFieldTypeSelectorFactory::EVOIPCallSelector: |
484 { |
480 { |
485 availability = iServerContact->ParseVoIPAvailabilityL(); |
481 availability = iServerContact->ParseVoIPAvailabilityL(); |
486 break; |
482 break; |
487 } |
483 } |
488 case VPbkFieldTypeSelectorFactory::EEmailEditorSelector: |
|
489 { |
|
490 using namespace EmailInterface; |
|
491 |
|
492 CEmailInterfaceFactory* factory = CEmailInterfaceFactory::NewL(); |
|
493 CleanupStack::PushL( factory ); |
|
494 MEmailInterface* ifPtr = factory->InterfaceL( KEmailClientApiInterface ); |
|
495 MEmailClientApi* clientApi = static_cast<MEmailClientApi*>( ifPtr ); |
|
496 CleanupReleasePushL( *clientApi ); |
|
497 |
|
498 RMailboxPtrArray mailboxes; |
|
499 TRAPD( error, clientApi->GetMailboxesL( mailboxes );); |
|
500 TInt count = mailboxes.Count(); |
|
501 |
|
502 // Release mailboxs before releasing clientapi |
|
503 for ( TInt i=0; i<count; i++ ) |
|
504 { |
|
505 MEmailMailbox* mailbox = mailboxes[i]; |
|
506 mailbox->Release(); |
|
507 } |
|
508 |
|
509 mailboxes.Close(); |
|
510 |
|
511 CleanupStack::PopAndDestroy( 2 ); // clientApi and factory |
|
512 |
|
513 if( count == 0 ) |
|
514 { |
|
515 availability = EFalse; |
|
516 } |
|
517 |
|
518 break; |
|
519 } |
|
520 default: |
484 default: |
521 { |
485 { |
522 //In case the type is unknown, just break here and return true |
486 //In case the type is unknown, just break here and return true |
523 break; |
487 break; |
524 } |
488 } |