emailservices/emailstore/base_plugin/src/basepluginmisc.cpp
changeset 20 ecc8def7944a
parent 18 578830873419
child 44 c2d07d913565
equal deleted inserted replaced
18:578830873419 20:ecc8def7944a
    29 #include "baseplugindelayedopsprivate.h"
    29 #include "baseplugindelayedopsprivate.h"
    30 
    30 
    31 /**
    31 /**
    32  * Base plugin has no particular id.
    32  * Base plugin has no particular id.
    33  */
    33  */
    34 EXPORT_C TUint CBasePlugin::GetPluginId()
    34 TUint CBasePlugin::GetPluginId()
    35     {
    35     {
    36     return 0;
    36     return 0;
    37     }
    37     }
    38 
    38 
    39 
    39 
    40 /**
    40 /**
    41  *
    41  *
    42  */
    42  */
    43 EXPORT_C TFSMailBoxStatus CBasePlugin::GetMailBoxStatus(
    43 TFSMailBoxStatus CBasePlugin::GetMailBoxStatus(
    44     const TFSMailMsgId& /*aMailBoxId*/ )
    44     const TFSMailMsgId& /*aMailBoxId*/ )
    45     {
    45     {
    46     return EFSMailBoxOnline;
    46     return EFSMailBoxOnline;
    47     }
    47     }
    48 
    48 
    49 
    49 
    50 /**
    50 /**
    51  *
    51  *
    52  */
    52  */
    53 EXPORT_C TBool CBasePlugin::MailboxHasCapabilityL(
    53 TBool CBasePlugin::MailboxHasCapabilityL(
    54     TFSMailBoxCapabilities /*aCapability*/,
    54     TFSMailBoxCapabilities /*aCapability*/,
    55     TFSMailMsgId /*aMailBoxId*/ )
    55     TFSMailMsgId /*aMailBoxId*/ )
    56     {
    56     {
    57     return EFalse;
    57     return EFalse;
    58     }
    58     }
    59 
    59 
    60 
    60 
    61 /**
    61 /**
    62  *
    62  *
    63  */
    63  */
    64 EXPORT_C TInt CBasePlugin::WizardDataAvailableL()
    64 TInt CBasePlugin::WizardDataAvailableL()
    65     {
    65     {
    66     return KErrNotSupported;
    66     return KErrNotSupported;
    67     }
    67     }
    68 
    68 
    69 
    69 
    70 /**
    70 /**
    71  *
    71  *
    72  */
    72  */
    73 EXPORT_C void CBasePlugin::AuthenticateL(
    73 void CBasePlugin::AuthenticateL(
    74     MFSMailRequestObserver& /*aOperationObserver*/,
    74     MFSMailRequestObserver& /*aOperationObserver*/,
    75     TInt /*aRequestId*/ )
    75     TInt /*aRequestId*/ )
    76     {
    76     {
    77 
    77 
    78     }
    78     }
    79 
    79 
    80 
    80 
    81 /**
    81 /**
    82  */
    82  */
    83 EXPORT_C void CBasePlugin::SetCredentialsL(
    83 void CBasePlugin::SetCredentialsL(
    84     const TFSMailMsgId& /* aMailBoxId */,
    84     const TFSMailMsgId& /* aMailBoxId */,
    85     const TDesC& /* aUsername */,
    85     const TDesC& /* aUsername */,
    86     const TDesC& /* aPassword */ )
    86     const TDesC& /* aPassword */ )
    87     {
    87     {
    88     User::Leave( KErrNotSupported );
    88     User::Leave( KErrNotSupported );
    90 
    90 
    91 
    91 
    92 /**
    92 /**
    93  *
    93  *
    94  */
    94  */
    95 EXPORT_C TDesC& CBasePlugin::GetBrandingIdL( const TFSMailMsgId& aMailboxId )
    95 TDesC& CBasePlugin::GetBrandingIdL( const TFSMailMsgId& aMailboxId )
    96     {
    96     {
    97     CMailboxInfo& mailbox = GetMailboxInfoL( aMailboxId.Id() );
    97     CMailboxInfo& mailbox = GetMailboxInfoL( aMailboxId.Id() );
    98     return *mailbox.iBrandingId;
    98     return *mailbox.iBrandingId;
    99     }
    99     }
   100 
   100 
   101 
   101 
   102 /**
   102 /**
   103  *
   103  *
   104  */
   104  */
   105 EXPORT_C TInt CBasePlugin::CancelSyncL( const TFSMailMsgId& /*aMailBoxId*/ )
   105 TInt CBasePlugin::CancelSyncL( const TFSMailMsgId& /*aMailBoxId*/ )
   106 	{
   106 	{
   107 	return KErrNotSupported;
   107 	return KErrNotSupported;
   108 	}
   108 	}
   109 
   109 
   110 
   110 
   169 
   169 
   170 
   170 
   171 /**
   171 /**
   172  *
   172  *
   173  */
   173  */
   174 EXPORT_C void CBasePlugin::SearchL(
   174 void CBasePlugin::SearchL(
   175     const TFSMailMsgId& aMailBoxId,
   175     const TFSMailMsgId& aMailBoxId,
   176     const RArray<TFSMailMsgId>& aFolderIds,
   176     const RArray<TFSMailMsgId>& aFolderIds,
   177     const RPointerArray<TDesC>& aSearchStrings,
   177     const RPointerArray<TDesC>& aSearchStrings,
   178     const TFSMailSortCriteria& aSortCriteria,
   178     const TFSMailSortCriteria& aSortCriteria,
   179     MFSMailBoxSearchObserver& aSearchObserver )
   179     MFSMailBoxSearchObserver& aSearchObserver )
   218 
   218 
   219 
   219 
   220 /**
   220 /**
   221  *
   221  *
   222  */
   222  */
   223 EXPORT_C void CBasePlugin::CancelSearch(
   223 void CBasePlugin::CancelSearch(
   224     const TFSMailMsgId& aMailBoxId )
   224     const TFSMailMsgId& aMailBoxId )
   225 
   225 
   226     {
   226     {
   227     TRAP_IGNORE( DoCancelSearchL( aMailBoxId ) );
   227     TRAP_IGNORE( DoCancelSearchL( aMailBoxId ) );
   228     }
   228     }
   229 
   229 
   230 
   230 
   231 /**
   231 /**
   232  *
   232  *
   233  */
   233  */
   234 EXPORT_C void CBasePlugin::ClearSearchResultCache(
   234 void CBasePlugin::ClearSearchResultCache(
   235     const TFSMailMsgId& aMailBoxId )
   235     const TFSMailMsgId& aMailBoxId )
   236 
   236 
   237     {
   237     {
   238     TRAP_IGNORE( DoClearSearchResultCacheL( aMailBoxId ) );
   238     TRAP_IGNORE( DoClearSearchResultCacheL( aMailBoxId ) );
   239     }
   239     }
   243 
   243 
   244 
   244 
   245 /**
   245 /**
   246  *
   246  *
   247  */
   247  */
   248 EXPORT_C void CBasePlugin::GoOfflineL(
   248 void CBasePlugin::GoOfflineL(
   249     const TFSMailMsgId& /*aMailBoxId*/ )
   249     const TFSMailMsgId& /*aMailBoxId*/ )
   250     {
   250     {
   251     }
   251     }
   252 
   252 
   253 
   253 
   254 /**
   254 /**
   255  *
   255  *
   256  */
   256  */
   257 EXPORT_C void CBasePlugin::GoOnlineL(
   257 void CBasePlugin::GoOnlineL(
   258     const TFSMailMsgId& /*aMailBoxId*/ )
   258     const TFSMailMsgId& /*aMailBoxId*/ )
   259     {
   259     {
   260     }
   260     }
   261 
   261 
   262 
   262 
   263 /**
   263 /**
   264  *
   264  *
   265  */
   265  */
   266 EXPORT_C void CBasePlugin::RefreshNowL(
   266 void CBasePlugin::RefreshNowL(
   267     const TFSMailMsgId& /*aMailBoxId*/,
   267     const TFSMailMsgId& /*aMailBoxId*/,
   268  	MFSMailRequestObserver& /*aOperationObserver*/,
   268  	MFSMailRequestObserver& /*aOperationObserver*/,
   269  	TInt /*aRequestId*/ )
   269  	TInt /*aRequestId*/ )
   270     {
   270     {
   271 
   271 
   277 
   277 
   278 
   278 
   279 /**
   279 /**
   280  *
   280  *
   281  */
   281  */
   282 EXPORT_C MDesCArray* CBasePlugin::GetMrusL(
   282 MDesCArray* CBasePlugin::GetMrusL(
   283     const TFSMailMsgId& aMailBoxId )
   283     const TFSMailMsgId& aMailBoxId )
   284 
   284 
   285     {
   285     {
   286     CMailboxInfo& mailBox = GetMailboxInfoL( aMailBoxId.Id() );
   286     CMailboxInfo& mailBox = GetMailboxInfoL( aMailBoxId.Id() );
   287 
   287 
   311 
   311 
   312 
   312 
   313 /**
   313 /**
   314  *
   314  *
   315  */
   315  */
   316 EXPORT_C void CBasePlugin::SetMrusL(
   316 void CBasePlugin::SetMrusL(
   317     const TFSMailMsgId& aMailBoxId,
   317     const TFSMailMsgId& aMailBoxId,
   318     MDesCArray* aNewMruList )
   318     MDesCArray* aNewMruList )
   319 
   319 
   320     {
   320     {
   321     CMailboxInfo& mailBox = GetMailboxInfoL( aMailBoxId.Id() );
   321     CMailboxInfo& mailBox = GetMailboxInfoL( aMailBoxId.Id() );
   348 
   348 
   349 
   349 
   350 /**
   350 /**
   351  *
   351  *
   352  */
   352  */
   353 EXPORT_C TFSProgress CBasePlugin::StatusL( TInt /*aRequestId*/ )
   353 TFSProgress CBasePlugin::StatusL( TInt /*aRequestId*/ )
   354     {
   354     {
   355     TFSProgress result = { TFSProgress::EFSStatus_Waiting, 0, 0, 0 };
   355     TFSProgress result = { TFSProgress::EFSStatus_Waiting, 0, 0, 0 };
   356     return result;
   356     return result;
   357     }
   357     }
   358 
   358 
   359 
   359 
   360 /**
   360 /**
   361  * Concrete plugins need to call the base plugin's implementation.
   361  * Concrete plugins need to call the base plugin's implementation.
   362  * @param aRequestId
   362  * @param aRequestId
   363  */
   363  */
   364 EXPORT_C void CBasePlugin::CancelL( TInt aRequestId )
   364 void CBasePlugin::CancelL( TInt aRequestId )
   365     {
   365     {
   366     //find the fetch request and notify the observer.
   366     //find the fetch request and notify the observer.
   367     TInt count = iReqs.Count();
   367     TInt count = iReqs.Count();
   368     for ( TInt i = 0; i < count; i++ )
   368     for ( TInt i = 0; i < count; i++ )
   369     	{
   369     	{
   370     	if ( iReqs[i]->iRequestId == aRequestId )
   370     	if ( iReqs[i]->iRequestId == aRequestId )
   371     		{
   371     		{
   372     		CFetchRequester* request = iReqs[i];
   372     		CFetchRequester* request = iReqs[i];
   373 
   373 //<qmail>
   374     		TFSProgress progress = TFSProgress();
   374     		TFSProgress progress = TFSProgress();
       
   375 //</qmail>
   375     		progress.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
   376     		progress.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
   376     		progress.iCounter = progress.iMaxCount = 1;
   377     		progress.iCounter = progress.iMaxCount = 1;
   377     		progress.iError = KErrNone;
   378     		progress.iError = KErrNone;
   378     		request->iObserver.RequestResponseL( progress, aRequestId );
   379     		request->iObserver.RequestResponseL( progress, aRequestId );
   379 
   380 
   386 
   387 
   387 
   388 
   388 /**
   389 /**
   389  *
   390  *
   390  */
   391  */
   391 EXPORT_C const TFSProgress CBasePlugin::GetLastSyncStatusL(
   392 const TFSProgress CBasePlugin::GetLastSyncStatusL(
   392     const TFSMailMsgId& /*aMailBoxId*/ )
   393     const TFSMailMsgId& /*aMailBoxId*/ )
   393 
   394 
   394     {
   395     {
   395     User::Leave( KErrNotSupported );
   396     User::Leave( KErrNotSupported );
   396 
   397 
   401 
   402 
   402 /**
   403 /**
   403  *
   404  *
   404  */
   405  */
   405 //<qmail>
   406 //<qmail>
   406 EXPORT_C TSSMailSyncState CBasePlugin::CurrentSyncState(
   407 TSSMailSyncState CBasePlugin::CurrentSyncState(
   407     const TFSMailMsgId& /*aMailboxId*/ )
   408             const TFSMailMsgId& /*aMailboxId*/ )
   408     {
   409     {
   409     return Idle;
   410     return Idle;
   410     }
   411     }
   411 //</qmail>
   412 //</qmail>
   412 
   413 
   413 /**
   414 /**
   414  *
   415  *
   415  */
   416  */
   416 EXPORT_C CMsgStoreAccount* CBasePlugin::GetAccountForMsgBoxL(
   417 CMsgStoreAccount* CBasePlugin::GetAccountForMsgBoxL(
   417     const TFSMailMsgId& aMailboxId )
   418     const TFSMailMsgId& aMailboxId )
   418 
   419 
   419     {
   420     {
   420     CMsgStoreAccount* result = NULL;
   421     CMsgStoreAccount* result = NULL;
   421 
   422 
   468     }
   469     }
   469 
   470 
   470 /**
   471 /**
   471  *
   472  *
   472  */
   473  */
   473 EXPORT_C /*virtual*/ void CBasePlugin::SetMailboxName(
   474 /*virtual*/ void CBasePlugin::SetMailboxName(
   474     const TFSMailMsgId& /*aMailboxId*/,
   475     const TFSMailMsgId& /*aMailboxId*/,
   475     const TDesC& /*aMailboxName*/ )
   476     const TDesC& /*aMailboxName*/ )
   476     {
   477     {
   477     }
   478     }
   478 
   479 
   479 /**
   480 /**
   480  *
   481  *
   481  */
   482  */
   482 /*protected*/ EXPORT_C void CBasePlugin::ResetCache()
   483 /*protected*/ void CBasePlugin::ResetCache()
   483     {
   484     {
   484     __LOG_ENTER_SUPPRESS( "ResetCache" );
   485     __LOG_ENTER_SUPPRESS( "ResetCache" );
   485 
   486 
   486     ResetBodyCache();
   487     ResetBodyCache();
   487 
   488 
   495     }
   496     }
   496 
   497 
   497 /**
   498 /**
   498  *
   499  *
   499  */
   500  */
   500 /*protected*/ EXPORT_C void CBasePlugin::ResetBodyCache()
   501 /*protected*/ void CBasePlugin::ResetBodyCache()
   501     {
   502     {
   502     __LOG_ENTER_SUPPRESS( "ResetCache" );
   503     __LOG_ENTER_SUPPRESS( "ResetCache" );
   503     iCacheLine.iBodyChildren.ResetAndDestroy();
   504     iCacheLine.iBodyChildren.ResetAndDestroy();
   504     iCacheLine.iBodyChildren.Close();
   505     iCacheLine.iBodyChildren.Close();
   505 
   506 
   510     }
   511     }
   511 
   512 
   512 /**
   513 /**
   513  *
   514  *
   514  */
   515  */
   515 /*protected*/ EXPORT_C CMsgStoreMessage* CBasePlugin::GetCachedMsgL(
   516 /*protected*/ CMsgStoreMessage* CBasePlugin::GetCachedMsgL(
   516     TMsgStoreId aMailBoxId,
   517     TMsgStoreId aMailBoxId,
   517     TMsgStoreId aMsgId )
   518     TMsgStoreId aMsgId )
   518     {
   519     {
   519     __LOG_ENTER_SUPPRESS( "GetCachedMsgL" );
   520     __LOG_ENTER_SUPPRESS( "GetCachedMsgL" );
   520     CMsgStoreMessage* result = NULL;
   521     CMsgStoreMessage* result = NULL;
   545 
   546 
   546 /**
   547 /**
   547  *
   548  *
   548  */
   549  */
   549 /*protected*/
   550 /*protected*/
   550 EXPORT_C CMsgStoreMessagePart* CBasePlugin::GetCachedBodyL(
   551 CMsgStoreMessagePart* CBasePlugin::GetCachedBodyL(
   551     TMsgStoreId aPartId )
   552     TMsgStoreId aPartId )
   552     {
   553     {
   553     __LOG_ENTER_SUPPRESS( "GetCachedBodyL" );
   554     __LOG_ENTER_SUPPRESS( "GetCachedBodyL" );
   554     __ASSERT_DEBUG( NULL != iCacheLine.iMsg,
   555     __ASSERT_DEBUG( NULL != iCacheLine.iMsg,
   555         BasePluginPanic( EInvalidMsgStoreCacheState ) );
   556         BasePluginPanic( EInvalidMsgStoreCacheState ) );
   573 
   574 
   574 /**
   575 /**
   575  *
   576  *
   576  */
   577  */
   577 /*protected*/
   578 /*protected*/
   578 EXPORT_C RPointerArray<CMsgStoreMessagePart>& CBasePlugin::GetCachedMsgChildrenL()
   579 RPointerArray<CMsgStoreMessagePart>& CBasePlugin::GetCachedMsgChildrenL()
   579     {
   580     {
   580     __LOG_ENTER_SUPPRESS( "GetCachedMsgChildrenL" );
   581     __LOG_ENTER_SUPPRESS( "GetCachedMsgChildrenL" );
   581 
   582 
   582     __ASSERT_DEBUG( NULL != iCacheLine.iMsg,
   583     __ASSERT_DEBUG( NULL != iCacheLine.iMsg,
   583         BasePluginPanic( EInvalidMsgStoreCacheState ) );
   584         BasePluginPanic( EInvalidMsgStoreCacheState ) );
   597 
   598 
   598 /**
   599 /**
   599  *
   600  *
   600  */
   601  */
   601 /*protected*/
   602 /*protected*/
   602 EXPORT_C RPointerArray<CMsgStoreMessagePart>& CBasePlugin::GetCachedBodyChildrenL()
   603 RPointerArray<CMsgStoreMessagePart>& CBasePlugin::GetCachedBodyChildrenL()
   603     {
   604     {
   604     __LOG_ENTER_SUPPRESS( "GetCachedBodyChildrenL" );
   605     __LOG_ENTER_SUPPRESS( "GetCachedBodyChildrenL" );
   605 
   606 
   606     __ASSERT_DEBUG( NULL != iCacheLine.iBody,
   607     __ASSERT_DEBUG( NULL != iCacheLine.iBody,
   607         BasePluginPanic( EInvalidMsgStoreCacheState ) );
   608         BasePluginPanic( EInvalidMsgStoreCacheState ) );
   620     }
   621     }
   621 
   622 
   622 /**
   623 /**
   623  *
   624  *
   624  */
   625  */
   625 /*protected*/ EXPORT_C void CBasePlugin::InvalidateCacheIfNecessary(
   626 /*protected*/ void CBasePlugin::InvalidateCacheIfNecessary(
   626     TMsgStoreId aId,
   627     TMsgStoreId aId,
   627     TMsgStoreId aParentId,
   628     TMsgStoreId aParentId,
   628     TMsgStoreId aOtherId )
   629     TMsgStoreId aOtherId )
   629     {
   630     {
   630     if ( iCacheLine.iMsg )
   631     if ( iCacheLine.iMsg )
   639 
   640 
   640 
   641 
   641 /**
   642 /**
   642  *
   643  *
   643  */
   644  */
   644 /*public*/ EXPORT_C MDelayedOpsManager& CBasePlugin::GetDelayedOpsManager()
   645 /*public*/ MDelayedOpsManager& CBasePlugin::GetDelayedOpsManager()
   645     {
   646     {
   646     return *iDelayedOpsManager;
   647     return *iDelayedOpsManager;
   647     }
   648     }
       
   649 
       
   650 /*protected*/ const TDesC& CBasePlugin::CalendarFileName() const
       
   651     {
       
   652     return KNullDesC();
       
   653     }