emailservices/emailstore/base_plugin/src/BasePlugin.cpp
branchRCL_3
changeset 25 3533d4323edc
parent 24 d189ee25cf9d
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 //MsgStore.
    19 //MsgStore.
    20 //<cmail>
    20 //<cmail>
    21 #include "MsgStore.h"
    21 #include "msgstore.h"
    22 #include "MsgStoreAccount.h"
    22 #include "msgstoreaccount.h"
    23 #include "MsgStoreMailBox.h"
    23 #include "msgstoremailbox.h"
    24 #include "MsgStoreMessage.h"
    24 #include "msgstoremessage.h"
    25 #include "MsgStoreFolder.h"
    25 #include "msgstorefolder.h"
    26 #include "MsgStorePropertyContainer.h"
    26 #include "msgstorepropertycontainer.h"
    27 #include "MsgStorePropertyKeys.h"
    27 #include "msgstorepropertykeys.h"
    28 #include "MsgStoreSortCriteria.h"
    28 #include "msgstoresortcriteria.h"
    29 #include "MsgStoreSortResultIterator.h"
    29 #include "msgstoresortresultiterator.h"
    30 //Freestyle.
    30 //Freestyle.
    31 #include "CFSMailCommon.h"
    31 #include "cfsmailcommon.h"
    32 #include "CFSMailMessage.h"
    32 #include "cfsmailmessage.h"
    33 #include "cmrcalendarinfo.h" 
    33 #include "cmrcalendarinfo.h" 
    34 //</cmail>
    34 //</cmail>
    35 //Base plugin.
    35 //Base plugin.
    36 #include "BasePlugin.h"
    36 #include "baseplugin.h"
    37 #include "BasePluginPanic.h"
    37 #include "basepluginpanic.h"
    38 #include "baseplugincommonutils.h"
    38 #include "baseplugincommonutils.h"
    39 #include "MailIterator.h"
    39 #include "mailiterator.h"
    40 #include "baseplugindelayedopsprivate.h"
    40 #include "baseplugindelayedopsprivate.h"
    41 
       
    42 //<qmail>
       
    43 #include "CFSMailFolder.h"
       
    44 #include "baseplugindef.h"
       
    45 //</qmail>
       
    46 
       
    47 // Other
    41 // Other
    48 #include <e32base.h>
    42 #include <e32base.h>
    49 #include <utf.h>
    43 #include <utf.h>
    50 #include <calsession.h>
    44 #include <calsession.h>
    51 
    45 
    52 //<qmail>
       
    53 //<cmail>
    46 //<cmail>
    54 //#include "freestyleemailuiconstants.h" // removed from 10.1
    47 #include "FreestyleEmailUiConstants.h"
    55 //</cmail>
    48 //</cmail>
    56 //</qmail>
    49 
    57 //size of the read buffer when reading body content from the quoted
    50 //size of the read buffer when reading body content from the quoted
    58 //message when replying/forwarding.
    51 //message when replying/forwarding.
    59 const TInt KQuotedReadBufferSize = 1024*64;
    52 const TInt KQuotedReadBufferSize = 1024*64;
    60 
    53 
    61 
    54 
    82 
    75 
    83 
    76 
    84 /**
    77 /**
    85  *
    78  *
    86  */
    79  */
    87  void CBasePlugin::ConstructL()
    80 EXPORT_C void CBasePlugin::ConstructL()
    88     {
    81     {
    89     __LOG_CONSTRUCT( "baseplugin", "CBasePlugin" )
    82     __LOG_CONSTRUCT( "baseplugin", "CBasePlugin" )
    90 
    83 
    91     __LOG_ENTER( "ConstructL" )
    84     __LOG_ENTER( "ConstructL" )
    92     iMsgStore = CMsgStore::NewL( EFalse );
    85     iMsgStore = CMsgStore::NewL( EFalse );
    98 
    91 
    99 
    92 
   100 /**
    93 /**
   101  *
    94  *
   102  */
    95  */
   103  CBasePlugin::CBasePlugin()
    96 EXPORT_C CBasePlugin::CBasePlugin()
   104 : iMailboxes( RMap<TInt, CMailboxInfo>::CompareInt )
    97 : iMailboxes( RMap<TInt, CMailboxInfo>::CompareInt )
   105    {
    98    {
   106    }
    99    }
   107 
   100 
   108 
   101 
   109 /**
   102 /**
   110  *
   103  *
   111  */
   104  */
   112 CBasePlugin::~CBasePlugin()
   105 EXPORT_C CBasePlugin::~CBasePlugin()
   113     {
   106     {
   114     //needs to be first thing to do as it might force execution of operations
   107     //needs to be first thing to do as it might force execution of operations
   115     //that depend on the plugin's current state.
   108     //that depend on the plugin's current state.
   116     delete iDelayedOpsManager;
   109     delete iDelayedOpsManager;
   117     
   110     
   118     iMailboxes.ResetAndDestroy();
   111     iMailboxes.ResetAndDestroy();
   119     iMailboxes.Close();
   112     iMailboxes.Close();
   120 
   113 
   121 //<qmail>
   114     if ( iObservers.Count() > 0 )
   122     if ( iObservers.Count() > 0 && iMsgStore )
       
   123 //</qmail>
       
   124         {
   115         {
   125         TRAP_IGNORE( iMsgStore->RemoveObserverL( this ) );
   116         TRAP_IGNORE( iMsgStore->RemoveObserverL( this ) );
   126         }
   117         }
   127     iObservers.Close();
   118     iObservers.Close();
   128 
   119 
   129     delete iMsgStore;
   120     delete iMsgStore;
   130 
   121 
   131     iReqs.ResetAndDestroy();
   122     iReqs.ResetAndDestroy();
   132     iReqs.Close();
   123     iReqs.Close();
   133 //<qmail>
   124     
   134     // Note that all the ops in iDelayedOpReqs array (if any) have already been
       
   135     // deleted in the destructor of CDelayedOpsManager class.
       
   136     iDelayedOpReqs.Reset();
       
   137     iDelayedOpReqs.Close();
       
   138 //</qmail>
       
   139     ResetCache();
   125     ResetCache();
   140 
   126 
   141     __LOG_DESTRUCT
   127     __LOG_DESTRUCT
   142     }
   128     }
   143     
   129     
   147 
   133 
   148 /**
   134 /**
   149  * Note that as the msgstore performs the delete immediately the observer will get
   135  * Note that as the msgstore performs the delete immediately the observer will get
   150  * called from within this method.
   136  * called from within this method.
   151  */
   137  */
   152  void CBasePlugin::DeleteMailBoxByUidL(
   138 EXPORT_C void CBasePlugin::DeleteMailBoxByUidL(
   153     const TFSMailMsgId& aMailBoxId,
   139     const TFSMailMsgId& aMailBoxId,
   154     MFSMailRequestObserver& aOperationObserver,
   140     MFSMailRequestObserver& aOperationObserver,
   155 	const TInt aRequestId )
   141 	const TInt aRequestId )
   156     {
   142     {
   157     __LOG_ENTER( "DeleteMailBoxByUidL" )
   143     __LOG_ENTER( "DeleteMailBoxByUidL" )
   200 
   186 
   201 
   187 
   202 /**
   188 /**
   203  *
   189  *
   204  */
   190  */
   205  void CBasePlugin::ListMailBoxesL( RArray<TFSMailMsgId>& aMailboxes )
   191 EXPORT_C void CBasePlugin::ListMailBoxesL( RArray<TFSMailMsgId>& aMailboxes )
   206     {
   192     {
   207     __LOG_ENTER( "ListMailBoxesL" )
   193     __LOG_ENTER( "ListMailBoxesL" )
   208     
   194     
   209     RPointerArray< CMsgStoreAccount > accounts;
   195     RPointerArray< CMsgStoreAccount > accounts;
   210     iMsgStore->AccountsL( accounts );
   196     iMsgStore->AccountsL( accounts );
   242 
   228 
   243 /**
   229 /**
   244  *
   230  *
   245  * @param aMailBoxId if not found leaves with KErrNotFound.
   231  * @param aMailBoxId if not found leaves with KErrNotFound.
   246  */
   232  */
   247  CFSMailBox* CBasePlugin::GetMailBoxByUidL( const TFSMailMsgId& aMailBox )
   233 EXPORT_C CFSMailBox* CBasePlugin::GetMailBoxByUidL( const TFSMailMsgId& aMailBox )
   248     {
   234     {
   249     __LOG_ENTER( "GetMailBoxByUidL" )
   235     __LOG_ENTER( "GetMailBoxByUidL" )
   250 
   236 
   251     CMailboxInfo& mailBox = GetMailboxInfoL( aMailBox.Id() );
   237     CMailboxInfo& mailBox = GetMailboxInfoL( aMailBox.Id() );
   252     
   238     
   316 
   302 
   317 /**
   303 /**
   318  *
   304  *
   319  * @param aMailBoxId if not found leaves with KErrNotFound.
   305  * @param aMailBoxId if not found leaves with KErrNotFound.
   320  */
   306  */
   321  TFSMailMsgId CBasePlugin::GetStandardFolderIdL(
   307 EXPORT_C TFSMailMsgId CBasePlugin::GetStandardFolderIdL(
   322     const TFSMailMsgId& aMailBoxId,
   308     const TFSMailMsgId& aMailBoxId,
   323     const TFSFolderType aFolderType )
   309     const TFSFolderType aFolderType )
   324     
   310     
   325     {
   311     {
   326     __LOG_ENTER( "GetStandardFolderIdL" )
   312     __LOG_ENTER( "GetStandardFolderIdL" )
   344  * Note that the unseen count is not set by the plugin as this information is not
   330  * Note that the unseen count is not set by the plugin as this information is not
   345  * readily available.
   331  * readily available.
   346  *
   332  *
   347  * @param aMailBoxId if not found leaves with KErrNotFound.
   333  * @param aMailBoxId if not found leaves with KErrNotFound.
   348  */
   334  */
   349  CFSMailFolder* CBasePlugin::GetFolderByUidL(
   335 EXPORT_C CFSMailFolder* CBasePlugin::GetFolderByUidL(
   350     const TFSMailMsgId& aMailBoxId,
   336     const TFSMailMsgId& aMailBoxId,
   351     const TFSMailMsgId& aFolderId )
   337     const TFSMailMsgId& aFolderId )
   352 
   338 
   353     {
   339     {
   354     __LOG_ENTER( "GetFolderByUidL" )
   340     __LOG_ENTER( "GetFolderByUidL" )
   415 /**
   401 /**
   416  * @param aFolderId parent folder id.
   402  * @param aFolderId parent folder id.
   417  * @param aMailBoxId if not found leaves with KErrNotFound.
   403  * @param aMailBoxId if not found leaves with KErrNotFound.
   418  * @return if the folder already exists returns the existing one.
   404  * @return if the folder already exists returns the existing one.
   419  */
   405  */
   420  CFSMailFolder* CBasePlugin::CreateFolderL(
   406 EXPORT_C CFSMailFolder* CBasePlugin::CreateFolderL(
   421     const TFSMailMsgId& aMailBoxId,
   407     const TFSMailMsgId& aMailBoxId,
   422     const TFSMailMsgId& aParentFolderId,
   408     const TFSMailMsgId& aParentFolderId,
   423     const TDesC& aFolderName,
   409     const TDesC& aFolderName,
   424     const TBool aSync )
   410     const TBool aSync )
   425 
   411 
   461 
   447 
   462 /**
   448 /**
   463  *
   449  *
   464  * @param aMailBoxId if not found leaves with KErrNotFound.
   450  * @param aMailBoxId if not found leaves with KErrNotFound.
   465  */
   451  */
   466  void CBasePlugin::DeleteFolderByUidL(
   452 EXPORT_C void CBasePlugin::DeleteFolderByUidL(
   467     const TFSMailMsgId& aMailBoxId,
   453     const TFSMailMsgId& aMailBoxId,
   468     const TFSMailMsgId& aFolder )
   454     const TFSMailMsgId& aFolder )
   469     
   455     
   470     {
   456     {
   471     __LOG_ENTER( "DeleteFolderByUidL" )
   457     __LOG_ENTER( "DeleteFolderByUidL" )
   477     }
   463     }
   478 
   464 
   479 /**
   465 /**
   480  *
   466  *
   481  */
   467  */
   482  void CBasePlugin::ListFoldersL(
   468 EXPORT_C void CBasePlugin::ListFoldersL(
   483     const TFSMailMsgId& aMailBoxId,
   469     const TFSMailMsgId& aMailBoxId,
   484     const TFSMailMsgId& aFolderId,
   470     const TFSMailMsgId& aFolderId,
   485     RPointerArray<CFSMailFolder>& aFolderList )
   471     RPointerArray<CFSMailFolder>& aFolderList )
   486     
   472     
   487     {
   473     {
   502     }
   488     }
   503 
   489 
   504 /**
   490 /**
   505  *
   491  *
   506  */
   492  */
   507  void CBasePlugin::ListFoldersL(
   493 EXPORT_C void CBasePlugin::ListFoldersL(
   508     const TFSMailMsgId& aMailBoxId,
   494     const TFSMailMsgId& aMailBoxId,
   509     RPointerArray<CFSMailFolder>& aFolderList )
   495     RPointerArray<CFSMailFolder>& aFolderList )
   510     
   496     
   511     {
   497     {
   512     __LOG_ENTER( "ListFoldersL" )
   498     __LOG_ENTER( "ListFoldersL" )
   520 
   506 
   521 /**
   507 /**
   522  *
   508  *
   523  * @param aMailBoxId if not found leaves with KErrNotFound.
   509  * @param aMailBoxId if not found leaves with KErrNotFound.
   524  */
   510  */
   525  MFSMailIterator* CBasePlugin::ListMessagesL(
   511 EXPORT_C MFSMailIterator* CBasePlugin::ListMessagesL(
   526     const TFSMailMsgId& aMailBoxId,
   512     const TFSMailMsgId& aMailBoxId,
   527     const TFSMailMsgId& aFolderId,
   513     const TFSMailMsgId& aFolderId,
   528     const TFSMailDetails aDetails,
   514     const TFSMailDetails aDetails,
   529     const RArray<TFSMailSortCriteria>& aSorting )
   515     const RArray<TFSMailSortCriteria>& aSorting )
   530    
   516    
   599 
   585 
   600 /**
   586 /**
   601  *
   587  *
   602  * @param aMailBoxId if not found leaves with KErrNotFound.
   588  * @param aMailBoxId if not found leaves with KErrNotFound.
   603  */
   589  */
   604  CFSMailMessage* CBasePlugin::GetMessageByUidL(
   590 EXPORT_C CFSMailMessage* CBasePlugin::GetMessageByUidL(
   605     const TFSMailMsgId& aMailBoxId,
   591     const TFSMailMsgId& aMailBoxId,
   606     const TFSMailMsgId& /*aFolderId*/,
   592     const TFSMailMsgId& /*aFolderId*/,
   607     const TFSMailMsgId& aMessageId,
   593     const TFSMailMsgId& aMessageId,
   608     const TFSMailDetails aDetails )
   594     const TFSMailDetails aDetails )
   609     
   595     
   624 
   610 
   625 /**
   611 /**
   626  *
   612  *
   627  * @param aMailBoxId if not found leaves with KErrNotFound.
   613  * @param aMailBoxId if not found leaves with KErrNotFound.
   628  */
   614  */
   629  void CBasePlugin::DeleteMessagesByUidL(
   615 EXPORT_C void CBasePlugin::DeleteMessagesByUidL(
   630     const TFSMailMsgId& aMailBoxId,
   616     const TFSMailMsgId& aMailBoxId,
   631     const TFSMailMsgId& aFolderId,
   617     const TFSMailMsgId& aFolderId,
   632     const RArray<TFSMailMsgId>& aMessages )
   618     const RArray<TFSMailMsgId>& aMessages )
   633     
   619     
   634     {
   620     {
   646 /**
   632 /**
   647  * Drafts folder assumed.
   633  * Drafts folder assumed.
   648  *
   634  *
   649  * @param aMailBoxId if not found leaves with KErrNotFound.
   635  * @param aMailBoxId if not found leaves with KErrNotFound.
   650  */
   636  */
   651  CFSMailMessage* CBasePlugin::CreateMessageToSendL(
   637 EXPORT_C CFSMailMessage* CBasePlugin::CreateMessageToSendL(
   652     const TFSMailMsgId& aMailBox )
   638     const TFSMailMsgId& aMailBox )
   653     
   639     
   654     {
   640     {
   655     __LOG_ENTER( "CreateMessageToSendL" )
   641     __LOG_ENTER( "CreateMessageToSendL" )
   656     
   642     
   750 	CleanupStack::PopAndDestroy( textPlain );
   736 	CleanupStack::PopAndDestroy( textPlain );
   751     if ( signature )
   737     if ( signature )
   752         {
   738         {
   753         CleanupStack::PopAndDestroy( signature );
   739         CleanupStack::PopAndDestroy( signature );
   754         }
   740         }
   755     
       
   756 //<qmail> 
       
   757     //create the text/html part.
       
   758     props = CMsgStorePropertyContainer::NewL();
       
   759     CleanupStack::PushL( props );
       
   760     
       
   761 	props->AddPropertyL(
       
   762         KMsgStorePropertyContentType, KFSMailContentTypeTextHtml );
       
   763 	
       
   764     props->AddPropertyL( KMsgStorePropertyCharset, KMessageBodyCharset );
       
   765 
       
   766     props->AddPropertyL(
       
   767         KMsgStorePropertyContentDisposition, KMessageBodyDisposition );
       
   768     
       
   769     CMsgStoreMessagePart* htmlPlain = bodyPart->AddChildPartL( *props );
       
   770     CleanupStack::PopAndDestroy( props );         
       
   771     CleanupStack::PushL( htmlPlain );
       
   772     htmlPlain->AppendToContentL(KNullDesC8);
       
   773     CleanupStack::PopAndDestroy( htmlPlain );
       
   774 //</qmail>
       
   775     
       
   776     //delete body part
       
   777     CleanupStack::PopAndDestroy( bodyPart );
   741     CleanupStack::PopAndDestroy( bodyPart );
   778 	
   742 	
   779 	//done.
   743 	//done.
   780     message->CommitL();
   744     message->CommitL();
   781     
   745     
   791     
   755     
   792     __LOG_EXIT
   756     __LOG_EXIT
   793     return result;
   757     return result;
   794     }
   758     }
   795 
   759 
   796  // <qmail>
   760 
   797  /**
   761 /**
   798   *
   762  *
   799   */
   763  */
   800  void CBasePlugin::CreateMessageToSendL(
   764 EXPORT_C CFSMailMessage* CBasePlugin::CreateForwardMessageL(
   801     const TFSMailMsgId& aMailBoxId,
       
   802     MFSMailRequestObserver& aOperationObserver,
       
   803     const TInt aRequestId)
       
   804     {
       
   805      CDelayedMessageToSendOp* delayedOp = CDelayedMessageToSendOp::NewLC(
       
   806     *this,aMailBoxId,aOperationObserver,aRequestId);
       
   807     iDelayedOpsManager->EnqueueOpL( delayedOp );
       
   808     iDelayedOpReqs.AppendL(delayedOp);
       
   809     CleanupStack::Pop( delayedOp );      
       
   810     }
       
   811  // </qmail> 
       
   812 /**
       
   813  *
       
   814  */
       
   815  CFSMailMessage* CBasePlugin::CreateForwardMessageL(
       
   816     const TFSMailMsgId& aMailBox,
   765     const TFSMailMsgId& aMailBox,
   817     const TFSMailMsgId& aOriginal,
   766     const TFSMailMsgId& aOriginal,
   818     const TDesC& aHeaderDescriptor )
   767     const TDesC& aHeaderDescriptor )
   819     {
   768     {
   820     return CreateForwardReplyMessageL( aMailBox, aOriginal, EFalse, aHeaderDescriptor, ETrue );
   769     return CreateForwardReplyMessageL( aMailBox, aOriginal, EFalse, aHeaderDescriptor, ETrue );
   822 
   771 
   823 
   772 
   824 /**
   773 /**
   825  * Relying on the UI for the subject and recipients.
   774  * Relying on the UI for the subject and recipients.
   826  */
   775  */
   827  CFSMailMessage* CBasePlugin::CreateReplyMessageL(
   776 EXPORT_C CFSMailMessage* CBasePlugin::CreateReplyMessageL(
   828     const TFSMailMsgId& aMailBoxId,
   777     const TFSMailMsgId& aMailBoxId,
   829     const TFSMailMsgId& aOriginalMessageId,
   778     const TFSMailMsgId& aOriginalMessageId,
   830     const TBool aReplyToAll,
   779     const TBool aReplyToAll,
   831     const TDesC& aHeaderDescriptor )
   780     const TDesC& aHeaderDescriptor )
   832     {
   781     {
   835 
   784 
   836 
   785 
   837 /**
   786 /**
   838  *
   787  *
   839  */
   788  */
   840  CFSMailMessage* CBasePlugin::CreateMrReplyMessageL(
   789 EXPORT_C CFSMailMessage* CBasePlugin::CreateMrReplyMessageL(
   841     const TFSMailMsgId& aMailBoxId,
   790     const TFSMailMsgId& aMailBoxId,
   842     MMRInfoObject& /*aMeetingRequest*/,
   791     MMRInfoObject& /*aMeetingRequest*/,
   843     const TFSMailMsgId& aOriginalMessageId )
   792     const TFSMailMsgId& aOriginalMessageId )
   844     {
   793     {
   845     return CreateReplyMessageL( aMailBoxId, aOriginalMessageId, EFalse, KNullDesC );
   794     return CreateReplyMessageL( aMailBoxId, aOriginalMessageId, EFalse, KNullDesC );
   848 
   797 
   849 /**
   798 /**
   850  *
   799  *
   851  * @param aMailBoxId if not found leaves with KErrNotFound.
   800  * @param aMailBoxId if not found leaves with KErrNotFound.
   852  */
   801  */
   853  void CBasePlugin::StoreMessageL(
   802 EXPORT_C void CBasePlugin::StoreMessageL(
   854     const TFSMailMsgId& aMailBoxId,
   803     const TFSMailMsgId& aMailBoxId,
   855     CFSMailMessage& aMessage )
   804     CFSMailMessage& aMessage )
   856     
   805     
   857     {
   806     {
   858     __LOG_ENTER( "StoreMessageL" )
   807     __LOG_ENTER( "StoreMessageL" )
   890     
   839     
   891     ResetCache();
   840     ResetCache();
   892     __LOG_EXIT
   841     __LOG_EXIT
   893     }
   842     }
   894 
   843 
   895 // <qmail>
       
   896 /**
       
   897  *
       
   898  * @param aMailBoxId Mailbox id.
       
   899  * @param aOperationObserver Operation observer.
       
   900  * @param aRequestId The request id.
       
   901  */
       
   902  void CBasePlugin::StoreMessagesL(
       
   903     const TFSMailMsgId& aMailBox,
       
   904     RPointerArray<CFSMailMessage> &messages,
       
   905     MFSMailRequestObserver& aOperationObserver,
       
   906     const TInt aRequestId )
       
   907     
       
   908     {
       
   909     __LOG_ENTER( "StoreMessagesL" )
       
   910     
       
   911     CDelayedMessageStorerOp* delayedOp = CDelayedMessageStorerOp::NewLC(
       
   912     aMailBox,messages,aOperationObserver,aRequestId);
       
   913     iDelayedOpsManager->EnqueueOpL( delayedOp );
       
   914     CleanupStack::Pop( delayedOp );
       
   915    
       
   916      
       
   917     __LOG_EXIT
       
   918     }
       
   919 // </qmail>
       
   920 
       
   921 
       
   922 // <qmail>
       
   923 /**
       
   924  * Asynchronous message part storing
       
   925  *
       
   926  * @param aMessagePart email parts data to be stored
       
   927  * @param aOperationObserver Observer for the operation 
       
   928  * @param aRequestId id of the operation
       
   929  */
       
   930  void CBasePlugin::StoreMessagePartsL(
       
   931     RPointerArray<CFSMailMessagePart>& aMessageParts,
       
   932     MFSMailRequestObserver& aOperationObserver,
       
   933     const TInt aRequestId)
       
   934 {
       
   935     __LOG_ENTER( "StoreMessagePartsL" )
       
   936             
       
   937     CDelayedMessageStorerOp* delayedOp = CDelayedMessageStorerOp::NewLC(
       
   938     aMessageParts,aOperationObserver,aRequestId);
       
   939     iDelayedOpsManager->EnqueueOpL( delayedOp );
       
   940     CleanupStack::Pop( delayedOp );
       
   941     
       
   942     __LOG_EXIT
       
   943 }
       
   944 // <//qmail>
       
   945 
   844 
   946 /**
   845 /**
   947  * Async operation, starts fetching.
   846  * Async operation, starts fetching.
   948  * @param aRequestId
   847  * @param aRequestId
   949  */
   848  */
   950  void CBasePlugin::FetchMessagesL(
   849 EXPORT_C void CBasePlugin::FetchMessagesL(
   951     const TFSMailMsgId& /*aMailBox*/,
   850     const TFSMailMsgId& /*aMailBox*/,
   952     const TFSMailMsgId& /*aFolder*/,
   851     const TFSMailMsgId& /*aFolder*/,
   953     const RArray<TFSMailMsgId>& /*aMessageIds*/,
   852     const RArray<TFSMailMsgId>& /*aMessageIds*/,
   954     TFSMailDetails /*aDetails*/,
   853     TFSMailDetails /*aDetails*/,
   955     MFSMailRequestObserver& /*aObserver*/,
   854     MFSMailRequestObserver& /*aObserver*/,
   961 
   860 
   962 
   861 
   963 /**
   862 /**
   964  *
   863  *
   965  */
   864  */
   966  void CBasePlugin::GetMessagesL(
   865 EXPORT_C void CBasePlugin::GetMessagesL(
   967     const TFSMailMsgId& /*aMailBoxId*/,
   866     const TFSMailMsgId& /*aMailBoxId*/,
   968     const TFSMailMsgId& /*aParentFolderId*/,
   867     const TFSMailMsgId& /*aParentFolderId*/,
   969     const RArray<TFSMailMsgId>& /*aMessageIds*/,
   868     const RArray<TFSMailMsgId>& /*aMessageIds*/,
   970     RPointerArray<CFSMailMessage>& /*aMessageList*/,
   869     RPointerArray<CFSMailMessage>& /*aMessageList*/,
   971     const TFSMailDetails /*aDetails*/ )
   870     const TFSMailDetails /*aDetails*/ )
   976 
   875 
   977 
   876 
   978 /**
   877 /**
   979  * CFSMailPlugin::SendMessageL
   878  * CFSMailPlugin::SendMessageL
   980  */
   879  */
   981  void CBasePlugin::SendMessageL( CFSMailMessage& aMessage )    
   880 EXPORT_C void CBasePlugin::SendMessageL( CFSMailMessage& aMessage )    
   982     {
   881     {
   983     __LOG_ENTER( "SendMessageL1" )
   882     __LOG_ENTER( "SendMessageL1" )
   984 
   883 
   985     TMsgStoreId mailBoxId = aMessage.GetMailBoxId().Id();
   884     TMsgStoreId mailBoxId = aMessage.GetMailBoxId().Id();
   986     TMsgStoreId msgId = aMessage.GetMessageId().Id();
   885     TMsgStoreId msgId = aMessage.GetMessageId().Id();
  1006  * Plugin could use this method to "send" a message if the CFSMailPlugin's is
   905  * Plugin could use this method to "send" a message if the CFSMailPlugin's is
  1007  * not necessary. The method also stores the message properties before doing so.
   906  * not necessary. The method also stores the message properties before doing so.
  1008  * This allows for optimizing away of unnecessary writes to the msgstore.
   907  * This allows for optimizing away of unnecessary writes to the msgstore.
  1009  * @param aSentTime the sent time you want set for the message.
   908  * @param aSentTime the sent time you want set for the message.
  1010  */
   909  */
  1011  void CBasePlugin::SendMessageL(
   910 EXPORT_C void CBasePlugin::SendMessageL(
  1012     CMsgStoreMailBox& aMailBox,
   911     CMsgStoreMailBox& aMailBox,
  1013     CMsgStoreMessage& aMsg,
   912     CMsgStoreMessage& aMsg,
  1014     const TTime& aSentTime )    
   913     const TTime& aSentTime )    
  1015     {
   914     {
  1016     __LOG_ENTER( "SendMessageL2" )
   915     __LOG_ENTER( "SendMessageL2" )
  1038     }
   937     }
  1039 
   938 
  1040 /**
   939 /**
  1041  *
   940  *
  1042  */
   941  */
  1043  void CBasePlugin::MoveMessagesL(
   942 EXPORT_C void CBasePlugin::MoveMessagesL(
  1044     const TFSMailMsgId& aMailBoxId,
   943     const TFSMailMsgId& aMailBoxId,
  1045     const RArray<TFSMailMsgId>& aMessageIds,
   944     const RArray<TFSMailMsgId>& aMessageIds,
  1046     const TFSMailMsgId& aSourceFolderId,
   945     const TFSMailMsgId& aSourceFolderId,
  1047     const TFSMailMsgId& aDestinationFolderId )
   946     const TFSMailMsgId& aDestinationFolderId )
  1048 
   947 
  1061 
   960 
  1062 
   961 
  1063 /**
   962 /**
  1064  *
   963  *
  1065  */
   964  */
  1066  void CBasePlugin::CopyMessagesL(
   965 EXPORT_C void CBasePlugin::CopyMessagesL(
  1067     const TFSMailMsgId& aMailBoxId,
   966     const TFSMailMsgId& aMailBoxId,
  1068     const RArray<TFSMailMsgId>& aMessageIds,
   967     const RArray<TFSMailMsgId>& aMessageIds,
  1069     RArray<TFSMailMsgId>& aNewMessages,
   968     RArray<TFSMailMsgId>& aNewMessages,
  1070     const TFSMailMsgId& aSourceFolderId,
   969     const TFSMailMsgId& aSourceFolderId,
  1071     const TFSMailMsgId& aDestinationFolderId )
   970     const TFSMailMsgId& aDestinationFolderId )
  1095 /**
   994 /**
  1096  * Get the MsgStore mailbox instance for the specified FSEF mailbox id.
   995  * Get the MsgStore mailbox instance for the specified FSEF mailbox id.
  1097  *
   996  *
  1098  * @param aId mailbox id, if none can be found leaves with KErrNotFound.
   997  * @param aId mailbox id, if none can be found leaves with KErrNotFound.
  1099  */
   998  */
  1100  CMailboxInfo& CBasePlugin::GetMailboxInfoL(
   999 EXPORT_C CMailboxInfo& CBasePlugin::GetMailboxInfoL(
  1101     TMsgStoreId aId )
  1000     TMsgStoreId aId )
  1102     {
  1001     {
  1103     
  1002     
  1104     __ASSERT_DEBUG( NULL != iMsgStore, ::BasePluginPanic( ENoMsgStoreSessionAssert ) );
  1003     __ASSERT_DEBUG( NULL != iMsgStore, ::BasePluginPanic( ENoMsgStoreSessionAssert ) );
  1105     
  1004     
  1255 
  1154 
  1256 /**
  1155 /**
  1257  * This methoed must be called before destruction of 
  1156  * This methoed must be called before destruction of 
  1258  * CBasePlugin derived class. To fix bug EIZU-7XVF2Z.
  1157  * CBasePlugin derived class. To fix bug EIZU-7XVF2Z.
  1259  */
  1158  */
  1260 void CBasePlugin::DeleteDelayedOpsManager()
  1159 EXPORT_C void CBasePlugin::DeleteDelayedOpsManager()
  1261     {
  1160     {
  1262     delete iDelayedOpsManager;
  1161     delete iDelayedOpsManager;
  1263     iDelayedOpsManager = NULL;
  1162     iDelayedOpsManager = NULL;
  1264     }
  1163     }
  1265 
  1164 
  1295 
  1194 
  1296 
  1195 
  1297 /**
  1196 /**
  1298  *
  1197  *
  1299  */
  1198  */
  1300  CMsgStoreMessagePart* CBasePlugin::GetBodyPartL(
  1199 EXPORT_C CMsgStoreMessagePart* CBasePlugin::GetBodyPartL(
  1301     CMsgStoreMessage& aMessage,
  1200     CMsgStoreMessage& aMessage,
  1302     const TDesC& aContentType )
  1201     const TDesC& aContentType )
  1303     {
  1202     {
  1304     CMsgStoreMessagePart* result = NULL;
  1203     CMsgStoreMessagePart* result = NULL;
  1305     
  1204     
  1355     } //GetBodyPartL.
  1254     } //GetBodyPartL.
  1356 
  1255 
  1357 /**
  1256 /**
  1358  *
  1257  *
  1359  */
  1258  */
  1360  CFSMailMessage* CBasePlugin::CreateForwardReplyMessageL(
  1259 EXPORT_C CFSMailMessage* CBasePlugin::CreateForwardReplyMessageL(
  1361     const TFSMailMsgId& aMailBox,
  1260     const TFSMailMsgId& aMailBox,
  1362     const TFSMailMsgId& aOriginal,
  1261     const TFSMailMsgId& aOriginal,
  1363     const TBool aReplyToAll,
  1262     const TBool aReplyToAll,
  1364     const TDesC& aHeaderDescriptor,
  1263     const TDesC& aHeaderDescriptor,
  1365     TBool aKeepAttachments,
  1264     TBool aKeepAttachments,
  1669 
  1568 
  1670 /**
  1569 /**
  1671  * RefreshMailboxCacheL - This will refresh the mailbox instance cache maintained within the base plugin.  
  1570  * RefreshMailboxCacheL - This will refresh the mailbox instance cache maintained within the base plugin.  
  1672  *
  1571  *
  1673  */
  1572  */
  1674  CMailboxInfo& CBasePlugin::RefreshMailboxCacheL( TMsgStoreId aMailBoxId )
  1573 EXPORT_C CMailboxInfo& CBasePlugin::RefreshMailboxCacheL( TMsgStoreId aMailBoxId )
  1675     {
  1574     {
  1676     //save the observers
  1575     //save the observers
  1677     CMailboxInfo& oldMailBox = GetMailboxInfoL( aMailBoxId );
  1576     CMailboxInfo& oldMailBox = GetMailboxInfoL( aMailBoxId );
  1678     
  1577     
  1679     RPointerArray<MFSMailEventObserver> observers;
  1578     RPointerArray<MFSMailEventObserver> observers;