emailservices/emailframework/inc/MFSMailPlugin.h
changeset 20 ecc8def7944a
parent 18 578830873419
child 62 a8c646b56683
equal deleted inserted replaced
18:578830873419 20:ecc8def7944a
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    52  *  to be called back.
    52  *  to be called back.
    53  *
    53  *
    54  *  API allows Symbian leaves from plugins and will trap them, error codes are
    54  *  API allows Symbian leaves from plugins and will trap them, error codes are
    55  *  expected to be symbian error codes.
    55  *  expected to be symbian error codes.
    56  *  @since ...
    56  *  @since ...
    57  */ 
    57  */
    58 class MFSMailPlugin
    58 class MFSMailPlugin
    59   	{
    59   	{
    60 public: // Data
    60 public: // Data
    61 
    61 
    62 public: // Methods
    62 public: // Methods
    66      * returns plugin capabilities
    66      * returns plugin capabilities
    67      *
    67      *
    68      * @return plugin capabilities data structure
    68      * @return plugin capabilities data structure
    69      */
    69      */
    70   	 virtual const TFSMailPluginCapabilities ReadPluginCapabilitiesL() = 0;
    70   	 virtual const TFSMailPluginCapabilities ReadPluginCapabilitiesL() = 0;
    71   	      	
    71 
    72 	// MAILBOX HANDLING
    72 	// MAILBOX HANDLING
    73     /**
    73     /**
    74      * lists existing mailboxes implemented by given plugin
    74      * lists existing mailboxes implemented by given plugin
    75      *
    75      *
    76      * @param aPlugin defines which plugin request is accessed to
    76      * @param aPlugin defines which plugin request is accessed to
    86      *               - mailbox name
    86      *               - mailbox name
    87      *               - branding id
    87      *               - branding id
    88      *               - mailbox capabilities
    88      *               - mailbox capabilities
    89      *
    89      *
    90      * @param aMailBoxId defines mailbox id
    90      * @param aMailBoxId defines mailbox id
    91      * @return mailBox object ( CFSMailBox ) to be owned by user 
    91      * @return mailBox object ( CFSMailBox ) to be owned by user
    92      */
    92      */
    93 	 virtual CFSMailBox* GetMailBoxByUidL( const TFSMailMsgId& aMailBoxId) = 0;
    93 	 virtual CFSMailBox* GetMailBoxByUidL( const TFSMailMsgId& aMailBoxId) = 0;
    94       	  		
    94 
    95     /**
    95     /**
    96      * removes mailbox 
    96      * removes mailbox
    97      *
    97      *
    98      * @param aMailBoxId defines id of the mailbox to be removed
    98      * @param aMailBoxId defines id of the mailbox to be removed
    99      */
    99      */
   100 	 virtual void DeleteMailBoxByUidL(const TFSMailMsgId& aMailBoxId) = 0;
   100 	 virtual void DeleteMailBoxByUidL(const TFSMailMsgId& aMailBoxId) = 0;
   101 
   101 
   115      * @param aMailBoxId defines mailbox id
   115      * @param aMailBoxId defines mailbox id
   116      * @param aMessageIds ids of the messages to be transferred
   116      * @param aMessageIds ids of the messages to be transferred
   117      * @param aSourceFolderId id of the folder where messages are located
   117      * @param aSourceFolderId id of the folder where messages are located
   118      * @param aDestinationFolderId destination folder id
   118      * @param aDestinationFolderId destination folder id
   119      *
   119      *
   120      */    
   120      */
   121      virtual void MoveMessagesL( 	const TFSMailMsgId& aMailBoxId,
   121      virtual void MoveMessagesL( 	const TFSMailMsgId& aMailBoxId,
   122      							 	const RArray<TFSMailMsgId>& aMessageIds, 
   122      							 	const RArray<TFSMailMsgId>& aMessageIds,
   123                                 	const TFSMailMsgId& aSourceFolderId,
   123                                 	const TFSMailMsgId& aSourceFolderId,
   124                                 	const TFSMailMsgId& aDestinationFolderId ) = 0;     
   124                                 	const TFSMailMsgId& aDestinationFolderId ) = 0;
   125     /**
   125     /**
   126      * Copies a messages from one folder to another.
   126      * Copies a messages from one folder to another.
   127      * This function copies a messages to the given folder,
   127      * This function copies a messages to the given folder,
   128      * including the properties, content, and all attachments. 
   128      * including the properties, content, and all attachments.
   129      * (note Only works if the store is in an authenticated state,
   129      * (note Only works if the store is in an authenticated state,
   130      *  otherwise this function leaves with KErrNotReady)
   130      *  otherwise this function leaves with KErrNotReady)
   131      *
   131      *
   132      * @param aMailBoxId defines mailbox id
   132      * @param aMailBoxId defines mailbox id
   133      * @param aMessageIds ids of the messages to be copied
   133      * @param aMessageIds ids of the messages to be copied
   134      * @param aNewMessages ids of the copied messages.
   134      * @param aNewMessages ids of the copied messages.
   135      * @param aSourceFolderId id of the folder where messages are located
   135      * @param aSourceFolderId id of the folder where messages are located
   136      * @param aDestinationFolderId destination folder id
   136      * @param aDestinationFolderId destination folder id
   137      */    
   137      */
   138      virtual void CopyMessagesL( const TFSMailMsgId& aMailBoxId,
   138      virtual void CopyMessagesL( const TFSMailMsgId& aMailBoxId,
   139      							 const RArray<TFSMailMsgId>& aMessageIds,
   139      							 const RArray<TFSMailMsgId>& aMessageIds,
   140      							 RArray<TFSMailMsgId>& aNewMessages,
   140      							 RArray<TFSMailMsgId>& aNewMessages,
   141                                  const TFSMailMsgId& aSourceFolderId,
   141                                  const TFSMailMsgId& aSourceFolderId,
   142                                  const TFSMailMsgId& aDestinationFolderId ) = 0;
   142                                  const TFSMailMsgId& aDestinationFolderId ) = 0;
   148      *  not contain a name at all then a KNullDesC is found in place of
   148      *  not contain a name at all then a KNullDesC is found in place of
   149      *  the name.
   149      *  the name.
   150      *
   150      *
   151      *  The function will leave with KErrNotFound if a mailbox with
   151      *  The function will leave with KErrNotFound if a mailbox with
   152      *  given id is not found.
   152      *  given id is not found.
   153      *        
   153      *
   154      * @param aMailBoxId defines mailbox id
   154      * @param aMailBoxId defines mailbox id
   155      * @return Array of descriptors containing MRUs. Ownership
   155      * @return Array of descriptors containing MRUs. Ownership
   156      *         is transferred. Empty if no entries are found.
   156      *         is transferred. Empty if no entries are found.
   157      */
   157      */
   158      virtual MDesCArray* GetMrusL( const TFSMailMsgId& aMailBoxId ) = 0;
   158      virtual MDesCArray* GetMrusL( const TFSMailMsgId& aMailBoxId ) = 0;
   167      *  not contain a name at all then a KNullDesC is found in place of
   167      *  not contain a name at all then a KNullDesC is found in place of
   168      *  the name.
   168      *  the name.
   169      *
   169      *
   170      *  The function will leave with KErrNotFound if a mailbox with
   170      *  The function will leave with KErrNotFound if a mailbox with
   171      *  given id is not found.
   171      *  given id is not found.
   172      *        
   172      *
   173      * @param aMailBoxId defines mailbox id
   173      * @param aMailBoxId defines mailbox id
   174      * @param aNewMruList Array of descriptors containing MRUs. Empty if no entries are found.
   174      * @param aNewMruList Array of descriptors containing MRUs. Empty if no entries are found.
   175      */    
   175      */
   176      virtual void SetMrusL( const TFSMailMsgId& aMailBoxId,
   176      virtual void SetMrusL( const TFSMailMsgId& aMailBoxId,
   177      						MDesCArray* aNewMruList ) = 0;
   177      						MDesCArray* aNewMruList ) = 0;
   178 
   178 
   179 	// MAILBOX SYNC
   179 	// MAILBOX SYNC
   180     /**
   180     /**
   181      * DEPRECATED
   181      * DEPRECATED
   182      * 
   182      *
   183 	 */
   183 	 */
   184      virtual void GoOnlineL( ) = 0;
   184      virtual void GoOnlineL( ) = 0;
   185 
   185 
   186     /**
   186     /**
   187      * DEPRECATED
   187      * DEPRECATED
   188      * 
   188      *
   189 	 */
   189 	 */
   190      virtual void GoOfflineL( ) = 0;
   190      virtual void GoOfflineL( ) = 0;
   191 
   191 
   192     /**
   192     /**
   193      * DEPRECATED
   193      * DEPRECATED
   194      * 
   194      *
   195 	 */
   195 	 */
   196      virtual  TFSProgress GetLastSyncStatusL( ) = 0;
   196      virtual  TFSProgress GetLastSyncStatusL( ) = 0;
   197 
   197 
   198     /**
   198     /**
   199      * DEPRECATED
   199      * DEPRECATED
   200      *
   200      *
   201 	 */	 
   201 	 */
   202      virtual TInt RefreshNowL( ) = 0;
   202      virtual TInt RefreshNowL( ) = 0;
   203      
   203 
   204     /**
   204     /**
   205      * Enables synchronization of identified mailbox. This means
   205      * Enables synchronization of identified mailbox. This means
   206      * that the plugin can connect toserver to do synchronization
   206      * that the plugin can connect toserver to do synchronization
   207      * of the mailbox when necessary or stay connected all the time.
   207      * of the mailbox when necessary or stay connected all the time.
   208      * The actual functionality depends on user settings and plugin
   208      * The actual functionality depends on user settings and plugin
   218      * Connection is set offline normally by using specific function
   218      * Connection is set offline normally by using specific function
   219      * for this purpose. There are also other reasons for ending up
   219      * for this purpose. There are also other reasons for ending up
   220      * in offline state like network error or scheduling.
   220      * in offline state like network error or scheduling.
   221      *
   221      *
   222      * @param aMailBoxId defines mailbox
   222      * @param aMailBoxId defines mailbox
   223      * 
   223      *
   224 	 */
   224 	 */
   225      virtual void GoOnlineL( const TFSMailMsgId& aMailBoxId ) = 0;
   225      virtual void GoOnlineL( const TFSMailMsgId& aMailBoxId ) = 0;
   226 
   226 
   227     /**
   227     /**
   228      * Disables mailbox synchronization. Connection by the plugin
   228      * Disables mailbox synchronization. Connection by the plugin
   231      * If GoOnlineL has effect on other mailboxes of the
   231      * If GoOnlineL has effect on other mailboxes of the
   232      * same plugin then this function has effect on those
   232      * same plugin then this function has effect on those
   233      * mailboxes also.
   233      * mailboxes also.
   234      *
   234      *
   235      * @param aMailBoxId defines mailbox
   235      * @param aMailBoxId defines mailbox
   236      * 
   236      *
   237 	 */
   237 	 */
   238      virtual void GoOfflineL( const TFSMailMsgId& aMailBoxId ) = 0;
   238      virtual void GoOfflineL( const TFSMailMsgId& aMailBoxId ) = 0;
   239 
   239 
   240     /**
   240     /**
   241      * Returns last sync operation status.
   241      * Returns last sync operation status.
   242      *
   242      *
   243      * @param aMailBoxId defines mailbox
   243      * @param aMailBoxId defines mailbox
   244      * @return Last sync operation status
   244      * @return Last sync operation status
   245      * 
   245      *
   246 	 */
   246 	 */
   247      virtual const TFSProgress GetLastSyncStatusL( const TFSMailMsgId& aMailBoxId ) = 0;
   247      virtual const TFSProgress GetLastSyncStatusL( const TFSMailMsgId& aMailBoxId ) = 0;
   248 
   248 
   249     /**
   249     /**
   250      * Forces synchronization of mailbox. This can be called
   250      * Forces synchronization of mailbox. This can be called
   252      * case the mailbox is offline in the beginning, connection
   252      * case the mailbox is offline in the beginning, connection
   253      * is made up for the time of the synchronization.
   253      * is made up for the time of the synchronization.
   254      *
   254      *
   255      * All collections (mail etc.) supported by the plugin and
   255      * All collections (mail etc.) supported by the plugin and
   256      * enabled by user settings are synchronized.
   256      * enabled by user settings are synchronized.
   257      *     
   257      *
   258      * This is an asynchronous operation and the request id
   258      * This is an asynchronous operation and the request id
   259      * is returned for cancelling purpose.
   259      * is returned for cancelling purpose.
   260      * 
   260      *
   261      * Observer is given as a parameter to enable callbacks
   261      * Observer is given as a parameter to enable callbacks
   262      * related to this operation. Alternatively user can use
   262      * related to this operation. Alternatively user can use
   263      * empty implementation of the observer function and rely
   263      * empty implementation of the observer function and rely
   264      * only on events. Notice that the event system is not as
   264      * only on events. Notice that the event system is not as
   265      * comprehensive as the observing way do this.
   265      * comprehensive as the observing way do this.
   271      * @param aRequestId identifies asynchronous request
   271      * @param aRequestId identifies asynchronous request
   272 	 */
   272 	 */
   273      virtual void RefreshNowL(	const TFSMailMsgId& aMailBoxId,
   273      virtual void RefreshNowL(	const TFSMailMsgId& aMailBoxId,
   274          						MFSMailRequestObserver& aOperationObserver,
   274          						MFSMailRequestObserver& aOperationObserver,
   275          						TInt aRequestId ) = 0;
   275          						TInt aRequestId ) = 0;
   276          						
   276 
   277 	// FOLDER HANDLING
   277 	// FOLDER HANDLING
   278     /**
   278     /**
   279      * returns email folder object related to given folder id
   279      * returns email folder object related to given folder id
   280      * folder data set by plugin :
   280      * folder data set by plugin :
   281      *				 - folder id
   281      *				 - folder id
   282      *               - folder name
   282      *               - folder name
   283      *				 - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   283      *				 - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   284      *               - message count
   284      *               - message count
   285      *               - unread message count
   285      *               - unread message count
   286      *               - mailbox id 
   286      *               - mailbox id
   287 	 *				 - parent folder
   287 	 *				 - parent folder
   288      * @param aMailBoxId defines mailbox id
   288      * @param aMailBoxId defines mailbox id
   289      * @param aFolderId defines folder id
   289      * @param aFolderId defines folder id
   290      * @return folder object (CFSMailFolder) to be owned by user
   290      * @return folder object (CFSMailFolder) to be owned by user
   291      */
   291      */
   292 	 virtual CFSMailFolder* GetFolderByUidL( const TFSMailMsgId& aMailBoxId,
   292 	 virtual CFSMailFolder* GetFolderByUidL( const TFSMailMsgId& aMailBoxId,
   293 	 										 const TFSMailMsgId& aFolderId ) = 0;
   293 	 										 const TFSMailMsgId& aFolderId ) = 0;
   294 
   294 
   295     /**
   295     /**
   296      * creates new folder
   296      * creates new folder
   297      * 
   297      *
   298      * @param aMailBoxId defines mailbox where folder is created
   298      * @param aMailBoxId defines mailbox where folder is created
   299      * @param aFolderId defines id of the parent folder
   299      * @param aFolderId defines id of the parent folder
   300      * @param aFolderName defines name of the new folder
   300      * @param aFolderName defines name of the new folder
   301      * @param aSync defines if new folder is local only (false)
   301      * @param aSync defines if new folder is local only (false)
   302      * or if it also should sync to server (true)
   302      * or if it also should sync to server (true)
   316 	 virtual void DeleteFolderByUidL(	const TFSMailMsgId& aMailBoxId,
   316 	 virtual void DeleteFolderByUidL(	const TFSMailMsgId& aMailBoxId,
   317 	 									const TFSMailMsgId& aFolderId) = 0;
   317 	 									const TFSMailMsgId& aFolderId) = 0;
   318 
   318 
   319 	/**
   319 	/**
   320 	 * List subfolders of given folder. Only direct subfolders of given folder are returned.
   320 	 * List subfolders of given folder. Only direct subfolders of given folder are returned.
   321 	 * Folder data : 
   321 	 * Folder data :
   322 	 * - folder id
   322 	 * - folder id
   323 	 * - folder name
   323 	 * - folder name
   324 	 * - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   324 	 * - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   325 	 * - message count
   325 	 * - message count
   326 	 * - unread message count
   326 	 * - unread message count
   327 	 * - mailbox id 
   327 	 * - mailbox id
   328 	 * - parent folder
   328 	 * - parent folder
   329 	 * - subfolder count
   329 	 * - subfolder count
   330 	 *
   330 	 *
   331 	 * @param aMailBoxId defines mailbox where parent folder is
   331 	 * @param aMailBoxId defines mailbox where parent folder is
   332 	 * @param aFolderId defines parent folder id. TFSMailId::NullId() for root level list.
   332 	 * @param aFolderId defines parent folder id. TFSMailId::NullId() for root level list.
   333 	 * @param aFolderList plugin writes results in this array given by user
   333 	 * @param aFolderList plugin writes results in this array given by user
   334 	 */
   334 	 */
   335 	virtual void ListFoldersL(	const TFSMailMsgId& aMailBoxId,
   335 	virtual void ListFoldersL(	const TFSMailMsgId& aMailBoxId,
   336 	    						const TFSMailMsgId& aParentFolderId,
   336 	    						const TFSMailMsgId& aParentFolderId,
   337 	    						RPointerArray<CFSMailFolder>& aFolderList) = 0; 
   337 	    						RPointerArray<CFSMailFolder>& aFolderList) = 0;
   338 
   338 
   339 	/**
   339 	/**
   340 	 * List all subfolders of given mailbox. 
   340 	 * List all subfolders of given mailbox.
   341 	 * folder data : 
   341 	 * folder data :
   342 	 * - folder id
   342 	 * - folder id
   343 	 * - folder name
   343 	 * - folder name
   344 	 * - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   344 	 * - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   345 	 * - message count
   345 	 * - message count
   346 	 * - unread message count
   346 	 * - unread message count
   347 	 * - mailbox id 
   347 	 * - mailbox id
   348 	 * - parent folder
   348 	 * - parent folder
   349 	 * - subfolder count
   349 	 * - subfolder count
   350 	 *
   350 	 *
   351 	 * @param aMailBoxId defines mailbox
   351 	 * @param aMailBoxId defines mailbox
   352 	 * @param aFolderList plugin writes results in this array given by user.
   352 	 * @param aFolderList plugin writes results in this array given by user.
   353 	 * Caller must determine tree structure by examining parent id of each returned folder.
   353 	 * Caller must determine tree structure by examining parent id of each returned folder.
   354 	 */
   354 	 */
   355 	 virtual void ListFoldersL(	const TFSMailMsgId& aMailBoxId,
   355 	 virtual void ListFoldersL(	const TFSMailMsgId& aMailBoxId,
   356 	    						RPointerArray<CFSMailFolder>& aFolderList) = 0; 
   356 	    						RPointerArray<CFSMailFolder>& aFolderList) = 0;
   357     /**
   357     /**
   358      * return folder id of given folder type
   358      * return folder id of given folder type
   359      *
   359      *
   360      * @param aMailBoxId defines mailbox where folder is
   360      * @param aMailBoxId defines mailbox where folder is
   361      * @param aFolderType folder type
   361      * @param aFolderType folder type
   379 
   379 
   380      virtual MFSMailIterator* ListMessagesL( const TFSMailMsgId& aMailBoxId,
   380      virtual MFSMailIterator* ListMessagesL( const TFSMailMsgId& aMailBoxId,
   381         									 const TFSMailMsgId& aFolderId,
   381         									 const TFSMailMsgId& aFolderId,
   382         									 const TFSMailDetails aDetails,
   382         									 const TFSMailDetails aDetails,
   383         									 const RArray<TFSMailSortCriteria>& aSorting ) = 0;
   383         									 const RArray<TFSMailSortCriteria>& aSorting ) = 0;
   384 	
   384 
   385     /**
   385     /**
   386      * returns email message object related to given message id
   386      * returns email message object related to given message id
   387      *
   387      *
   388      * message info set by plugin :
   388      * message info set by plugin :
   389      *				  - message id
   389      *				  - message id
   419      * @param aMessages defines ids of messages to be deleted
   419      * @param aMessages defines ids of messages to be deleted
   420      */
   420      */
   421 	 virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
   421 	 virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
   422 	 									const TFSMailMsgId& aFolderId,
   422 	 									const TFSMailMsgId& aFolderId,
   423 	 									const RArray<TFSMailMsgId>& aMessages ) = 0;
   423 	 									const RArray<TFSMailMsgId>& aMessages ) = 0;
   424 	 
   424 
   425     /**
   425     /**
   426      * creates new message template into drafts folder
   426      * creates new message template into drafts folder
   427      *
   427      *
   428      * @param aMailBoxId defines mailbox where message is created
   428      * @param aMailBoxId defines mailbox where message is created
   429      * @return message object to be modified by user (ownership is transferred to user)
   429      * @return message object to be modified by user (ownership is transferred to user)
   430      */
   430      */
   431 	 virtual CFSMailMessage* CreateMessageToSendL( const TFSMailMsgId& aMailBoxId ) = 0;
   431 	 virtual CFSMailMessage* CreateMessageToSendL( const TFSMailMsgId& aMailBoxId ) = 0;
   432 	 
   432 
   433     /**
   433     /**
   434      * creates new message template to drafts folder to be forwarded
   434      * creates new message template to drafts folder to be forwarded
   435      *
   435      *
   436      * @param aMailBoxId defines mailbox where message is created
   436      * @param aMailBoxId defines mailbox where message is created
   437      * @param aOriginalMessageId defines original message,which is forwarded
   437      * @param aOriginalMessageId defines original message,which is forwarded
   438      * @return message object to be modified by user (ownership is transferred to user)
   438      * @return message object to be modified by user (ownership is transferred to user)
   439      */
   439      */
   440 	 virtual CFSMailMessage* CreateForwardMessageL( const TFSMailMsgId& aMailBoxId,
   440 	 virtual CFSMailMessage* CreateForwardMessageL( const TFSMailMsgId& aMailBoxId,
   441 	 												const TFSMailMsgId& aOriginalMessageId ) = 0;
   441 	 												const TFSMailMsgId& aOriginalMessageId ) = 0;
   442 	 
   442 
   443     /**
   443     /**
   444      * creates new reply message template to drafts folder
   444      * creates new reply message template to drafts folder
   445      * @param aMailBoxId defines mailbox where message is created
   445      * @param aMailBoxId defines mailbox where message is created
   446      * @param aOriginalMessageId defines id of original message,which is replied to
   446      * @param aOriginalMessageId defines id of original message,which is replied to
   447      * @param aReplyToAll
   447      * @param aReplyToAll
   448      * @return message object to be modified by user (ownership is transferred to user)
   448      * @return message object to be modified by user (ownership is transferred to user)
   449      */
   449      */
   450 	 virtual CFSMailMessage* CreateReplyMessageL( const TFSMailMsgId& aMailBoxId,
   450 	 virtual CFSMailMessage* CreateReplyMessageL( const TFSMailMsgId& aMailBoxId,
   451 	 											  const TFSMailMsgId& aOriginalMessageId,
   451 	 											  const TFSMailMsgId& aOriginalMessageId,
   452 	 											  const TBool aReplyToAll ) = 0;
   452 	 											  const TBool aReplyToAll ) = 0;
   453 	 
   453 
   454     /**
   454     /**
   455      * stores message data to message store after modifications (commit)
   455      * stores message data to message store after modifications (commit)
   456      *
   456      *
   457      * @param aMailBoxId defines mailbox where message is stored
   457      * @param aMailBoxId defines mailbox where message is stored
   458      * @param aMessage message data to be stored by plugin
   458      * @param aMessage message data to be stored by plugin
   484      							 	const TFSMailMsgId& aParentFolderId,
   484      							 	const TFSMailMsgId& aParentFolderId,
   485      							 	const RArray<TFSMailMsgId>& aMessageIds,
   485      							 	const RArray<TFSMailMsgId>& aMessageIds,
   486      							 	TFSMailDetails aDetails,
   486      							 	TFSMailDetails aDetails,
   487      							 	MFSMailRequestObserver& aObserver,
   487      							 	MFSMailRequestObserver& aObserver,
   488      							 	TInt aRequestId) = 0;
   488      							 	TInt aRequestId) = 0;
   489      							 	
   489 
   490     /**
   490     /**
   491      * DEPRECATED
   491      * DEPRECATED
   492      * Fetches message part contents from server asynchronously.
   492      * Fetches message part contents from server asynchronously.
   493      *
   493      *
   494      * @param aMessagePartIds define message part ids of message parts that are asked to be fetched
   494      * @param aMessagePartIds define message part ids of message parts that are asked to be fetched
   512      */
   512      */
   513      virtual void FetchMessagePartsL( 	const RArray<TFSMailMsgId>& aMessagePartIds,
   513      virtual void FetchMessagePartsL( 	const RArray<TFSMailMsgId>& aMessagePartIds,
   514         								MFSMailRequestObserver& aOperationObserver,
   514         								MFSMailRequestObserver& aOperationObserver,
   515 										const TInt aRequestId,
   515 										const TInt aRequestId,
   516         								const TUint aPreferredByteCount) = 0;
   516         								const TUint aPreferredByteCount) = 0;
   517         								
   517 
   518 
   518 
   519     /* synchronous message accessor
   519     /* synchronous message accessor
   520 	 *
   520 	 *
   521      * @param aMailBoxId defines mailbox where message is located
   521      * @param aMailBoxId defines mailbox where message is located
   522      * @param aParentFolderId defines parent folder where message is located
   522      * @param aParentFolderId defines parent folder where message is located
   536      virtual void GetMessagesL(	const TFSMailMsgId& aMailBoxId,
   536      virtual void GetMessagesL(	const TFSMailMsgId& aMailBoxId,
   537      							const TFSMailMsgId& aParentFolderId,
   537      							const TFSMailMsgId& aParentFolderId,
   538      							const RArray<TFSMailMsgId>& aMessageIds,
   538      							const RArray<TFSMailMsgId>& aMessageIds,
   539      							RPointerArray<CFSMailMessage>& aMessageList,
   539      							RPointerArray<CFSMailMessage>& aMessageList,
   540      							const TFSMailDetails aDetails ) = 0;
   540      							const TFSMailDetails aDetails ) = 0;
   541      							
   541 
   542     /**
   542     /**
   543      * Returns child part objects for given message part. Ownership of objects
   543      * Returns child part objects for given message part. Ownership of objects
   544      * is transferred to caller.
   544      * is transferred to caller.
   545      *
   545      *
   546      * @param aMailBoxId defines mailbox where message is located
   546      * @param aMailBoxId defines mailbox where message is located
   556      						 	RPointerArray<CFSMailMessagePart>& aParts) = 0;
   556      						 	RPointerArray<CFSMailMessagePart>& aParts) = 0;
   557 
   557 
   558     /**
   558     /**
   559      * Creates and adds a new child part to this part.
   559      * Creates and adds a new child part to this part.
   560      * If aInsertBefore is NULL id then new part is added as last.
   560      * If aInsertBefore is NULL id then new part is added as last.
   561      * 
   561      *
   562      * @param aMailBoxId defines mailbox where message is located
   562      * @param aMailBoxId defines mailbox where message is located
   563      * @param aParentFolderId defines parent folder where message is located
   563      * @param aParentFolderId defines parent folder where message is located
   564      * @param aMessageId gives the id of the message that message part belongs to
   564      * @param aMessageId gives the id of the message that message part belongs to
   565      * @param aParentPartId parent of the new part
   565      * @param aParentPartId parent of the new part
   566      * @param aInsertBefore id of existing part that new part should precede.
   566      * @param aInsertBefore id of existing part that new part should precede.
   567      * If NULL id then new part is added as last.
   567      * If NULL id then new part is added as last.
   568      */        
   568      */
   569      virtual CFSMailMessagePart* NewChildPartL( const TFSMailMsgId& aMailBoxId,
   569      virtual CFSMailMessagePart* NewChildPartL( const TFSMailMsgId& aMailBoxId,
   570 				     							const TFSMailMsgId& aParentFolderId,
   570 				     							const TFSMailMsgId& aParentFolderId,
   571 												const TFSMailMsgId& aMessageId,
   571 												const TFSMailMsgId& aMessageId,
   572      											const TFSMailMsgId& aParentPartId,
   572      											const TFSMailMsgId& aParentPartId,
   573         										const TFSMailMsgId& aInsertBefore,
   573         										const TFSMailMsgId& aInsertBefore,
   574 												const TDesC& aContentType) = 0;
   574 												const TDesC& aContentType) = 0;
   575 
   575 
   576     /**
   576     /**
   577      * Copies given message as new child part to this part.
   577      * Copies given message as new child part to this part.
   578      * 
   578      *
   579      * @param aMailBoxId defines mailbox where message is located
   579      * @param aMailBoxId defines mailbox where message is located
   580      * @param aParentFolderId defines parent folder where message is located
   580      * @param aParentFolderId defines parent folder where message is located
   581      * @param aMessageId gives the id of the message that message part belongs to
   581      * @param aMessageId gives the id of the message that message part belongs to
   582      * @param aParentPartId parent of the new part
   582      * @param aParentPartId parent of the new part
   583      * @param aInsertBefore id of existing part that new part should precede.
   583      * @param aInsertBefore id of existing part that new part should precede.
   584      * If NULL id then new part is added as last.
   584      * If NULL id then new part is added as last.
   585      * @param aMessage specifies the message that is copied
   585      * @param aMessage specifies the message that is copied
   586      */        
   586      */
   587      virtual CFSMailMessagePart* CopyMessageAsChildPartL(const TFSMailMsgId& aMailBoxId,
   587      virtual CFSMailMessagePart* CopyMessageAsChildPartL(const TFSMailMsgId& aMailBoxId,
   588 						     							 const TFSMailMsgId& aParentFolderId,
   588 						     							 const TFSMailMsgId& aParentFolderId,
   589 														 const TFSMailMsgId& aMessageId,
   589 														 const TFSMailMsgId& aMessageId,
   590         												 const TFSMailMsgId& aParentPartId,
   590         												 const TFSMailMsgId& aParentPartId,
   591         												 const TFSMailMsgId& aInsertBefore,
   591         												 const TFSMailMsgId& aInsertBefore,
   592         												 const CFSMailMessage& aMessage) = 0;
   592         												 const CFSMailMessage& aMessage) = 0;
   593 
   593 
   594     /**
   594     /**
   595      * Removes child part (and its children, if any) from this part
   595      * Removes child part (and its children, if any) from this part
   596      * 
   596      *
   597      * @param aMailBoxId defines mailbox where message is located
   597      * @param aMailBoxId defines mailbox where message is located
   598      * @param aParentFolderId defines parent folder where message is located
   598      * @param aParentFolderId defines parent folder where message is located
   599      * @param aMessageId gives the id of the message that message part belongs to
   599      * @param aMessageId gives the id of the message that message part belongs to
   600      * @param aParentPartId parent of the part
   600      * @param aParentPartId parent of the part
   601      * @param aPartId part to remove
   601      * @param aPartId part to remove
   602      */        
   602      */
   603      virtual void RemoveChildPartL(	const TFSMailMsgId& aMailBoxId,
   603      virtual void RemoveChildPartL(	const TFSMailMsgId& aMailBoxId,
   604 	     							const TFSMailMsgId& aParentFolderId,
   604 	     							const TFSMailMsgId& aParentFolderId,
   605 								 	const TFSMailMsgId& aMessageId,
   605 								 	const TFSMailMsgId& aMessageId,
   606         							const TFSMailMsgId& aParentPartId,
   606         							const TFSMailMsgId& aParentPartId,
   607         							const TFSMailMsgId& aPartId) = 0;
   607         							const TFSMailMsgId& aPartId) = 0;
   639      									const TFSMailMsgId& aMessagePartId,
   639      									const TFSMailMsgId& aMessagePartId,
   640      									RFile& aFileHandle) = 0;
   640      									RFile& aFileHandle) = 0;
   641 
   641 
   642     /**
   642     /**
   643      * copies message part to given location
   643      * copies message part to given location
   644      * 
   644      *
   645      *
   645      *
   646      * @param aMailBoxId defines mailbox where message is located
   646      * @param aMailBoxId defines mailbox where message is located
   647      * @param aParentFolderId defines parent folder where message is located
   647      * @param aParentFolderId defines parent folder where message is located
   648      * @param aMessageId gives the id of the message that message part belongs to
   648      * @param aMessageId gives the id of the message that message part belongs to
   649      * @param aMessagePartId gives the id of the message part
   649      * @param aMessagePartId gives the id of the message part
   656      									const TDesC& aFilePath) = 0;
   656      									const TDesC& aFilePath) = 0;
   657 
   657 
   658 
   658 
   659     /**
   659     /**
   660      * gets message part content to given buffer
   660      * gets message part content to given buffer
   661      * 
   661      *
   662      *
   662      *
   663      * @param aMailBoxId defines mailbox where message is located
   663      * @param aMailBoxId defines mailbox where message is located
   664      * @param aParentFolderId defines parent folder where message is located
   664      * @param aParentFolderId defines parent folder where message is located
   665      * @param aMessageId gives the id of the message that message part belongs to
   665      * @param aMessageId gives the id of the message that message part belongs to
   666      * @param aMessagePartId gives the id of the message part
   666      * @param aMessagePartId gives the id of the message part
   667      * @param aBuffer 
   667      * @param aBuffer
   668      * @param aStartOffset 
   668      * @param aStartOffset
   669      */
   669      */
   670 	 virtual void GetContentToBufferL(	const TFSMailMsgId& aMailBoxId,
   670 	 virtual void GetContentToBufferL(	const TFSMailMsgId& aMailBoxId,
   671 	 	     							const TFSMailMsgId& aParentFolderId,
   671 	 	     							const TFSMailMsgId& aParentFolderId,
   672 								 		const TFSMailMsgId& aMessageId,
   672 								 		const TFSMailMsgId& aMessageId,
   673 	 							 		const TFSMailMsgId& aMessagePartId,
   673 	 							 		const TFSMailMsgId& aMessagePartId,
   674 	 							 		TDes& aBuffer,
   674 	 							 		TDes& aBuffer,
   675 	 							 		const TUint aStartOffset) = 0;
   675 	 							 		const TUint aStartOffset) = 0;
   676 	 							 
   676 
   677     /**
   677     /**
   678      * stores message part content
   678      * stores message part content
   679      * 
   679      *
   680      *
   680      *
   681      * @param aBuffer message part content
   681      * @param aBuffer message part content
   682      * @param aMailBoxId defines mailbox where message is located
   682      * @param aMailBoxId defines mailbox where message is located
   683      * @param aParentFolderId defines parent folder where message is located
   683      * @param aParentFolderId defines parent folder where message is located
   684      * @param aMessageId gives the id of the message that message part belongs to
   684      * @param aMessageId gives the id of the message that message part belongs to
   686      */
   686      */
   687 	 virtual void SetContentL(	const TDesC& aBuffer,
   687 	 virtual void SetContentL(	const TDesC& aBuffer,
   688 	 						  	const TFSMailMsgId& aMailBoxId,
   688 	 						  	const TFSMailMsgId& aMailBoxId,
   689      							const TFSMailMsgId& aParentFolderId,
   689      							const TFSMailMsgId& aParentFolderId,
   690 								const TFSMailMsgId& aMessageId,
   690 								const TFSMailMsgId& aMessageId,
   691 	 							const TFSMailMsgId& aMessagePartId) = 0; 
   691 	 							const TFSMailMsgId& aMessagePartId) = 0;
   692 	 
   692 
   693     /**
   693     /**
   694      * Removes fetched contents of these parts.
   694      * Removes fetched contents of these parts.
   695      *
   695      *
   696      * @param aMailBoxId defines mailbox where message is located
   696      * @param aMailBoxId defines mailbox where message is located
   697      * @param aParentFolderId defines parent folder where message is located
   697      * @param aParentFolderId defines parent folder where message is located
   698      * @param aMessageId gives the id of the message that message part belongs to
   698      * @param aMessageId gives the id of the message that message part belongs to
   699      * @param aPartIds Array of message part ids.
   699      * @param aPartIds Array of message part ids.
   700      */  
   700      */
   701      virtual void RemovePartContentL( 	const TFSMailMsgId& aMailBoxId,
   701      virtual void RemovePartContentL( 	const TFSMailMsgId& aMailBoxId,
   702      	     							const TFSMailMsgId& aParentFolderId,
   702      	     							const TFSMailMsgId& aParentFolderId,
   703 									  	const TFSMailMsgId& aMessageId,
   703 									  	const TFSMailMsgId& aMessageId,
   704      								  	const RArray<TFSMailMsgId>& aPartIds) = 0;
   704      								  	const RArray<TFSMailMsgId>& aPartIds) = 0;
   705      							
   705 
   706     /**
   706     /**
   707      * Sets contents from given file. Possible old contents are replaced.
   707      * Sets contents from given file. Possible old contents are replaced.
   708      * 
   708      *
   709      *
   709      *
   710      * @param aMailBoxId defines mailbox where message is located
   710      * @param aMailBoxId defines mailbox where message is located
   711      * @param aParentFolderId defines parent folder where message is located
   711      * @param aParentFolderId defines parent folder where message is located
   712      * @param aMessageId gives the id of the message that message part belongs to
   712      * @param aMessageId gives the id of the message that message part belongs to
   713      * @param aMessagePartId gives the id of the message part
   713      * @param aMessagePartId gives the id of the message part
   730    	     							 const TFSMailMsgId& aParentFolderId,
   730    	     							 const TFSMailMsgId& aParentFolderId,
   731 									 const TFSMailMsgId& aMessageId,
   731 									 const TFSMailMsgId& aMessageId,
   732          							 CFSMailMessagePart& aMessagePart) = 0;
   732          							 CFSMailMessagePart& aMessagePart) = 0;
   733 
   733 
   734     /**
   734     /**
   735      * unregisters plugin request observer to cancel pending events  
   735      * unregisters plugin request observer to cancel pending events
   736      *
   736      *
   737      * @param aRequestId request id of the pending asynchronous request
   737      * @param aRequestId request id of the pending asynchronous request
   738      */
   738      */
   739 	 virtual void UnregisterRequestObserver(TInt aRequestId) = 0;
   739 	 virtual void UnregisterRequestObserver(TInt aRequestId) = 0;
   740 
   740 
   741     // MESSAGE SENDING 
   741     // MESSAGE SENDING
   742     /**
   742     /**
   743      * DEPRECATED
   743      * DEPRECATED
   744      *
   744      *
   745      * starts message sending done by plugin
   745      * starts message sending done by plugin
   746      * cancellation is deleting the message from outbox 
   746      * cancellation is deleting the message from outbox
   747      *
   747      *
   748      * @param aMessageId defines message id to be sent
   748      * @param aMessageId defines message id to be sent
   749      */
   749      */
   750      virtual void SendL( TFSMailMsgId aMessageId ) = 0;
   750      virtual void SendL( TFSMailMsgId aMessageId ) = 0;
   751 
   751 
   752     /**
   752     /**
   753      * starts message sending done by plugin
   753      * starts message sending done by plugin
   754      * cancellation is deleting the message from outbox 
   754      * cancellation is deleting the message from outbox
   755      *
   755      *
   756      * @param aMessage message to be sent
   756      * @param aMessage message to be sent
   757      */
   757      */
   758      virtual void SendMessageL( CFSMailMessage& aMessage ) = 0;
   758      virtual void SendMessageL( CFSMailMessage& aMessage ) = 0;
   759 
   759 
   768     /**
   768     /**
   769      * method for canceling pending request
   769      * method for canceling pending request
   770      * @param aRequestId identifies request if parallel requests exists
   770      * @param aRequestId identifies request if parallel requests exists
   771 	 */
   771 	 */
   772      virtual void CancelL( const TInt aRequestId ) = 0;
   772      virtual void CancelL( const TInt aRequestId ) = 0;
   773      
   773 
   774 	// Search API
   774 	// Search API
   775  	// OPEN: IDS plugin nippets?
   775  	// OPEN: IDS plugin nippets?
   776 	
   776 
   777     /**
   777     /**
   778      * Asyncronous call for starting search for given string. Only one search can be
   778      * Asyncronous call for starting search for given string. Only one search can be
   779      * performed at a time.
   779      * performed at a time.
   780      *
   780      *
   781      *
   781      *
   782      * This function will search for message's containing the given search string.
   782      * This function will search for message's containing the given search string.
   783      * The search will be performed on the all message fields: To, Cc, Bcc, subject, body.
   783      * The search will be performed on the all message fields: To, Cc, Bcc, subject, body.
   784      * The search client will be notified of each found message,
   784      * The search client will be notified of each found message,
   785      * and upon completion of the search.  Only one search can be performed at a time.  
   785      * and upon completion of the search.  Only one search can be performed at a time.
   786      *  
   786      *
   787      * To change the sort order in the search result, use the same search string in the
   787      * To change the sort order in the search result, use the same search string in the
   788      * but change the aSortCriteria parameter.  The store "caches" the search
   788      * but change the aSortCriteria parameter.  The store "caches" the search
   789      * results generated by the same search string.
   789      * results generated by the same search string.
   790      *    
   790      *
   791      * The function will leave with KErrInUse if a search is already in progress.
   791      * The function will leave with KErrInUse if a search is already in progress.
   792 	 *
   792 	 *
   793      * /note Only works if the store is in an authenticated state,
   793      * /note Only works if the store is in an authenticated state,
   794      *  otherwise this function leaves with KErrNotReady
   794      *  otherwise this function leaves with KErrNotReady
   795      *
   795      *
   797      * @param aFolderIds list of folders where messages are to be searched
   797      * @param aFolderIds list of folders where messages are to be searched
   798      * @param aSearchStrings text strings that will be searched from different message fields.
   798      * @param aSearchStrings text strings that will be searched from different message fields.
   799 	 * @param aSortCriteria sort criteria for the results
   799 	 * @param aSortCriteria sort criteria for the results
   800      * @param aSearchObserver client observer that will be notified about search status.
   800      * @param aSearchObserver client observer that will be notified about search status.
   801      *
   801      *
   802      */    
   802      */
   803 	virtual void SearchL( const TFSMailMsgId& aMailBoxId,
   803 	virtual void SearchL( const TFSMailMsgId& aMailBoxId,
   804 						  const RArray<TFSMailMsgId>& aFolderIds,
   804 						  const RArray<TFSMailMsgId>& aFolderIds,
   805 						  const RPointerArray<TDesC>& aSearchStrings,
   805 						  const RPointerArray<TDesC>& aSearchStrings,
   806 						  const TFSMailSortCriteria& aSortCriteria,
   806 						  const TFSMailSortCriteria& aSortCriteria,
   807 					      MFSMailBoxSearchObserver& aSearchObserver ) = 0;
   807 					      MFSMailBoxSearchObserver& aSearchObserver ) = 0;
   808 	
   808 
   809 
   809 
   810     /**
   810     /**
   811      * Cancels current search. Does nothing if there is not any search.
   811      * Cancels current search. Does nothing if there is not any search.
   812      * The search client will not be called back after this function is called.
   812      * The search client will not be called back after this function is called.
   813 	 *
   813 	 *
   814      * \note CancelSearch() method does NOT clear the search result cached in the store. 
   814      * \note CancelSearch() method does NOT clear the search result cached in the store.
   815      *       A different sort order can be used for the same search string, and the 
   815      *       A different sort order can be used for the same search string, and the
   816      *       cache will be utilized.  Only by using a different search string can the
   816      *       cache will be utilized.  Only by using a different search string can the
   817      *       cache be cleaned.
   817      *       cache be cleaned.
   818 	 *
   818 	 *
   819      * @paran aMailBoxId mailbox where the search should be cancelled
   819      * @paran aMailBoxId mailbox where the search should be cancelled
   820 	 *
   820 	 *
   821      */    
   821      */
   822 	virtual void CancelSearch( const TFSMailMsgId& aMailBoxId ) = 0;
   822 	virtual void CancelSearch( const TFSMailMsgId& aMailBoxId ) = 0;
   823 
   823 
   824     /** Inform the store to clean up its cache for search results.
   824     /** Inform the store to clean up its cache for search results.
   825      *        
   825      *
   826      *  This method cancels the the ongoing search (if exists), and then clean ups store's cache.
   826      *  This method cancels the the ongoing search (if exists), and then clean ups store's cache.
   827      * 
   827      *
   828      *  This function should be called when search results are no longer in display.
   828      *  This function should be called when search results are no longer in display.
   829 	 *
   829 	 *
   830      * @paran aMailBoxId mailbox where the search cache should be cleared
   830      * @paran aMailBoxId mailbox where the search cache should be cleared
   831 	 *
   831 	 *
   832     */
   832     */
   869     /**
   869     /**
   870      * Returns the current sync state for this mailbox.
   870      * Returns the current sync state for this mailbox.
   871      *
   871      *
   872      * @param aMailboxId id of target mailbox
   872      * @param aMailboxId id of target mailbox
   873      */
   873      */
   874     virtual const TSSMailSyncState CurrentSyncState(const TFSMailMsgId& aMailboxId) = 0;
   874     virtual TSSMailSyncState CurrentSyncState(const TFSMailMsgId& aMailboxId) = 0;
   875 
   875 
   876     /**
   876     /**
   877      * Sets the mailbox name for this mailbox.
   877      * Sets the mailbox name for this mailbox.
   878      *
   878      *
   879      * @param aMailboxId id of target mailbox
   879      * @param aMailboxId id of target mailbox
   880      * @param aMailboxName new name for the mailbox
   880      * @param aMailboxName new name for the mailbox
   881      */
   881      */
   882     virtual void SetMailboxName(const TFSMailMsgId& aMailboxId, const TDesC& aMailboxName );
   882     virtual void SetMailboxName(const TFSMailMsgId& aMailboxId, const TDesC& aMailboxName );
   883     
   883 
   884   	};
   884   	};
   885 
   885 
   886 
   886 
   887 #endif  // M_FSMAILPLUGIN_H
   887 #endif  // M_FSMAILPLUGIN_H
   888 
   888