emailservices/emailstore/base_plugin/inc/BasePlugin.h
branchRCL_3
changeset 24 d189ee25cf9d
parent 16 b5fbb9b25d57
child 25 3533d4323edc
equal deleted inserted replaced
23:dcf0eedfc1a3 24:d189ee25cf9d
    20 #define __BASEPLUGIN_H__
    20 #define __BASEPLUGIN_H__
    21 
    21 
    22 #include <e32std.h>
    22 #include <e32std.h>
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 
    24 
    25 #include "cfsmailplugin.h"
    25 #include "CFSMailPlugin.h"
    26 #include "mmrorganizer.h"
    26 #include "mmrorganizer.h"
    27 
    27 
    28 //<cmail>
    28 //<cmail>
    29 #include "msgstorefolderutils.h"
    29 #include "MsgStoreFolderUtils.h"
    30 #include "msgstoremailbox.h"
    30 #include "MsgStoreMailBox.h"
    31 #include "msgstoremailboxobserver.h"
    31 #include "MsgStoreMailBoxObserver.h"
    32 #include "msgstoremessage.h"
    32 #include "MsgStoreMessage.h"
    33 #include "msgstoreobserver.h"
    33 #include "MsgStoreObserver.h"
    34 #include "debuglogmacros.h"
    34 #include "DebugLogMacros.h"
    35 //</cmail>
    35 //</cmail>
    36 
    36 
    37 #include "basemrinfoobject.h"
    37 //<qmail> Entire CBasePlugin class is exported in 10.1
    38 #include "map.h"
    38 #include "baseplugindef.h"
       
    39 //</qmail>
       
    40 
       
    41 #include "BaseMrInfoObject.h"
       
    42 #include "Map.h"
    39 
    43 
    40 
    44 
    41 class CMsgStore;
    45 class CMsgStore;
    42 
    46 
    43 class CBaseMrInfoProcessor;
    47 class CBaseMrInfoProcessor;
    44 class TDayOfWeekFtor;
    48 class TDayOfWeekFtor;
    45 class CFetchRequester;
    49 class CFetchRequester;
    46 class CMailboxInfo;
    50 class CMailboxInfo;
    47 class CSearchHandler;
    51 class CSearchHandler;
    48 class HMailIterator;
    52 class HMailIterator;
       
    53 class CDelayedOp;
    49 class CDelayedOpsManager;
    54 class CDelayedOpsManager;
    50 class MDelayedOpsManager;
    55 class MDelayedOpsManager;
    51 
    56 
       
    57 //<qmail>
       
    58 /**
       
    59 * reply/forward message creation parameters
       
    60 */
       
    61 struct TReplyForwardParams
       
    62     {
       
    63     HBufC* iHeader; // reply/forward header, ownership stays in UI
       
    64     HBufC* iSmartTag; // smart reply/forward tag, ownership stays in UI
       
    65     };
       
    66 //</qmail>
    52 
    67 
    53 /**
    68 /**
    54  * Notes for derived classes:
    69  * Notes for derived classes:
    55  * GetPluginId - you must override this to return the ECOM id of the plugin.
    70  * GetPluginId - you must override this to return the ECOM id of the plugin.
    56  */
    71  */
    57 class CBasePlugin :
    72 class BASEPLUGIN_EXPORT CBasePlugin :
    58     public CFSMailPlugin,
    73     public CFSMailPlugin,
    59     public MMsgStoreObserver,
    74     public MMsgStoreObserver,
    60     protected MMsgStoreMailBoxObserver
    75     protected MMsgStoreMailBoxObserver
    61 
    76 
    62     {
    77     {
    66     friend class CSearchHandler;
    81     friend class CSearchHandler;
    67     //there is a need for a better way to access internal plugin state by
    82     //there is a need for a better way to access internal plugin state by
    68     //private components.
    83     //private components.
    69     friend class CDelayedDeleteMessagesOp;
    84     friend class CDelayedDeleteMessagesOp;
    70     friend class CDelayedSetContentOp;
    85     friend class CDelayedSetContentOp;
    71 
    86     friend class CDelayedMessageStorerOp;
       
    87 	// <qmail>
       
    88     friend class CDelayedAddNewOrRemoveChildPartOp;
       
    89     friend class CDelayedOp;
       
    90 	// </qmail>
    72 	protected:
    91 	protected:
    73     struct TOngoingFetchInfo;
    92     struct TOngoingFetchInfo;
    74     struct TCacheLine
    93     struct TCacheLine
    75         {
    94         {
    76         CMsgStoreMessage* iMsg;
    95         CMsgStoreMessage* iMsg;
    80         };
    99         };
    81 
   100 
    82     public:
   101     public:
    83         static CBasePlugin* NewL();
   102         static CBasePlugin* NewL();
    84         static CBasePlugin* NewLC();
   103         static CBasePlugin* NewLC();
    85         IMPORT_C virtual ~CBasePlugin();
   104         virtual ~CBasePlugin();
    86     protected:
   105     protected:
    87         IMPORT_C CBasePlugin();
   106          CBasePlugin();
    88         IMPORT_C void ConstructL();
   107          void ConstructL();
    89 
   108 
    90     // CFSMailPlugin //
   109     // CFSMailPlugin //
    91     public:
   110     public:
    92 
   111 
    93         /**
   112         /**
    94          * This methoed must be called before destruction of 
   113          * This methoed must be called before destruction of 
    95          * CBasePlugin derived class. To fix bug EIZU-7XVF2Z.
   114          * CBasePlugin derived class. To fix bug EIZU-7XVF2Z.
    96          */
   115          */
    97         IMPORT_C void DeleteDelayedOpsManager();
   116          void DeleteDelayedOpsManager();
    98 
   117          virtual void ListMailBoxesL(
    99         IMPORT_C virtual void ListMailBoxesL(
       
   100             RArray<TFSMailMsgId>& aMailboxes );
   118             RArray<TFSMailMsgId>& aMailboxes );
   101 
   119 
   102         IMPORT_C virtual CFSMailBox* GetMailBoxByUidL(
   120          virtual CFSMailBox* GetMailBoxByUidL(
   103             const TFSMailMsgId& aMailBox);
   121             const TFSMailMsgId& aMailBox);
   104 
   122 
   105 	    IMPORT_C virtual void DeleteMailBoxByUidL(
   123 	     virtual void DeleteMailBoxByUidL(
   106 	        const TFSMailMsgId& aMailBoxId,
   124 	        const TFSMailMsgId& aMailBoxId,
   107 	        MFSMailRequestObserver& aOperationObserver,
   125 	        MFSMailRequestObserver& aOperationObserver,
   108 			const TInt aRequestId );
   126 			const TInt aRequestId );
   109 
   127 
   110         IMPORT_C virtual TDesC& GetBrandingIdL(
   128          virtual TDesC& GetBrandingIdL(
   111             const TFSMailMsgId& aMailboxId );
   129             const TFSMailMsgId& aMailboxId );
   112 
   130 
   113         IMPORT_C virtual void MoveMessagesL(
   131          virtual void MoveMessagesL(
   114             const TFSMailMsgId& aMailBoxId,
   132             const TFSMailMsgId& aMailBoxId,
   115             const RArray<TFSMailMsgId>& aMessageIds,
   133             const RArray<TFSMailMsgId>& aMessageIds,
   116             const TFSMailMsgId& aSourceFolderId,
   134             const TFSMailMsgId& aSourceFolderId,
   117             const TFSMailMsgId& aDestinationFolderId );
   135             const TFSMailMsgId& aDestinationFolderId );
   118 
   136 
   119         IMPORT_C virtual void CopyMessagesL(
   137          virtual void CopyMessagesL(
   120             const TFSMailMsgId& aMailBoxId,
   138             const TFSMailMsgId& aMailBoxId,
   121             const RArray<TFSMailMsgId>& aMessageIds,
   139             const RArray<TFSMailMsgId>& aMessageIds,
   122             RArray<TFSMailMsgId>& aNewMessages,
   140             RArray<TFSMailMsgId>& aNewMessages,
   123             const TFSMailMsgId& aSourceFolderId,
   141             const TFSMailMsgId& aSourceFolderId,
   124             const TFSMailMsgId& aDestinationFolderId );
   142             const TFSMailMsgId& aDestinationFolderId );
   125 
   143 
   126         IMPORT_C MDesCArray* GetMrusL(
   144          MDesCArray* GetMrusL(
   127             const TFSMailMsgId& aMailBoxId );
   145             const TFSMailMsgId& aMailBoxId );
   128 
   146 
   129         IMPORT_C void SetMrusL(
   147          void SetMrusL(
   130             const TFSMailMsgId& aMailBoxId,
   148             const TFSMailMsgId& aMailBoxId,
   131             MDesCArray* aNewMruList );
   149             MDesCArray* aNewMruList );
   132 
   150 
   133         IMPORT_C void GoOnlineL(
   151          void GoOnlineL(
   134             const TFSMailMsgId& aMailBoxId );
   152             const TFSMailMsgId& aMailBoxId );
   135 
   153 
   136         IMPORT_C void GoOfflineL(
   154          void GoOfflineL(
   137             const TFSMailMsgId& aMailBoxId );
   155             const TFSMailMsgId& aMailBoxId );
   138 
   156 
   139         IMPORT_C const TFSProgress GetLastSyncStatusL(
   157          const TFSProgress GetLastSyncStatusL(
   140             const TFSMailMsgId& aMailBoxId );
   158             const TFSMailMsgId& aMailBoxId );
   141 
   159 
   142         IMPORT_C void RefreshNowL(
   160          void RefreshNowL(
   143             const TFSMailMsgId& aMailBoxId,
   161             const TFSMailMsgId& aMailBoxId,
   144          	MFSMailRequestObserver& aOperationObserver,
   162          	MFSMailRequestObserver& aOperationObserver,
   145          	TInt aRequestId );
   163          	TInt aRequestId,
   146 
   164          	const TBool aSilentConnection=EFalse );
   147         IMPORT_C virtual CFSMailFolder* GetFolderByUidL(
   165 
       
   166          virtual CFSMailFolder* GetFolderByUidL(
   148             const TFSMailMsgId& aMailBoxId,
   167             const TFSMailMsgId& aMailBoxId,
   149             const TFSMailMsgId& aFolderId );
   168             const TFSMailMsgId& aFolderId );
   150 
   169 
   151         IMPORT_C virtual CFSMailFolder* CreateFolderL(
   170          virtual CFSMailFolder* CreateFolderL(
   152             const TFSMailMsgId& aMailBoxId,
   171             const TFSMailMsgId& aMailBoxId,
   153             const TFSMailMsgId& aFolderId,
   172             const TFSMailMsgId& aFolderId,
   154             const TDesC& aFolderName,
   173             const TDesC& aFolderName,
   155             const TBool aSync );
   174             const TBool aSync );
   156 
   175 
   157         IMPORT_C virtual void DeleteFolderByUidL(
   176          virtual void DeleteFolderByUidL(
   158             const TFSMailMsgId& aMailBox,
   177             const TFSMailMsgId& aMailBox,
   159             const TFSMailMsgId& aFolder );
   178             const TFSMailMsgId& aFolder );
   160 
   179 
   161         IMPORT_C virtual void ListFoldersL(
   180          virtual void ListFoldersL(
   162             const TFSMailMsgId& aMailBoxId,
   181             const TFSMailMsgId& aMailBoxId,
   163             const TFSMailMsgId& aFolderId,
   182             const TFSMailMsgId& aFolderId,
   164             RPointerArray<CFSMailFolder>& aFolderList );
   183             RPointerArray<CFSMailFolder>& aFolderList );
   165 
   184 
   166         IMPORT_C virtual void ListFoldersL(
   185          virtual void ListFoldersL(
   167             const TFSMailMsgId& aMailBoxId,
   186             const TFSMailMsgId& aMailBoxId,
   168             RPointerArray<CFSMailFolder>& aFolderList );
   187             RPointerArray<CFSMailFolder>& aFolderList );
   169 
   188 
   170         IMPORT_C virtual TFSMailMsgId GetStandardFolderIdL(
   189          virtual TFSMailMsgId GetStandardFolderIdL(
   171             const TFSMailMsgId& aMailBoxId,
   190             const TFSMailMsgId& aMailBoxId,
   172             const TFSFolderType aFolderType );
   191             const TFSFolderType aFolderType );
   173 
   192 
   174         IMPORT_C virtual MFSMailIterator* ListMessagesL(
   193          virtual MFSMailIterator* ListMessagesL(
   175             const TFSMailMsgId& aMailBoxId,
   194             const TFSMailMsgId& aMailBoxId,
   176             const TFSMailMsgId& aFolderId,
   195             const TFSMailMsgId& aFolderId,
   177             const TFSMailDetails aDetails,
   196             const TFSMailDetails aDetails,
   178             const RArray<TFSMailSortCriteria>& aSorting );
   197             const RArray<TFSMailSortCriteria>& aSorting );
   179 
   198 
   180         IMPORT_C virtual CFSMailMessage* GetMessageByUidL(
   199          virtual CFSMailMessage* GetMessageByUidL(
   181             const TFSMailMsgId& aMailBoxId,
   200             const TFSMailMsgId& aMailBoxId,
   182             const TFSMailMsgId& aFolderId,
   201             const TFSMailMsgId& aFolderId,
   183             const TFSMailMsgId& aMessageId,
   202             const TFSMailMsgId& aMessageId,
   184             const TFSMailDetails aDetails );
   203             const TFSMailDetails aDetails );
   185 
   204 
   186         /**
   205         /**
   187          * The delete is executed asynchronously. The base plugin will queue
   206          * The delete is executed asynchronously. The base plugin will queue
   188          * the request and return immediately.
   207          * the request and return immediately.
   189          */
   208          */
   190         IMPORT_C virtual void DeleteMessagesByUidL(
   209          virtual void DeleteMessagesByUidL(
   191             const TFSMailMsgId& aMailBoxId,
   210             const TFSMailMsgId& aMailBoxId,
   192             const TFSMailMsgId& aFolderId,
   211             const TFSMailMsgId& aFolderId,
   193             const RArray<TFSMailMsgId>& aMessages );
   212             const RArray<TFSMailMsgId>& aMessages );
   194 
   213 
   195         IMPORT_C virtual CFSMailMessage* CreateMessageToSendL(
   214          virtual CFSMailMessage* CreateMessageToSendL(
   196             const TFSMailMsgId& aMailBox );
   215             const TFSMailMsgId& aMailBox );
   197 
   216 // <qmail>
   198         IMPORT_C virtual CFSMailMessage* CreateForwardMessageL(
   217         virtual void CreateMessageToSendL(
       
   218             const TFSMailMsgId& aMailBoxId,
       
   219             MFSMailRequestObserver& aOperationObserver,
       
   220             const TInt aRequestId );
       
   221 // </qmail>
       
   222 
       
   223          virtual CFSMailMessage* CreateForwardMessageL(
   199             const TFSMailMsgId& aMailBox,
   224             const TFSMailMsgId& aMailBox,
   200             const TFSMailMsgId& aOriginal,
   225             const TFSMailMsgId& aOriginal,
   201             const TDesC& aHeaderDescriptor );
   226             const TDesC& aHeaderDescriptor );
   202 
   227 
   203         IMPORT_C virtual CFSMailMessage* CreateReplyMessageL(
   228          virtual CFSMailMessage* CreateReplyMessageL(
   204             const TFSMailMsgId& aMailBoxId,
   229             const TFSMailMsgId& aMailBoxId,
   205             const TFSMailMsgId& aOriginalMessageId,
   230             const TFSMailMsgId& aOriginalMessageId,
   206             const TBool aReplyToAll,
   231             const TBool aReplyToAll,
   207             const TDesC& aHeaderDescriptor );
   232             const TDesC& aHeaderDescriptor );
   208 
   233 
   209         IMPORT_C virtual void StoreMessageL(
   234          virtual void StoreMessageL(
   210             const TFSMailMsgId& aMailBoxId,
   235             const TFSMailMsgId& aMailBoxId,
   211             CFSMailMessage& aMessage );
   236             CFSMailMessage& aMessage );
   212 
   237         
   213         IMPORT_C virtual void FetchMessagesL(
   238 // <qmail>
       
   239          void StoreMessagesL(
       
   240                 const TFSMailMsgId& aMailBoxId,
       
   241                 RPointerArray<CFSMailMessage> &messages,
       
   242                 MFSMailRequestObserver& aOperationObserver,
       
   243                 const TInt aRequestId );
       
   244 // </qmail>
       
   245         
       
   246 // <qmail>
       
   247         virtual void StoreMessagePartsL(
       
   248                RPointerArray<CFSMailMessagePart>& aMessageParts,
       
   249                MFSMailRequestObserver& aOperationObserver,
       
   250                const TInt aRequestId);
       
   251 // <//qmail>
       
   252 		
       
   253          virtual void FetchMessagesL(
   214             const TFSMailMsgId& aMailBoxId,
   254             const TFSMailMsgId& aMailBoxId,
   215             const TFSMailMsgId& aFolderId,
   255             const TFSMailMsgId& aFolderId,
   216             const RArray<TFSMailMsgId>& aMessageIds,
   256             const RArray<TFSMailMsgId>& aMessageIds,
   217             TFSMailDetails aDetails,
   257             TFSMailDetails aDetails,
   218             MFSMailRequestObserver& aObserver,
   258             MFSMailRequestObserver& aObserver,
   219             TInt aRequestId );
   259             TInt aRequestId );
   220 
   260 
   221         IMPORT_C virtual void FetchMessagePartsL(
   261          virtual void FetchMessagePartsL(
   222             const TFSMailMsgId& aMailBoxId,
   262             const TFSMailMsgId& aMailBoxId,
   223      		const TFSMailMsgId& aFolderId,
   263      		const TFSMailMsgId& aFolderId,
   224      		const TFSMailMsgId& aMessageId,
   264      		const TFSMailMsgId& aMessageId,
   225      		const RArray<TFSMailMsgId>& aMessagePartIds,
   265      		const RArray<TFSMailMsgId>& aMessagePartIds,
   226         	MFSMailRequestObserver& aOperationObserver,
   266         	MFSMailRequestObserver& aOperationObserver,
   227 			const TInt aRequestId,
   267 			const TInt aRequestId,
   228         	const TUint aPreferredByteCount );
   268         	const TUint aPreferredByteCount );
   229 
   269 
   230         IMPORT_C virtual void GetMessagesL(
   270          virtual void GetMessagesL(
   231             const TFSMailMsgId& aMailBoxId,
   271             const TFSMailMsgId& aMailBoxId,
   232             const TFSMailMsgId& aParentFolderId,
   272             const TFSMailMsgId& aParentFolderId,
   233             const RArray<TFSMailMsgId>& aMessageIds,
   273             const RArray<TFSMailMsgId>& aMessageIds,
   234             RPointerArray<CFSMailMessage>& aMessageList,
   274             RPointerArray<CFSMailMessage>& aMessageList,
   235             TFSMailDetails aDetails );
   275             TFSMailDetails aDetails );
   236 
   276 
   237         IMPORT_C virtual void ChildPartsL(
   277          virtual void ChildPartsL(
   238             const TFSMailMsgId& aMailBoxId,
   278             const TFSMailMsgId& aMailBoxId,
   239             const TFSMailMsgId& aParentFolderId,
   279             const TFSMailMsgId& aParentFolderId,
   240 			const TFSMailMsgId& aMessageId,
   280 			const TFSMailMsgId& aMessageId,
   241      		const TFSMailMsgId& aParentId,
   281      		const TFSMailMsgId& aParentId,
   242      		RPointerArray<CFSMailMessagePart>& aParts );
   282      		RPointerArray<CFSMailMessagePart>& aParts );
   243 
   283 
   244         IMPORT_C virtual CFSMailMessagePart* NewChildPartL(
   284          virtual CFSMailMessagePart* NewChildPartL(
   245             const TFSMailMsgId& aMailBoxId,
   285             const TFSMailMsgId& aMailBoxId,
   246         	const TFSMailMsgId& aParentFolderId,
   286         	const TFSMailMsgId& aParentFolderId,
   247 			const TFSMailMsgId& aMessageId,
   287 			const TFSMailMsgId& aMessageId,
   248      		const TFSMailMsgId& aParentPartId,
   288      		const TFSMailMsgId& aParentPartId,
   249         	const TFSMailMsgId& aInsertBefore,
   289         	const TFSMailMsgId& aInsertBefore,
   250         	const TDesC& aContentType );
   290         	const TDesC& aContentType );
   251 
   291 
   252         IMPORT_C virtual CFSMailMessagePart* CopyMessageAsChildPartL(
   292          virtual CFSMailMessagePart* CopyMessageAsChildPartL(
   253             const TFSMailMsgId& aMailBoxId,
   293             const TFSMailMsgId& aMailBoxId,
   254             const TFSMailMsgId& aParentFolderId,
   294             const TFSMailMsgId& aParentFolderId,
   255 			const TFSMailMsgId& aMessageId,
   295 			const TFSMailMsgId& aMessageId,
   256         	const TFSMailMsgId& aParentPartId,
   296         	const TFSMailMsgId& aParentPartId,
   257         	const TFSMailMsgId& aInsertBefore,
   297         	const TFSMailMsgId& aInsertBefore,
   258         	const CFSMailMessage& aMessage );
   298         	const CFSMailMessage& aMessage );
   259 
   299 
   260         IMPORT_C virtual void RemoveChildPartL(
   300          virtual void RemoveChildPartL(
   261             const TFSMailMsgId& aMailBoxId,
   301             const TFSMailMsgId& aMailBoxId,
   262             const TFSMailMsgId& aParentFolderId,
   302             const TFSMailMsgId& aParentFolderId,
   263         	const TFSMailMsgId& aMessageId,
   303         	const TFSMailMsgId& aMessageId,
   264             const TFSMailMsgId& aParentPartId,
   304             const TFSMailMsgId& aParentPartId,
   265             const TFSMailMsgId& aPartId );
   305             const TFSMailMsgId& aPartId );
   266 
   306          // <qmail>
   267         IMPORT_C virtual void SetPartContentFromFileL(
   307          virtual void RemoveChildPartL(
       
   308              const TFSMailMsgId& aMailBoxId,
       
   309              const TFSMailMsgId& aParentFolderId,
       
   310              const TFSMailMsgId& aMessageId,
       
   311              const TFSMailMsgId& aParentPartId,
       
   312              const TFSMailMsgId& aPartId,
       
   313              MFSMailRequestObserver& aOperationObserver,
       
   314              const TInt aRequestId );
       
   315          // </qmail>
       
   316 
       
   317          virtual void SetPartContentFromFileL(
   268             const TFSMailMsgId& aMailBoxId,
   318             const TFSMailMsgId& aMailBoxId,
   269             const TFSMailMsgId& aParentFolderId,
   319             const TFSMailMsgId& aParentFolderId,
   270             const TFSMailMsgId& aMessageId,
   320             const TFSMailMsgId& aMessageId,
   271             const TFSMailMsgId& aMessagePartId,
   321             const TFSMailMsgId& aMessagePartId,
   272             const TDesC& aFilePath );
   322             const TDesC& aFilePath );
   273 
   323 
   274         IMPORT_C virtual void StoreMessagePartL(
   324          virtual void StoreMessagePartL(
   275             const TFSMailMsgId& aMailBoxId,
   325             const TFSMailMsgId& aMailBoxId,
   276             const TFSMailMsgId& aParentFolderId,
   326             const TFSMailMsgId& aParentFolderId,
   277          	const TFSMailMsgId& aMessageId,
   327          	const TFSMailMsgId& aMessageId,
   278          	CFSMailMessagePart& aMessagePart );
   328          	CFSMailMessagePart& aMessagePart );
   279 
   329 
   280         IMPORT_C virtual CFSMailMessagePart* MessagePartL(
   330          virtual CFSMailMessagePart* MessagePartL(
   281             const TFSMailMsgId& aMailBoxId,
   331             const TFSMailMsgId& aMailBoxId,
   282             const TFSMailMsgId& aParentFolderId,
   332             const TFSMailMsgId& aParentFolderId,
   283             const TFSMailMsgId& aMessageId,
   333             const TFSMailMsgId& aMessageId,
   284             const TFSMailMsgId& aMessagePartId );
   334             const TFSMailMsgId& aMessagePartId );
   285 
   335 
   286         IMPORT_C virtual TInt GetMessagePartFileL(
   336          virtual TInt GetMessagePartFileL(
   287             const TFSMailMsgId& aMailBoxId,
   337             const TFSMailMsgId& aMailBoxId,
   288             const TFSMailMsgId& aParentFolderId,
   338             const TFSMailMsgId& aParentFolderId,
   289             const TFSMailMsgId& aMessageId,
   339             const TFSMailMsgId& aMessageId,
   290             const TFSMailMsgId& aMessagePartId,
   340             const TFSMailMsgId& aMessagePartId,
   291             RFile& aFileHandle );
   341             RFile& aFileHandle );
   292 
   342 
   293         IMPORT_C virtual void CopyMessagePartFileL(
   343          virtual void CopyMessagePartFileL(
   294             const TFSMailMsgId& aMailBoxId,
   344             const TFSMailMsgId& aMailBoxId,
   295             const TFSMailMsgId& aParentFolderId,
   345             const TFSMailMsgId& aParentFolderId,
   296             const TFSMailMsgId& aMessageId,
   346             const TFSMailMsgId& aMessageId,
   297             const TFSMailMsgId& aMessagePartId,
   347             const TFSMailMsgId& aMessagePartId,
   298             const TDesC& aFilePath );
   348             const TDesC& aFilePath );
   299 
   349 
   300 	    IMPORT_C virtual void GetContentToBufferL(
   350 	     virtual void GetContentToBufferL(
   301 	        const TFSMailMsgId& aMailBoxId,
   351 	        const TFSMailMsgId& aMailBoxId,
   302 	        const TFSMailMsgId& aParentFolderId,
   352 	        const TFSMailMsgId& aParentFolderId,
   303 	 		const TFSMailMsgId& aMessageId,
   353 	 		const TFSMailMsgId& aMessageId,
   304 	 		const TFSMailMsgId& aMessagePartId,
   354 	 		const TFSMailMsgId& aMessagePartId,
   305 	 		TDes& aBuffer,
   355 	 		TDes& aBuffer,
   306 	 		TUint aStartOffset );
   356 	 		TUint aStartOffset );
   307 
   357 
   308 	    IMPORT_C virtual void SetContentL(
   358 	     virtual void SetContentL(
   309 	        const TDesC& aBuffer,
   359 	        const TDesC& aBuffer,
   310 	        const TFSMailMsgId& aMailBoxId,
   360 	        const TFSMailMsgId& aMailBoxId,
   311 	        const TFSMailMsgId& aParentFolderId,
   361 	        const TFSMailMsgId& aParentFolderId,
   312             const TFSMailMsgId& aMessageId,
   362             const TFSMailMsgId& aMessageId,
   313             const TFSMailMsgId& aMessagePartId);
   363             const TFSMailMsgId& aMessagePartId);
   314 
   364 
   315         IMPORT_C virtual void RemovePartContentL(
   365          virtual void RemovePartContentL(
   316             const TFSMailMsgId& aMailBoxId,
   366             const TFSMailMsgId& aMailBoxId,
   317             const TFSMailMsgId& aParentFolderId,
   367             const TFSMailMsgId& aParentFolderId,
   318             const TFSMailMsgId& aMessageId,
   368             const TFSMailMsgId& aMessageId,
   319             const RArray<TFSMailMsgId>& aPartIds );
   369             const RArray<TFSMailMsgId>& aPartIds );
   320 
   370 
   321 	    IMPORT_C virtual void SearchL(
   371 	     virtual void SearchL(
   322 	        const TFSMailMsgId& aMailBoxId,
   372 	        const TFSMailMsgId& aMailBoxId,
   323 			const RArray<TFSMailMsgId>& aFolderIds,
   373 			const RArray<TFSMailMsgId>& aFolderIds,
   324 			const RPointerArray<TDesC>& aSearchStrings,
   374 			const RPointerArray<TDesC>& aSearchStrings,
   325 			const TFSMailSortCriteria& aSortCriteria,
   375 			const TFSMailSortCriteria& aSortCriteria,
   326 			MFSMailBoxSearchObserver& aSearchObserver );
   376 			MFSMailBoxSearchObserver& aSearchObserver );
   327 
   377 
   328     	IMPORT_C virtual void CancelSearch(
   378     	 virtual void CancelSearch(
   329     	    const TFSMailMsgId& aMailBoxId );
   379     	    const TFSMailMsgId& aMailBoxId );
   330 
   380 
   331         IMPORT_C virtual void ClearSearchResultCache(
   381          virtual void ClearSearchResultCache(
   332             const TFSMailMsgId& aMailBoxId );
   382             const TFSMailMsgId& aMailBoxId );
   333 
   383 
   334         IMPORT_C virtual void AddObserverL(
   384          virtual void AddObserverL(
   335             MFSMailEventObserver& aObserver );
   385             MFSMailEventObserver& aObserver );
   336 
   386 
   337         IMPORT_C virtual void RemoveObserver(
   387          virtual void RemoveObserver(
   338             MFSMailEventObserver& aObserver );
   388             MFSMailEventObserver& aObserver );
   339 
   389 
   340         IMPORT_C virtual void UnregisterRequestObserver(
   390          virtual void UnregisterRequestObserver(
   341             TInt aRequestId );
   391             TInt aRequestId );
   342 
   392 
   343         IMPORT_C virtual void SendMessageL(
   393          virtual void SendMessageL(
   344             CFSMailMessage& aMessage );
   394             CFSMailMessage& aMessage );
   345 
   395 
   346         IMPORT_C virtual TFSProgress StatusL(
   396          virtual TFSProgress StatusL(
   347             TInt aRequestId );
   397             TInt aRequestId );
   348 
   398 
   349         IMPORT_C virtual void CancelL(
   399          virtual void CancelL(
   350             TInt aRequestId );
   400             TInt aRequestId );
   351 
   401 
   352         IMPORT_C virtual void SubscribeMailboxEventsL(
   402          virtual void SubscribeMailboxEventsL(
   353             const TFSMailMsgId& aMailboxId,
   403             const TFSMailMsgId& aMailboxId,
   354             MFSMailEventObserver& aObserver );
   404             MFSMailEventObserver& aObserver );
   355 
   405 
   356         IMPORT_C virtual void UnsubscribeMailboxEvents(
   406          virtual void UnsubscribeMailboxEvents(
   357             const TFSMailMsgId& aMailboxId,
   407             const TFSMailMsgId& aMailboxId,
   358             MFSMailEventObserver& aObserver );
   408             MFSMailEventObserver& aObserver );
   359 
   409 //<qmail>
   360         IMPORT_C virtual TSSMailSyncState CurrentSyncState(
   410          virtual TSSMailSyncState CurrentSyncState(
   361             const TFSMailMsgId& aMailboxId );
   411             const TFSMailMsgId& aMailboxId );
   362 
   412 //</qmail>
   363         IMPORT_C virtual TFSMailBoxStatus GetMailBoxStatus(
   413          virtual TFSMailBoxStatus GetMailBoxStatus(
   364             const TFSMailMsgId& aMailboxId );
   414             const TFSMailMsgId& aMailboxId );
   365 
   415 
   366         IMPORT_C virtual TBool MailboxHasCapabilityL(
   416          virtual TBool MailboxHasCapabilityL(
   367             TFSMailBoxCapabilities aCapability,
   417             TFSMailBoxCapabilities aCapability,
   368 	 		TFSMailMsgId aMailBoxId );
   418 	 		TFSMailMsgId aMailBoxId );
   369 
   419 
   370 	    /**
   420 	    /**
   371 	     * Create a new ChildPart using a file path
   421 	     * Create a new ChildPart using a file path
   372 	     */
   422 	     */
   373 	    IMPORT_C virtual CFSMailMessagePart* NewChildPartFromFileL(
   423 	     virtual CFSMailMessagePart* NewChildPartFromFileL(
   374 		    const TFSMailMsgId& aMailBoxId,
   424 		    const TFSMailMsgId& aMailBoxId,
   375 		    const TFSMailMsgId& aParentFolderId,
   425 		    const TFSMailMsgId& aParentFolderId,
   376 		    const TFSMailMsgId& aMessageId,
   426 		    const TFSMailMsgId& aMessageId,
   377 		    const TFSMailMsgId& aParentPartId,
   427 		    const TFSMailMsgId& aParentPartId,
   378 			const TDesC& aContentType,
   428 			const TDesC& aContentType,
   381 	    /**
   431 	    /**
   382 	     * Create a new ChildPart using a file handle
   432 	     * Create a new ChildPart using a file handle
   383          *  NOTE 1: RFs.ShareProtected() must have been called already before calling this method.
   433          *  NOTE 1: RFs.ShareProtected() must have been called already before calling this method.
   384          *  NOTE 2: The ownersip of the RFile handle (aFile) is transferred to this method.
   434          *  NOTE 2: The ownersip of the RFile handle (aFile) is transferred to this method.
   385 	     */
   435 	     */
   386 	    IMPORT_C virtual CFSMailMessagePart* NewChildPartFromFileL(
   436 	     virtual CFSMailMessagePart* NewChildPartFromFileL(
   387 		    const TFSMailMsgId& aMailBoxId,
   437 		    const TFSMailMsgId& aMailBoxId,
   388 		    const TFSMailMsgId& aParentFolderId,
   438 		    const TFSMailMsgId& aParentFolderId,
   389 		    const TFSMailMsgId& aMessageId,
   439 		    const TFSMailMsgId& aMessageId,
   390 		    const TFSMailMsgId& aParentPartId,
   440 		    const TFSMailMsgId& aParentPartId,
   391 			const TDesC& aContentType,
   441 			const TDesC& aContentType,
   392 		    RFile& aFile );
   442 		    RFile& aFile );
   393 
   443 	     // <qmail>
   394         IMPORT_C virtual TInt WizardDataAvailableL();
   444 	     virtual void NewChildPartFromFileL(
   395 
   445 	         const TFSMailMsgId& aMailBoxId,
   396         IMPORT_C virtual void AuthenticateL(
   446 	         const TFSMailMsgId& aParentFolderId,
       
   447 	         const TFSMailMsgId& aMessageId,
       
   448 	         const TFSMailMsgId& aParentPartId,
       
   449 	         const TDesC& aContentType,
       
   450 	         const TDesC& aFilePath, 
       
   451 	         MFSMailRequestObserver& aOperationObserver,
       
   452 	         const TInt aRequestId );
       
   453 	     // </qmail>
       
   454          virtual TInt WizardDataAvailableL();
       
   455 
       
   456          virtual void AuthenticateL(
   397             MFSMailRequestObserver& aOperationObserver,
   457             MFSMailRequestObserver& aOperationObserver,
   398             TInt aRequestId );
   458             TInt aRequestId );
   399 
   459 
   400         IMPORT_C virtual void SetCredentialsL(
   460          virtual void SetCredentialsL(
   401             const TFSMailMsgId& aMailBoxId,
   461             const TFSMailMsgId& aMailBoxId,
   402             const TDesC& aUsername,
   462             const TDesC& aUsername,
   403             const TDesC& aPassword );
   463             const TDesC& aPassword );
   404 
   464 
   405         IMPORT_C virtual TInt CancelSyncL(
   465          virtual TInt CancelSyncL(
   406         	const TFSMailMsgId& aMailBoxId );
   466         	const TFSMailMsgId& aMailBoxId );
   407 
   467 
   408         IMPORT_C virtual void SetMailboxName(
   468          virtual void SetMailboxName(
   409             const TFSMailMsgId& /*aMailboxId*/,
   469             const TFSMailMsgId& /*aMailboxId*/,
   410             const TDesC& /*aMailboxName*/ );
   470             const TDesC& /*aMailboxName*/ );
   411 
   471 
   412     // MMsgStoreObserver //
   472     // MMsgStoreObserver //
   413     public:
   473     public:
   414         IMPORT_C virtual void SystemEventNotify(
   474          virtual void SystemEventNotify(
   415             TMsgStoreSystemEvent aEvent );
   475             TMsgStoreSystemEvent aEvent );
   416 
   476 
   417         IMPORT_C virtual void AccountEventNotify(
   477          virtual void AccountEventNotify(
   418             TMsgStoreAccountEvent aEvent,
   478             TMsgStoreAccountEvent aEvent,
   419     		TInt32 aOwnerId,
   479     		TInt32 aOwnerId,
   420             const TDesC& aName,
   480             const TDesC& aName,
   421     		const TDesC& aNewName,
   481     		const TDesC& aNewName,
   422     		TMsgStoreId aMailboxId );
   482     		TMsgStoreId aMailboxId );
   423 
   483 
   424         IMPORT_C virtual void ModificationNotify(
   484          virtual void ModificationNotify(
   425             TMsgStoreId aMailBoxId,
   485             TMsgStoreId aMailBoxId,
   426             TMsgStoreOperation aOperation,
   486             TMsgStoreOperation aOperation,
   427             TMsgStoreContainerType aType,
   487             TMsgStoreContainerType aType,
   428             TUint32 aFlags,
   488             TUint32 aFlags,
   429             TMsgStoreId aId,
   489             TMsgStoreId aId,
   430             TMsgStoreId aParentId,
   490             TMsgStoreId aParentId,
   431             TMsgStoreId aOtherId );
   491             TMsgStoreId aOtherId );
   432 
   492 
   433     protected:
   493     protected:
   434 
   494 
   435         IMPORT_C CFSMailAddress* FetchEmailAddressL(
   495          CFSMailAddress* FetchEmailAddressL(
   436             CMsgStorePropertyContainer& aMessage,
   496             CMsgStorePropertyContainer& aMessage,
   437             TUint aIdx );
   497             TUint aIdx );
   438 
   498 
   439         IMPORT_C CMailboxInfo& GetMailboxInfoL(
   499          CMailboxInfo& GetMailboxInfoL(
   440             TMsgStoreId aId );
   500             TMsgStoreId aId );
   441 
   501 
   442         void GetMailboxDisplayNameL(
   502         void GetMailboxDisplayNameL(
   443             TMsgStoreId aId,
   503             TMsgStoreId aId,
   444             RBuf& aDisplayName );
   504             RBuf& aDisplayName );
   445 
   505 
   446         IMPORT_C virtual TUint GetPluginId();
   506          virtual TUint GetPluginId();
   447 
   507 
   448         /**
   508         /**
   449          * Get signature string from protocol specific subclass.
   509          * Get signature string from protocol specific subclass.
   450          * Caller is responsible for memory of returned string.
   510          * Caller is responsible for memory of returned string.
   451          */
   511          */
   471             {
   531             {
   472             return NULL;
   532             return NULL;
   473             }
   533             }
   474 
   534 
   475 
   535 
   476         IMPORT_C virtual void TranslateMsgStorePropsL(
   536          virtual void TranslateMsgStorePropsL(
   477             const TFSMailMsgId& aMailBoxId,
   537             const TFSMailMsgId& aMailBoxId,
   478             CMsgStorePropertyContainer& aMessage,
   538             CMsgStorePropertyContainer& aMessage,
   479             CFSMailMessagePart& aFsMsg,
   539             CFSMailMessagePart& aFsMsg,
   480             const TFSMailDetails aDetails = EFSMsgDataEnvelope );
   540             const TFSMailDetails aDetails = EFSMsgDataEnvelope );
   481 
   541 
   482         /**
   542         /**
   483          * Translates common message store meeting requests into Freestyle mr info
   543          * Translates common message store meeting requests into Freestyle mr info
   484          * objects.
   544          * objects.
   485          * Sync plugins might be interested in extending the default behavior.
   545          * Sync plugins might be interested in extending the default behavior.
   486          */
   546          */
   487         IMPORT_C virtual void TranslateMsgStoreMrL(
   547          virtual void TranslateMsgStoreMrL(
   488             const TFSMailMsgId& aMailBoxId,
   548             const TFSMailMsgId& aMailBoxId,
   489             CMsgStorePropertyContainer& aMessage,
   549             CMsgStorePropertyContainer& aMessage,
   490             CMsgStorePropertyContainer& aCalendar,
   550             CMsgStorePropertyContainer& aCalendar,
   491             CFSMailMessagePart& aFsMsg );
   551             CFSMailMessagePart& aFsMsg );
   492 
   552 
   497          * to the message store can be minimized.
   557          * to the message store can be minimized.
   498          *
   558          *
   499          * @param aSrc input/source Freestyle message.
   559          * @param aSrc input/source Freestyle message.
   500          * @param aDst output/destination MessageStore message.
   560          * @param aDst output/destination MessageStore message.
   501          */
   561          */
   502         IMPORT_C virtual void TranslateEmailFwMessageL(
   562          virtual void TranslateEmailFwMessageL(
   503             CFSMailMessagePart& aSrc,
   563             CFSMailMessagePart& aSrc,
   504             CMsgStoreMessagePart& aDst,
   564             CMsgStoreMessagePart& aDst,
   505             TBool aInInbox );
   565             TBool aInInbox );
   506 
   566 
   507         IMPORT_C virtual void TranslateEmailFwMrL(
   567          virtual void TranslateEmailFwMrL(
   508             MMRInfoObject& aSrc,
   568             MMRInfoObject& aSrc,
   509             CMsgStorePropertyContainer& aDst );
   569             CMsgStorePropertyContainer& aDst );
   510 
   570 
   511         IMPORT_C void TranslateEmailFwAttendeeL(
   571          void TranslateEmailFwAttendeeL(
   512             MMROrganizer& aSrc,
   572             MMROrganizer& aSrc,
   513             RMsgStoreAddress& aDst );
   573             RMsgStoreAddress& aDst );
   514 
   574 
   515         void DoListFoldersL(
   575         void DoListFoldersL(
   516             TFSMailMsgId aMailBoxId,
   576             TFSMailMsgId aMailBoxId,
   530             TFSMailMsgId aMailBox = TFSMailMsgId(),
   590             TFSMailMsgId aMailBox = TFSMailMsgId(),
   531             TAny* aParam1 = NULL,
   591             TAny* aParam1 = NULL,
   532             TAny* aParam2 = NULL,
   592             TAny* aParam2 = NULL,
   533             TAny* aParam3 = NULL );
   593             TAny* aParam3 = NULL );
   534 
   594 
   535         IMPORT_C virtual void NotifyMailboxEventL(
   595          virtual void NotifyMailboxEventL(
   536                 TFSMailEvent aEvent,
   596                 TFSMailEvent aEvent,
   537                 TFSMailMsgId aMailBox,
   597                 TFSMailMsgId aMailBox,
   538                 TAny* aParam1 = NULL,
   598                 TAny* aParam1 = NULL,
   539                 TAny* aParam2 = NULL,
   599                 TAny* aParam2 = NULL,
   540                 TAny* aParam3 = NULL );
   600                 TAny* aParam3 = NULL );
   542         /**
   602         /**
   543          * Tries to find a body part of the specified content type. By default
   603          * Tries to find a body part of the specified content type. By default
   544          * looks for the text/plain part.
   604          * looks for the text/plain part.
   545          * @return the main body text part or NULL if one can not be found.
   605          * @return the main body text part or NULL if one can not be found.
   546          */
   606          */
   547         IMPORT_C CMsgStoreMessagePart* GetBodyPartL(
   607          CMsgStoreMessagePart* GetBodyPartL(
   548             CMsgStoreMessage& aMessage,
   608             CMsgStoreMessage& aMessage,
   549             const TDesC& aContentType = KFSMailContentTypeTextPlain() );
   609             const TDesC& aContentType = KFSMailContentTypeTextPlain() );
   550 
   610 
   551         /**
   611         /**
   552          * Creates a forward/reply message via copying the original, using sender(s) as
   612          * Creates a forward/reply message via copying the original, using sender(s) as
   555          * @param aHeaderDescriptor packaged TReplyForwardParams that provide the message
   615          * @param aHeaderDescriptor packaged TReplyForwardParams that provide the message
   556          * quote header and the smart reply label that needs to be inserted in case of a
   616          * quote header and the smart reply label that needs to be inserted in case of a
   557          * truncated message.
   617          * truncated message.
   558          * @param aKeepAttachments true if the original message attachments are to be kept.
   618          * @param aKeepAttachments true if the original message attachments are to be kept.
   559          */
   619          */
   560         IMPORT_C CFSMailMessage* CreateForwardReplyMessageL(
   620          CFSMailMessage* CreateForwardReplyMessageL(
   561             const TFSMailMsgId& aMailBox,
   621             const TFSMailMsgId& aMailBox,
   562             const TFSMailMsgId& aOriginal,
   622             const TFSMailMsgId& aOriginal,
   563             const TBool aReplyToAll,
   623             const TBool aReplyToAll,
   564             const TDesC& aHeaderDescriptor,
   624             const TDesC& aHeaderDescriptor,
   565             TBool aKeepAttachments,
   625             TBool aKeepAttachments,
   567 
   627 
   568         /**
   628         /**
   569          * Recursively looks for the part with id aPartId in the part container
   629          * Recursively looks for the part with id aPartId in the part container
   570          * aParent.
   630          * aParent.
   571          */
   631          */
   572         IMPORT_C CMsgStoreMessagePart* FindMessagePartL(
   632          CMsgStoreMessagePart* FindMessagePartL(
   573             CMsgStoreMessagePart& aParent,
   633             CMsgStoreMessagePart& aParent,
   574             TMsgStoreId aPartId );
   634             TMsgStoreId aPartId );
   575 
   635 
   576         /**
   636         /**
   577          * Get MsgStore account object for the specified mailbox id.
   637          * Get MsgStore account object for the specified mailbox id.
   578          */
   638          */
   579         IMPORT_C CMsgStoreAccount* GetAccountForMsgBoxL(
   639          CMsgStoreAccount* GetAccountForMsgBoxL(
   580             const TFSMailMsgId& aMailboxId );
   640             const TFSMailMsgId& aMailboxId );
   581 
   641 
   582         /**
   642         /**
   583          * Create a MR reply message.
   643          * Create a MR reply message.
   584          */
   644          */
   585         IMPORT_C virtual CFSMailMessage* CreateMrReplyMessageL(
   645          virtual CFSMailMessage* CreateMrReplyMessageL(
   586             const TFSMailMsgId& aMailBoxId,
   646             const TFSMailMsgId& aMailBoxId,
   587             MMRInfoObject& aMeetingRequest,
   647             MMRInfoObject& aMeetingRequest,
   588             const TFSMailMsgId& aOriginalMessageId );
   648             const TFSMailMsgId& aOriginalMessageId );
   589 
   649 
   590        /**
   650        /**
   591         * Applyed when an account was deleted for proper cleanup.
   651         * Applyed when an account was deleted for proper cleanup.
   592         */
   652         */
   593        IMPORT_C  virtual void HandleMailboxDeleteL(
   653          virtual void HandleMailboxDeleteL(
   594            const TFSMailMsgId& aMailboxId );
   654            const TFSMailMsgId& aMailboxId );
   595 
   655 
   596 
   656 
   597     protected:
   657     protected:
   598 
   658 
   626         void TranslateEmailFwRecipientsL(
   686         void TranslateEmailFwRecipientsL(
   627             CMsgStoreMessagePart& aDst,
   687             CMsgStoreMessagePart& aDst,
   628             const TDesC8& aDstProperty,
   688             const TDesC8& aDstProperty,
   629             RPointerArray<CFSMailAddress>& aRecipients );
   689             RPointerArray<CFSMailAddress>& aRecipients );
   630 
   690 
   631         IMPORT_C static void RemoveAllPropertiesL(
   691         static void RemoveAllPropertiesL(
   632             CMsgStorePropertyContainer& aContainer,
   692             CMsgStorePropertyContainer& aContainer,
   633             const TDesC8& aName );
   693             const TDesC8& aName );
   634 
   694 
   635         IMPORT_C CMailboxInfo& RefreshMailboxCacheL( TMsgStoreId aMailBoxId );
   695          CMailboxInfo& RefreshMailboxCacheL( TMsgStoreId aMailBoxId );
   636 
   696 
   637         void UnsubscribeMailboxEventsL(
   697         void UnsubscribeMailboxEventsL(
   638             const TFSMailMsgId& aMailboxId,
   698             const TFSMailMsgId& aMailboxId,
   639             MFSMailEventObserver& aObserver );
   699             MFSMailEventObserver& aObserver );
   640 
   700 
   670 		    RFile& aFile );
   730 		    RFile& aFile );
   671 
   731 
   672 	    /**
   732 	    /**
   673 	     * Called by RemovePartContentL for each part that needs its content removed.
   733 	     * Called by RemovePartContentL for each part that needs its content removed.
   674 	     */
   734 	     */
   675 	    IMPORT_C virtual void HandleRemovePartContentL(
   735 	     virtual void HandleRemovePartContentL(
   676 	    	CMsgStoreMessage& aMsg,
   736 	    	CMsgStoreMessage& aMsg,
   677 	    	CMsgStoreMessagePart& aPart );
   737 	    	CMsgStoreMessagePart& aPart );
   678 
   738 
   679 	    /**
   739 	    /**
   680 	     * When replying or forwarding a message determine the "To:" field's value.
   740 	     * When replying or forwarding a message determine the "To:" field's value.
   690          * @param aMailBoxNameHasChanged - used to return to the caller if a change is detected.
   750          * @param aMailBoxNameHasChanged - used to return to the caller if a change is detected.
   691          * @param aMailBoxId - the ID of the mailbox
   751          * @param aMailBoxId - the ID of the mailbox
   692          */
   752          */
   693 	    void RefreshCachedMailBoxDisplayNameL( TBool& aMailBoxNameHasChanged, const TMsgStoreId& aMailBoxId );
   753 	    void RefreshCachedMailBoxDisplayNameL( TBool& aMailBoxNameHasChanged, const TMsgStoreId& aMailBoxId );
   694 
   754 
   695 	    IMPORT_C virtual void ReportRequestStatusL(
   755 	     virtual void ReportRequestStatusL(
   696             TMsgStoreId aMailBox,
   756             TMsgStoreId aMailBox,
   697             TMsgStoreId aOtherId,
   757             TMsgStoreId aOtherId,
   698             TMsgStoreId aMsgId,
   758             TMsgStoreId aMsgId,
   699             TMsgStoreId aPartId,
   759             TMsgStoreId aPartId,
   700             TBool aCanReportCompletion = EFalse );
   760             TBool aCanReportCompletion = EFalse );
   701 
   761 
   702         /**
   762         /**
   703 	     * Finds the corresponding download request object for the part with id
   763 	     * Finds the corresponding download request object for the part with id
   704 	     * of aPartId identified by also the mailbox and the message ids.
   764 	     * of aPartId identified by also the mailbox and the message ids.
   705 	     */
   765 	     */
   706 	    IMPORT_C TBool FindFetchRequestL(
   766 	     TBool FindFetchRequestL(
   707 	    	TMsgStoreId aMailBox,
   767 	    	TMsgStoreId aMailBox,
   708 	    	TMsgStoreId aOtherId,
   768 	    	TMsgStoreId aOtherId,
   709 	    	TMsgStoreId aMsgId,
   769 	    	TMsgStoreId aMsgId,
   710 	    	TMsgStoreId aPartId,
   770 	    	TMsgStoreId aPartId,
   711 	    	CBasePlugin::TOngoingFetchInfo& aOngoingFetchInfo );
   771 	    	CBasePlugin::TOngoingFetchInfo& aOngoingFetchInfo );
   712 
   772 
   713 	    IMPORT_C TBool DeleteFetchRequestForPart(
   773 	     TBool DeleteFetchRequestForPart(
   714 	    	TOngoingFetchInfo& aFetchInfo );
   774 	    	TOngoingFetchInfo& aFetchInfo );
   715 
   775 
   716 	    IMPORT_C void DeleteFetchRequest(
   776 	     void DeleteFetchRequest(
   717 	    	TOngoingFetchInfo& aFetchInfo );
   777 	    	TOngoingFetchInfo& aFetchInfo );
   718 
   778 
   719 
   779 
   720     protected:
   780     protected:
   721 	    IMPORT_C void ResetCache();
   781 	     void ResetCache();
   722 
   782 
   723 	    IMPORT_C void ResetBodyCache();
   783 	     void ResetBodyCache();
   724 
   784 
   725 	    /**
   785 	    /**
   726 	     * This method retrieves the specified message store message from a
   786 	     * This method retrieves the specified message store message from a
   727 	     * cache or directly from the message store if not cached. If the
   787 	     * cache or directly from the message store if not cached. If the
   728 	     * message was retrieved from the message store it is put into the
   788 	     * message was retrieved from the message store it is put into the
   731 	     * invalid it must call the ResetCache method.
   791 	     * invalid it must call the ResetCache method.
   732 	     *
   792 	     *
   733 	     * @param aMailBoxId
   793 	     * @param aMailBoxId
   734 	     * @param aMsgId
   794 	     * @param aMsgId
   735 	     */
   795 	     */
   736 	    IMPORT_C CMsgStoreMessage* GetCachedMsgL(
   796 	     CMsgStoreMessage* GetCachedMsgL(
   737 	        TMsgStoreId aMailBoxId,
   797 	        TMsgStoreId aMailBoxId,
   738 	        TMsgStoreId aMsgId );
   798 	        TMsgStoreId aMsgId );
   739 
   799 
   740 	    IMPORT_C CMsgStoreMessagePart* GetCachedBodyL(
   800 	     CMsgStoreMessagePart* GetCachedBodyL(
   741 	        TMsgStoreId aPartId );
   801 	        TMsgStoreId aPartId );
   742 
   802 
   743 	    IMPORT_C RPointerArray<CMsgStoreMessagePart>& GetCachedMsgChildrenL();
   803 	     RPointerArray<CMsgStoreMessagePart>& GetCachedMsgChildrenL();
   744 
   804 
   745 	    IMPORT_C RPointerArray<CMsgStoreMessagePart>& GetCachedBodyChildrenL();
   805 	     RPointerArray<CMsgStoreMessagePart>& GetCachedBodyChildrenL();
   746 
   806 
   747 	    IMPORT_C void InvalidateCacheIfNecessary(
   807 	     void InvalidateCacheIfNecessary(
   748 	        TMsgStoreId aId,
   808 	        TMsgStoreId aId,
   749 	        TMsgStoreId aParentId,
   809 	        TMsgStoreId aParentId,
   750 	        TMsgStoreId aOtherId );
   810 	        TMsgStoreId aOtherId );
   751 	    
   811 	    
   752 	    IMPORT_C virtual const TDesC& CBasePlugin::CalendarFileName() const;
   812 	     virtual const TDesC& CBasePlugin::CalendarFileName() const;
   753 
   813 
   754     public:
   814     public:
   755 
   815 
   756 	    /**
   816 	    /**
   757 	     * Direct message sending that does not require having a FW message
   817 	     * Direct message sending that does not require having a FW message
   758 	     * instance. The FW's SendMessageL method internally uses this method
   818 	     * instance. The FW's SendMessageL method internally uses this method
   759 	     * after translating the FW message to the MsgStore format.
   819 	     * after translating the FW message to the MsgStore format.
   760 	     */
   820 	     */
   761 	    IMPORT_C void SendMessageL(
   821 	     void SendMessageL(
   762             CMsgStoreMailBox& aMailBox,
   822             CMsgStoreMailBox& aMailBox,
   763             CMsgStoreMessage& aMsg,
   823             CMsgStoreMessage& aMsg,
   764             const TTime& aSentTime );
   824             const TTime& aSentTime );
   765 
   825 
   766 	    /**
   826 	    /**
   767 	     * The delayed ops manager is used to queue asynchronous processing of
   827 	     * The delayed ops manager is used to queue asynchronous processing of
   768 	     * plugin requests.
   828 	     * plugin requests.
   769 	     */
   829 	     */
   770 	    IMPORT_C MDelayedOpsManager& GetDelayedOpsManager();
   830 	     MDelayedOpsManager& GetDelayedOpsManager();
   771 
   831 
   772     protected:
   832     protected:
   773 
   833 
   774         CMsgStore* iMsgStore;
   834         CMsgStore* iMsgStore;
   775         RMap<TInt64, CMailboxInfo> iMailboxes;
   835         RMap<TInt64, CMailboxInfo> iMailboxes;
   776 
   836 
   777         //does not actually own the observers.
   837         //does not actually own the observers.
   778         RPointerArray<MFSMailEventObserver> iObservers;
   838         RPointerArray<MFSMailEventObserver> iObservers;
   779         //async fetch reqs.
   839         //async fetch reqs.
   780         RPointerArray<CFetchRequester> iReqs;
   840         RPointerArray<CFetchRequester> iReqs;       
       
   841         RPointerArray<CDelayedOp> iDelayedOpReqs;
   781 
   842 
   782         TCacheLine iCacheLine;
   843         TCacheLine iCacheLine;
   783 
   844 
   784     private:
   845     private:
   785     protected:
   846     protected:
   810 /**
   871 /**
   811  * There is mailbox-related state information that is used to bind
   872  * There is mailbox-related state information that is used to bind
   812  * the FSEF representation and the MsgStore one. This entity groups
   873  * the FSEF representation and the MsgStore one. This entity groups
   813  * it in one place.
   874  * it in one place.
   814  */
   875  */
   815 class CMailboxInfo : public CBase
   876 NONSHARABLE_CLASS( CMailboxInfo ) : public CBase
   816     {
   877     {
   817     public:
   878     public:
   818         CMailboxInfo( CBasePlugin* aBasePlugin )
   879         CMailboxInfo( CBasePlugin* aBasePlugin )
   819             : iBasePlugin( aBasePlugin )
   880             : iBasePlugin( aBasePlugin )
   820             {
   881             {