emailservices/emailframework/inc/CFSMailPlugin.h
changeset 4 e7aa27f58ae1
parent 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
3:a4d6f1ea0416 4:e7aa27f58ae1
    18 #ifndef CFSFWMAILPLUGIN_H
    18 #ifndef CFSFWMAILPLUGIN_H
    19 #define CFSFWMAILPLUGIN_H
    19 #define CFSFWMAILPLUGIN_H
    20 
    20 
    21 #include <ecom/ecom.h>
    21 #include <ecom/ecom.h>
    22 
    22 
    23 #include "mfsmailrequestobserver.h"
    23 #include "MFSMailRequestObserver.h"
    24 #include "mfsmaileventobserver.h"
    24 #include "mfsmaileventobserver.h"
    25 #include "cfsmailbox.h"
    25 #include "cfsmailbox.h"
    26 #include "cfsmailplugin.hrh"
    26 #include "cfsmailplugin.hrh"
    27 #include "cemailextensionbase.h"
    27 #include "cemailextensionbase.h"
    28 // constants
    28 // constants
    67      *
    67      *
    68      * @param aInfo plugin implementation info
    68      * @param aInfo plugin implementation info
    69      */
    69      */
    70      static void ListImplementationsL( RPointerArray<CImplementationInformation>& aInfo );
    70      static void ListImplementationsL( RPointerArray<CImplementationInformation>& aInfo );
    71 
    71 
    72 	/** MAILBOX HANDLING API */
    72     /** MAILBOX HANDLING API */
    73 
    73 
    74     /**
    74     /**
    75      * Enables synchronization of identified mailbox. This means
    75      * Enables synchronization of identified mailbox. This means
    76      * that the plugin can connect to server to do synchronization
    76      * that the plugin can connect to server to do synchronization
    77      * of the mailbox when necessary or stay connected all the time.
    77      * of the mailbox when necessary or stay connected all the time.
    88      * Connection is set offline normally by using specific function
    88      * Connection is set offline normally by using specific function
    89      * for this purpose. There are also other reasons for ending up
    89      * for this purpose. There are also other reasons for ending up
    90      * in offline state like network error or scheduling.
    90      * in offline state like network error or scheduling.
    91      *
    91      *
    92      * @param aMailBoxId mailbox id request is accessed to
    92      * @param aMailBoxId mailbox id request is accessed to
    93 	 */
    93      */
    94      virtual void GoOnlineL( const TFSMailMsgId& aMailBoxId ) = 0;
    94      virtual void GoOnlineL( const TFSMailMsgId& aMailBoxId ) = 0;
    95 
    95 
    96     /**
    96     /**
    97      * Disables mailbox synchronization. Connection by the plugin
    97      * Disables mailbox synchronization. Connection by the plugin
    98      * to synchronize identified mailbox is not allowed after this.
    98      * to synchronize identified mailbox is not allowed after this.
   100      * If GoOnlineL has effect on other mailboxes of the
   100      * If GoOnlineL has effect on other mailboxes of the
   101      * same plugin then this function has effect on those
   101      * same plugin then this function has effect on those
   102      * mailboxes also.
   102      * mailboxes also.
   103      *
   103      *
   104      * @param aMailBoxId mailbox id request is accessed to
   104      * @param aMailBoxId mailbox id request is accessed to
   105 	 */
   105      */
   106      virtual void GoOfflineL( const TFSMailMsgId& aMailBoxId ) = 0;
   106      virtual void GoOfflineL( const TFSMailMsgId& aMailBoxId ) = 0;
   107 
   107 
   108     /**
   108     /**
   109      * Forces synchronization of mailbox. This can be called
   109      * Forces synchronization of mailbox. This can be called
   110      * whether the mailbox is currently offline or online. In
   110      * whether the mailbox is currently offline or online. In
   126      * @param aMailBoxId defines mailbox
   126      * @param aMailBoxId defines mailbox
   127      * @param aOperationObserver is client provided observer that
   127      * @param aOperationObserver is client provided observer that
   128      *        will receive progress notifications during the operation.
   128      *        will receive progress notifications during the operation.
   129      * @param aRequestId identifies asynchronous request if parallel
   129      * @param aRequestId identifies asynchronous request if parallel
   130      * requests exist
   130      * requests exist
   131 	 */
   131      */
   132      virtual void RefreshNowL( const TFSMailMsgId& aMailBoxId,
   132      virtual void RefreshNowL( const TFSMailMsgId& aMailBoxId,
   133                                MFSMailRequestObserver& aOperationObserver,
   133                                MFSMailRequestObserver& aOperationObserver,
   134                                TInt aRequestId ) = 0;
   134                                TInt aRequestId ) = 0;
   135 
   135 
   136     /**
   136     /**
   175      * @param aCapability capability to be checked
   175      * @param aCapability capability to be checked
   176      * @param aMailBoxId id of the target mailbox
   176      * @param aMailBoxId id of the target mailbox
   177      *
   177      *
   178      * @return true/false
   178      * @return true/false
   179      */
   179      */
   180      virtual TBool MailboxHasCapabilityL( 	TFSMailBoxCapabilities aCapability,
   180      virtual TBool MailboxHasCapabilityL(   TFSMailBoxCapabilities aCapability,
   181 	 										TFSMailMsgId aMailBoxId ) = 0;
   181                                             TFSMailMsgId aMailBoxId ) = 0;
   182 
   182 
   183     /**
   183     /**
   184      * lists existing mailboxes contained by plugin
   184      * lists existing mailboxes contained by plugin
   185      *
   185      *
   186      * @param aMailBoxes plugin writes list of existing mailboxes into this
   186      * @param aMailBoxes plugin writes list of existing mailboxes into this
   187      *        table owned by user
   187      *        table owned by user
   188      * to this table owned by framework
   188      * to this table owned by framework
   189      */
   189      */
   190   	 virtual void ListMailBoxesL( RArray<TFSMailMsgId>& aMailboxes) = 0;
   190      virtual void ListMailBoxesL( RArray<TFSMailMsgId>& aMailboxes) = 0;
   191 
   191 
   192     /**
   192     /**
   193      * returns email mailbox object related to given mailbox id
   193      * returns email mailbox object related to given mailbox id
   194      * mailbox data set by plugin :
   194      * mailbox data set by plugin :
   195      *				 - mailbox id
   195      *               - mailbox id
   196      *               - mailbox name
   196      *               - mailbox name
   197      *               - branding id
   197      *               - branding id
   198      *               - mailbox capabilities
   198      *               - mailbox capabilities
   199      *
   199      *
   200      * @param aMailBoxId mailbox id
   200      * @param aMailBoxId mailbox id
   209      * @param aMailBoxId id of the mailbox to be removed
   209      * @param aMailBoxId id of the mailbox to be removed
   210      * @param aOperationObserver is FW provided observer that should be
   210      * @param aOperationObserver is FW provided observer that should be
   211      * used to report progress notifications during the operation.
   211      * used to report progress notifications during the operation.
   212      * @param aRequestId asynchronous request id
   212      * @param aRequestId asynchronous request id
   213      */
   213      */
   214      virtual void DeleteMailBoxByUidL(	const TFSMailMsgId& aMailBoxId,
   214      virtual void DeleteMailBoxByUidL(  const TFSMailMsgId& aMailBoxId,
   215 	                                    MFSMailRequestObserver& aOperationObserver,
   215                                         MFSMailRequestObserver& aOperationObserver,
   216 	                                    const TInt aRequestId ) = 0;
   216                                         const TInt aRequestId ) = 0;
   217 
   217 
   218     /**
   218     /**
   219      * Returns branding id of this mailbox.
   219      * Returns branding id of this mailbox.
   220      * This function is used by Branding Manager to associate mailbox to a branding
   220      * This function is used by Branding Manager to associate mailbox to a branding
   221      * definition. Plugin should return incoming mail server associated with this mailbox.
   221      * definition. Plugin should return incoming mail server associated with this mailbox.
   362      * Empty if no entries are found.
   362      * Empty if no entries are found.
   363      */
   363      */
   364      virtual void SetMrusL( const TFSMailMsgId& aMailBoxId,
   364      virtual void SetMrusL( const TFSMailMsgId& aMailBoxId,
   365                             MDesCArray* aNewMruList ) = 0;
   365                             MDesCArray* aNewMruList ) = 0;
   366 
   366 
   367 	/** FOLDER HANDLING API */
   367     /** FOLDER HANDLING API */
   368     /**
   368     /**
   369      * returns email folder object related to given folder id
   369      * returns email folder object related to given folder id
   370      * folder data set by plugin :
   370      * folder data set by plugin :
   371      *				 - folder id
   371      *               - folder id
   372      *               - folder name
   372      *               - folder name
   373      *				 - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   373      *               - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   374      *               - message count
   374      *               - message count
   375      *               - unread message count
   375      *               - unread message count
   376      *               - mailbox id
   376      *               - mailbox id
   377 	 *				 - parent folder
   377      *               - parent folder
   378 	 *
   378      *
   379      * @param aMailBoxId id of mailbox containing folder
   379      * @param aMailBoxId id of mailbox containing folder
   380      * @param aFolderId folder id
   380      * @param aFolderId folder id
   381      *
   381      *
   382      * @return folder object (CFSMailFolder) to be owned by user
   382      * @return folder object (CFSMailFolder) to be owned by user
   383      */
   383      */
   393      * @param aSync defines if new folder is local only (false)
   393      * @param aSync defines if new folder is local only (false)
   394      * or if it also should sync to server (true)
   394      * or if it also should sync to server (true)
   395      *
   395      *
   396      * @return new folder object CFSMailFolder to be owned by user
   396      * @return new folder object CFSMailFolder to be owned by user
   397      */
   397      */
   398      virtual CFSMailFolder* CreateFolderL( 	const TFSMailMsgId& aMailBoxId,
   398      virtual CFSMailFolder* CreateFolderL(  const TFSMailMsgId& aMailBoxId,
   399                                             const TFSMailMsgId& aParentFolderId,
   399                                             const TFSMailMsgId& aParentFolderId,
   400                                             const TDesC& aFolderName,
   400                                             const TDesC& aFolderName,
   401                                             const TBool aSync ) = 0;
   401                                             const TBool aSync ) = 0;
   402 
   402 
   403     /**
   403     /**
   407      * @param aFolderId defines id of the folder to be deleted
   407      * @param aFolderId defines id of the folder to be deleted
   408      */
   408      */
   409      virtual void DeleteFolderByUidL( const TFSMailMsgId& aMailBoxId,
   409      virtual void DeleteFolderByUidL( const TFSMailMsgId& aMailBoxId,
   410                                       const TFSMailMsgId& aFolderId) = 0;
   410                                       const TFSMailMsgId& aFolderId) = 0;
   411 
   411 
   412 	/**
   412     /**
   413 	 * Lists subfolders of given folder.
   413      * Lists subfolders of given folder.
   414 	 * Only direct subfolders of given folder are returned.
   414      * Only direct subfolders of given folder are returned.
   415 	 * Folder data :
   415      * Folder data :
   416 	 * - folder id
   416      * - folder id
   417 	 * - folder name
   417      * - folder name
   418 	 * - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   418      * - folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other
   419 	 * - message count
   419      * - message count
   420 	 * - unread message count
   420      * - unread message count
   421 	 * - mailbox id
   421      * - mailbox id
   422 	 * - parent folder
   422      * - parent folder
   423 	 * - subfolder count
   423      * - subfolder count
   424 	 *
   424      *
   425 	 * @param aMailBoxId id of the mailbox where parent folder is located
   425      * @param aMailBoxId id of the mailbox where parent folder is located
   426 	 * @param aFolderId parent folder id. TFSMailId::NullId() for root level list.
   426      * @param aFolderId parent folder id. TFSMailId::NullId() for root level list.
   427 	 * @param aFolderList plugin writes results in this array owned by user
   427      * @param aFolderList plugin writes results in this array owned by user
   428 	 */
   428      */
   429 	 virtual void ListFoldersL(	const TFSMailMsgId& aMailBoxId,
   429      virtual void ListFoldersL( const TFSMailMsgId& aMailBoxId,
   430 	                            const TFSMailMsgId& aParentFolderId,
   430                                 const TFSMailMsgId& aParentFolderId,
   431 	                            RPointerArray<CFSMailFolder>& aFolderList) = 0;
   431                                 RPointerArray<CFSMailFolder>& aFolderList) = 0;
   432 
   432 
   433    /**
   433    /**
   434      * List all subfolders of given mailbox.
   434      * List all subfolders of given mailbox.
   435      * folder data :
   435      * folder data :
   436      * - folder id
   436      * - folder id
   442      * - parent folder
   442      * - parent folder
   443      * - subfolder count
   443      * - subfolder count
   444      *
   444      *
   445      * @param aMailBoxId mailbox id
   445      * @param aMailBoxId mailbox id
   446      * @param aFolderList plugin writes results in this array owned by user.
   446      * @param aFolderList plugin writes results in this array owned by user.
   447 	 * Caller must determine tree structure by examining parent id of each
   447      * Caller must determine tree structure by examining parent id of each
   448      * returned folder.
   448      * returned folder.
   449      */
   449      */
   450      virtual void ListFoldersL(	const TFSMailMsgId& aMailBoxId,
   450      virtual void ListFoldersL( const TFSMailMsgId& aMailBoxId,
   451                                 RPointerArray<CFSMailFolder>& aFolderList) = 0;
   451                                 RPointerArray<CFSMailFolder>& aFolderList) = 0;
   452 
   452 
   453     /**
   453     /**
   454      * returns folder id of given standard folder
   454      * returns folder id of given standard folder
   455      *
   455      *
   457      * @param aFolderType folder type
   457      * @param aFolderType folder type
   458      *
   458      *
   459      * return folder id
   459      * return folder id
   460      */
   460      */
   461      virtual TFSMailMsgId GetStandardFolderIdL( const TFSMailMsgId& aMailBoxId,
   461      virtual TFSMailMsgId GetStandardFolderIdL( const TFSMailMsgId& aMailBoxId,
   462 	 											const TFSFolderType aFolderType ) = 0;
   462                                                 const TFSFolderType aFolderType ) = 0;
   463 
   463 
   464 	/** MESSAGE FETCH AND STORE */
   464     /** MESSAGE FETCH AND STORE */
   465     /**
   465     /**
   466      * List messages contained by given folder.
   466      * List messages contained by given folder.
   467      * Returns email list iterator to user.
   467      * Returns email list iterator to user.
   468      *
   468      *
   469      * @param aMailBoxId id of the mailbox where parent folder is located
   469      * @param aMailBoxId id of the mailbox where parent folder is located
   470      * @param aFolderId folder id of given folder
   470      * @param aFolderId folder id of given folder
   471      * @param aDetails defines which message details are included in messages
   471      * @param aDetails defines which message details are included in messages
   472 	 * EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   472      * EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   473 	 * EFSMsgDataDate    -> Get received date only. To be used when showing messages sorted by date.
   473      * EFSMsgDataDate    -> Get received date only. To be used when showing messages sorted by date.
   474      *                      The rest would be retreived when needed but date is needed to build the list.
   474      *                      The rest would be retreived when needed but date is needed to build the list.
   475 	 * EFSMsgDataSubject -> Like above but when sorting by subject
   475      * EFSMsgDataSubject -> Like above but when sorting by subject
   476 	 * EFSMsgDataSender  -> Likewise for sender address.
   476      * EFSMsgDataSender  -> Likewise for sender address.
   477 	 * EFSMsgDataEnvelope, EFSMsgDataStructure -> email content type is returned by plugin
   477      * EFSMsgDataEnvelope, EFSMsgDataStructure -> email content type is returned by plugin
   478      * @param aSorting describes requested sort criteria (owned by user).
   478      * @param aSorting describes requested sort criteria (owned by user).
   479      *        First item in array is primary sort criteria.
   479      *        First item in array is primary sort criteria.
   480      *
   480      *
   481      * @return Email list iterator, ownership is transferred to user.
   481      * @return Email list iterator, ownership is transferred to user.
   482 	 */
   482      */
   483 	 virtual MFSMailIterator* ListMessagesL( const TFSMailMsgId& aMailBoxId,
   483      virtual MFSMailIterator* ListMessagesL( const TFSMailMsgId& aMailBoxId,
   484 	                                         const TFSMailMsgId& aFolderId,
   484                                              const TFSMailMsgId& aFolderId,
   485 	                                         const TFSMailDetails aDetails,
   485                                              const TFSMailDetails aDetails,
   486 	                                         const RArray<TFSMailSortCriteria>& aSorting ) = 0;
   486                                              const RArray<TFSMailSortCriteria>& aSorting ) = 0;
   487 
   487 
   488     /**
   488     /**
   489      * returns email object related to given message id
   489      * returns email object related to given message id
   490      *
   490      *
   491      * message info set by plugin :
   491      * message info set by plugin :
   492      *				  - message id
   492      *                - message id
   493      *                - mailbox
   493      *                - mailbox
   494      *				  - parent folder
   494      *                - parent folder
   495      *                - message size
   495      *                - message size
   496 	 *                - the rest is defined by message attributes ;
   496      *                - the rest is defined by message attributes ;
   497      * @param aMailBoxId id of the mailbox containing email
   497      * @param aMailBoxId id of the mailbox containing email
   498      * @param aFolderId parent folder id containing email
   498      * @param aFolderId parent folder id containing email
   499      * @param aMessageId email message id
   499      * @param aMessageId email message id
   500      *
   500      *
   501      * @param aDetails defines which message parts are included in message
   501      * @param aDetails defines which message parts are included in message
   502 	 * EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   502      * EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   503 	 * EFSMsgDataDate    -> Get received date only. To be used when showing messages sorted by date.
   503      * EFSMsgDataDate    -> Get received date only. To be used when showing messages sorted by date.
   504      *                      The rest would be retreived when needed but date is needed to build the list.
   504      *                      The rest would be retreived when needed but date is needed to build the list.
   505 	 * EFSMsgDataSubject -> Like above but when sorting by subject
   505      * EFSMsgDataSubject -> Like above but when sorting by subject
   506 	 * EFSMsgDataSender  -> Likewise for sender address.
   506      * EFSMsgDataSender  -> Likewise for sender address.
   507 	 * EFSMsgDataEnvelope, EFSMsgDataStructure ->
   507      * EFSMsgDataEnvelope, EFSMsgDataStructure ->
   508 	 * email content type is evaluated and returned by plugin
   508      * email content type is evaluated and returned by plugin
   509      *
   509      *
   510      * @return email object (CFSMailMessage), ownership is transferred to user
   510      * @return email object (CFSMailMessage), ownership is transferred to user
   511      */
   511      */
   512      virtual CFSMailMessage* GetMessageByUidL( 	const TFSMailMsgId& aMailBoxId,
   512      virtual CFSMailMessage* GetMessageByUidL(  const TFSMailMsgId& aMailBoxId,
   513                                                 const TFSMailMsgId& aParentFolderId,
   513                                                 const TFSMailMsgId& aParentFolderId,
   514                                                 const TFSMailMsgId& aMessageId,
   514                                                 const TFSMailMsgId& aMessageId,
   515                                                 const TFSMailDetails aDetails) = 0;
   515                                                 const TFSMailDetails aDetails) = 0;
   516 
   516 
   517     /**
   517     /**
   569      virtual void StoreMessageL( const TFSMailMsgId& aMailBoxId,
   569      virtual void StoreMessageL( const TFSMailMsgId& aMailBoxId,
   570                                  CFSMailMessage& aMessage ) = 0;
   570                                  CFSMailMessage& aMessage ) = 0;
   571 
   571 
   572     /**
   572     /**
   573      * starts email fetching from email server
   573      * starts email fetching from email server
   574 	 *
   574      *
   575      * @param aMailBoxId id of the mailbox where email is located
   575      * @param aMailBoxId id of the mailbox where email is located
   576      * @param aFolderId id of the parent folder containing email
   576      * @param aFolderId id of the parent folder containing email
   577      * @param aMessageIds ids of email to be fetched
   577      * @param aMessageIds ids of email to be fetched
   578      * @param aDetails defines which details are included in email
   578      * @param aDetails defines which details are included in email
   579 	 * EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   579      * EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   580 	 * EFSMsgDataDate    -> Get received date only. To be used when showing messages sorted by date.
   580      * EFSMsgDataDate    -> Get received date only. To be used when showing messages sorted by date.
   581      *                      The rest would be retreived when needed but date is needed to build the list.
   581      *                      The rest would be retreived when needed but date is needed to build the list.
   582 	 * EFSMsgDataSubject -> Like above but when sorting by subject
   582      * EFSMsgDataSubject -> Like above but when sorting by subject
   583 	 * EFSMsgDataSender  -> Likewise for sender address.
   583      * EFSMsgDataSender  -> Likewise for sender address.
   584 	 * EFSMsgDataEnvelope -> Date, subject, Sender, To, Cc at least.
   584      * EFSMsgDataEnvelope -> Date, subject, Sender, To, Cc at least.
   585 	 * EFSMsgDataStructure -> the part structure including mime type, size and name headers.
   585      * EFSMsgDataStructure -> the part structure including mime type, size and name headers.
   586 	 *
   586      *
   587      * @param aObserver observer (callback medhod), which plugin calls to pass progress
   587      * @param aObserver observer (callback medhod), which plugin calls to pass progress
   588      *        events to user (like fetching has completed)
   588      *        events to user (like fetching has completed)
   589      * @param aRequestId asynchronous request id
   589      * @param aRequestId asynchronous request id
   590      */
   590      */
   591      virtual void FetchMessagesL( const TFSMailMsgId& aMailBoxId,
   591      virtual void FetchMessagesL( const TFSMailMsgId& aMailBoxId,
   595                                   MFSMailRequestObserver& aObserver,
   595                                   MFSMailRequestObserver& aObserver,
   596                                   TInt aRequestId) = 0;
   596                                   TInt aRequestId) = 0;
   597 
   597 
   598     /**
   598     /**
   599      * starts email parts fetching from email server
   599      * starts email parts fetching from email server
   600 	 *
   600      *
   601      * @param aMailBoxId id of the mailbox where email is located
   601      * @param aMailBoxId id of the mailbox where email is located
   602      * @param aFolderId id of the parent folder containing email
   602      * @param aFolderId id of the parent folder containing email
   603      * @param aMessagePartIds part ids of email parts, which are to be fetched
   603      * @param aMessagePartIds part ids of email parts, which are to be fetched
   604      * @param aOperationObserver observer that plugin uses to report
   604      * @param aOperationObserver observer that plugin uses to report
   605      *        progress notifications during the operation.
   605      *        progress notifications during the operation.
   617                                       const TInt aRequestId,
   617                                       const TInt aRequestId,
   618                                       const TUint aPreferredByteCount) = 0;
   618                                       const TUint aPreferredByteCount) = 0;
   619 
   619 
   620 
   620 
   621     /* reads email objects from plugin store
   621     /* reads email objects from plugin store
   622 	 *
   622      *
   623      * @param aMailBoxId id of the mailbox where email are located
   623      * @param aMailBoxId id of the mailbox where email are located
   624      * @param aParentFolderId parent folder id containing emails
   624      * @param aParentFolderId parent folder id containing emails
   625      * @param aMessageIds ids of emails to be read from plugin store
   625      * @param aMessageIds ids of emails to be read from plugin store
   626  	 * @param aMessageList plugin writes results into this table owned by user
   626      * @param aMessageList plugin writes results into this table owned by user
   627      * @param aDetails defines which email details are included in each email object
   627      * @param aDetails defines which email details are included in each email object
   628 	 *        EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   628      *        EFSMsgDataIdOnly  -> Doesn't get any data. The object just contains the ID.
   629 	 *        EFSMsgDataDate    -> Get received date only. To be used when showing
   629      *        EFSMsgDataDate    -> Get received date only. To be used when showing
   630 	 *        messages sorted by date. The rest would be retreived when needed but
   630      *        messages sorted by date. The rest would be retreived when needed but
   631 	 *        date is needed to build the list.
   631      *        date is needed to build the list.
   632 	 *        EFSMsgDataSubject -> Like above but when sorting by subject
   632      *        EFSMsgDataSubject -> Like above but when sorting by subject
   633 	 *        EFSMsgDataSender  -> Likewise for sender address.
   633      *        EFSMsgDataSender  -> Likewise for sender address.
   634 	 *        EFSMsgDataEnvelope -> Date, subject, Sender, To, Cc at least.
   634      *        EFSMsgDataEnvelope -> Date, subject, Sender, To, Cc at least.
   635 	 *        EFSMsgDataStructure -> the part structure including mime type,
   635      *        EFSMsgDataStructure -> the part structure including mime type,
   636 	 *        size and name headers.
   636      *        size and name headers.
   637 	 */
   637      */
   638 	 virtual void GetMessagesL(	const TFSMailMsgId& aMailBoxId,
   638      virtual void GetMessagesL( const TFSMailMsgId& aMailBoxId,
   639 	                            const TFSMailMsgId& aParentFolderId,
   639                                 const TFSMailMsgId& aParentFolderId,
   640 	                            const RArray<TFSMailMsgId>& aMessageIds,
   640                                 const RArray<TFSMailMsgId>& aMessageIds,
   641 	                            RPointerArray<CFSMailMessage>& aMessageList,
   641                                 RPointerArray<CFSMailMessage>& aMessageList,
   642 	                            const TFSMailDetails aDetails ) = 0;
   642                                 const TFSMailDetails aDetails ) = 0;
   643 
   643 
   644     /**
   644     /**
   645      * Returns child part objects for given email part. Ownership of objects
   645      * Returns child part objects for given email part. Ownership of objects
   646      * is transferred to user.
   646      * is transferred to user.
   647      *
   647      *
   689      * @param aContentType content type of the new message part
   689      * @param aContentType content type of the new message part
   690      * @param aFilePath file containing new child part contents
   690      * @param aFilePath file containing new child part contents
   691      *
   691      *
   692      * return new child part object, ownership is transferred to user
   692      * return new child part object, ownership is transferred to user
   693      */
   693      */
   694 	 virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId,
   694      virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId,
   695 	                                                    const TFSMailMsgId& aParentFolderId,
   695                                                         const TFSMailMsgId& aParentFolderId,
   696 	                                                    const TFSMailMsgId& aMessageId,
   696                                                         const TFSMailMsgId& aMessageId,
   697 	                                                    const TFSMailMsgId& aParentPartId,
   697                                                         const TFSMailMsgId& aParentPartId,
   698 	                                                    const TDesC& aContentType,
   698                                                         const TDesC& aContentType,
   699 	                                                    const TDesC& aFilePath) = 0;
   699                                                         const TDesC& aFilePath) = 0;
   700 
   700 
   701 
   701 
   702 	 /**
   702      /**
   703 	  * Creates and adds a new child part from file to given email part.
   703       * Creates and adds a new child part from file to given email part.
   704 	  *
   704       *
   705 	  * @param aMailBoxId id of the mailbox where parent part is located
   705       * @param aMailBoxId id of the mailbox where parent part is located
   706 	  * @param aParentFolderId id of the parent folder where email is located
   706       * @param aParentFolderId id of the parent folder where email is located
   707 	  * @param aMessageId id of the email parent part belongs to
   707       * @param aMessageId id of the email parent part belongs to
   708 	  * @param aParentPartId id of the parent part of the new part
   708       * @param aParentPartId id of the parent part of the new part
   709 	  * @param aInsertBefore id of existing part that new part should precede.
   709       * @param aInsertBefore id of existing part that new part should precede.
   710 	  * If aInsertBefore is NULL id then new part is added as last.
   710       * If aInsertBefore is NULL id then new part is added as last.
   711 	  * @param aContentType content type of the new message part
   711       * @param aContentType content type of the new message part
   712 	  * @param aFile access to file containing new child part contents,
   712       * @param aFile access to file containing new child part contents,
   713 	  *  ownership is transferred
   713       *  ownership is transferred
   714 	  *
   714       *
   715 	  * return new child part object, ownership is transferred to user
   715       * return new child part object, ownership is transferred to user
   716 	  */
   716       */
   717 	  virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId,
   717       virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId,
   718 	                                                     const TFSMailMsgId& aParentFolderId,
   718                                                          const TFSMailMsgId& aParentFolderId,
   719 	                                                     const TFSMailMsgId& aMessageId,
   719                                                          const TFSMailMsgId& aMessageId,
   720 	                                                     const TFSMailMsgId& aParentPartId,
   720                                                          const TFSMailMsgId& aParentPartId,
   721 	                                                     const TDesC& aContentType,
   721                                                          const TDesC& aContentType,
   722 	                                                     RFile& aFile ) = 0;
   722                                                          RFile& aFile ) = 0;
   723 
   723 
   724 
   724 
   725     /**
   725     /**
   726      * Copies given email as new child part to given email part.
   726      * Copies given email as new child part to given email part.
   727      *
   727      *
   749      * @param aParentFolderId id of the parent folder where email is located
   749      * @param aParentFolderId id of the parent folder where email is located
   750      * @param aMessageId id of the email parent part belongs to
   750      * @param aMessageId id of the email parent part belongs to
   751      * @param aParentPartId id of the parent of the part
   751      * @param aParentPartId id of the parent of the part
   752      * @param aPartId id of the part to removed
   752      * @param aPartId id of the part to removed
   753      */
   753      */
   754      virtual void RemoveChildPartL(	const TFSMailMsgId& aMailBoxId,
   754      virtual void RemoveChildPartL( const TFSMailMsgId& aMailBoxId,
   755                                     const TFSMailMsgId& aParentFolderId,
   755                                     const TFSMailMsgId& aParentFolderId,
   756                                     const TFSMailMsgId& aMessageId,
   756                                     const TFSMailMsgId& aMessageId,
   757                                     const TFSMailMsgId& aParentPartId,
   757                                     const TFSMailMsgId& aParentPartId,
   758                                     const TFSMailMsgId& aPartId) = 0;
   758                                     const TFSMailMsgId& aPartId) = 0;
   759 
   759 
   835      * @param aMailBoxId id of the mailbox where email is located
   835      * @param aMailBoxId id of the mailbox where email is located
   836      * @param aParentFolderId id of the parent folder where email is located
   836      * @param aParentFolderId id of the parent folder where email is located
   837      * @param aMessageId id of the email part belongs to
   837      * @param aMessageId id of the email part belongs to
   838      * @param aMessagePartId id of the message part
   838      * @param aMessagePartId id of the message part
   839      */
   839      */
   840 	 virtual void SetContentL(	const TDesC& aBuffer,
   840      virtual void SetContentL(  const TDesC& aBuffer,
   841 	 						  	const TFSMailMsgId& aMailBoxId,
   841                                 const TFSMailMsgId& aMailBoxId,
   842      							const TFSMailMsgId& aParentFolderId,
   842                                 const TFSMailMsgId& aParentFolderId,
   843 								const TFSMailMsgId& aMessageId,
   843                                 const TFSMailMsgId& aMessageId,
   844 	 							const TFSMailMsgId& aMessagePartId) = 0;
   844                                 const TFSMailMsgId& aMessagePartId) = 0;
   845 
   845 
   846     /**
   846     /**
   847      * Removes fetched contents of these parts.
   847      * Removes fetched contents of these parts.
   848      *
   848      *
   849      * @param aMailBoxId defines mailbox where message is located
   849      * @param aMailBoxId defines mailbox where message is located
   850      * @param aParentFolderId defines parent folder where message is located
   850      * @param aParentFolderId defines parent folder where message is located
   851      * @param aMessageId gives the id of the message that message part belongs to
   851      * @param aMessageId gives the id of the message that message part belongs to
   852      * @param aPartIds message part ids to be removed
   852      * @param aPartIds message part ids to be removed
   853      */
   853      */
   854      virtual void RemovePartContentL( 	const TFSMailMsgId& aMailBoxId,
   854      virtual void RemovePartContentL(   const TFSMailMsgId& aMailBoxId,
   855      	     							const TFSMailMsgId& aParentFolderId,
   855                                         const TFSMailMsgId& aParentFolderId,
   856 									  	const TFSMailMsgId& aMessageId,
   856                                         const TFSMailMsgId& aMessageId,
   857      								  	const RArray<TFSMailMsgId>& aPartIds) = 0;
   857                                         const RArray<TFSMailMsgId>& aPartIds) = 0;
   858 
   858 
   859     /**
   859     /**
   860      * Sets email part contents from given file.
   860      * Sets email part contents from given file.
   861      * Possible old contents are replaced.
   861      * Possible old contents are replaced.
   862      *
   862      *
   879      * @param aParentFolderId id of the parent folder where email is located
   879      * @param aParentFolderId id of the parent folder where email is located
   880      * @param aMessageId id of the email part belongs to
   880      * @param aMessageId id of the email part belongs to
   881      * @param aMessagePart email part data to be stored
   881      * @param aMessagePart email part data to be stored
   882      */
   882      */
   883      virtual void StoreMessagePartL( const TFSMailMsgId& aMailBoxId,
   883      virtual void StoreMessagePartL( const TFSMailMsgId& aMailBoxId,
   884    	     							 const TFSMailMsgId& aParentFolderId,
   884                                      const TFSMailMsgId& aParentFolderId,
   885 									 const TFSMailMsgId& aMessageId,
   885                                      const TFSMailMsgId& aMessageId,
   886          							 CFSMailMessagePart& aMessagePart) = 0;
   886                                      CFSMailMessagePart& aMessagePart) = 0;
   887 
   887 
   888     /**
   888     /**
   889      * unregisters request observer to cancel pending events
   889      * unregisters request observer to cancel pending events
   890      *
   890      *
   891      * @param aRequestId request id of the pending asynchronous request
   891      * @param aRequestId request id of the pending asynchronous request
   900      */
   900      */
   901      virtual void SendMessageL( CFSMailMessage& aMessage ) = 0;
   901      virtual void SendMessageL( CFSMailMessage& aMessage ) = 0;
   902 
   902 
   903     /**
   903     /**
   904      * Returns pending asynchronous request status, request is identified
   904      * Returns pending asynchronous request status, request is identified
   905 	 * by request id if parallel requests exists
   905      * by request id if parallel requests exists
   906 	 *
   906      *
   907      * @param aRequestId request id
   907      * @param aRequestId request id
   908      *
   908      *
   909      * @return pending request status
   909      * @return pending request status
   910      */
   910      */
   911      virtual TFSProgress StatusL( const TInt aRequestId ) = 0;
   911      virtual TFSProgress StatusL( const TInt aRequestId ) = 0;
   912 
   912 
   913     /**
   913     /**
   914      * cancels pending request
   914      * cancels pending request
   915      *
   915      *
   916      * @param aRequestId identifies request if parallel requests exists
   916      * @param aRequestId identifies request if parallel requests exists
   917 	 */
   917      */
   918      virtual void CancelL( const TInt aRequestId ) = 0;
   918      virtual void CancelL( const TInt aRequestId ) = 0;
   919 
   919 
   920 	/** Search API */
   920     /** Search API */
   921 
   921 
   922     /**
   922     /**
   923      * Asyncronous call for starting search for given string. Only one search can be
   923      * Asyncronous call for starting search for given string. Only one search can be
   924      * performed at a time.
   924      * performed at a time.
   925      *
   925      *
   932      * To change the sort order in the search result, use the same search string in the
   932      * To change the sort order in the search result, use the same search string in the
   933      * but change the aSortCriteria parameter.  The store "caches" the search
   933      * but change the aSortCriteria parameter.  The store "caches" the search
   934      * results generated by the same search string.
   934      * results generated by the same search string.
   935      *
   935      *
   936      * The function will leave with KErrInUse if a search is already in progress.
   936      * The function will leave with KErrInUse if a search is already in progress.
   937 	 *
   937      *
   938      * /note Only works if the store is in an authenticated state,
   938      * /note Only works if the store is in an authenticated state,
   939      *  otherwise this function leaves with KErrNotReady
   939      *  otherwise this function leaves with KErrNotReady
   940      *
   940      *
   941      * @paran aMailBoxId id of the mailbox where messages are to be searched
   941      * @paran aMailBoxId id of the mailbox where messages are to be searched
   942      * @param aFolderIds list of folders where messages are to be searched
   942      * @param aFolderIds list of folders where messages are to be searched
   943 	 * 	      global or folder specific search depends on the size of array is 0 or not.
   943      *        global or folder specific search depends on the size of array is 0 or not.
   944      * @param aSearchStrings text strings that will be searched from different message fields.
   944      * @param aSearchStrings text strings that will be searched from different message fields.
   945 	 * @param aSortCriteria sort criteria for the results
   945      * @param aSortCriteria sort criteria for the results
   946      * @param aSearchObserver client observer that will be notified about search status.
   946      * @param aSearchObserver client observer that will be notified about search status.
   947      *
   947      *
   948      */
   948      */
   949      virtual void SearchL( const TFSMailMsgId& aMailBoxId,
   949      virtual void SearchL( const TFSMailMsgId& aMailBoxId,
   950                            const RArray<TFSMailMsgId>& aFolderIds,
   950                            const RArray<TFSMailMsgId>& aFolderIds,
   954 
   954 
   955 
   955 
   956     /**
   956     /**
   957      * Cancels current search. Does nothing if there is not any search.
   957      * Cancels current search. Does nothing if there is not any search.
   958      * The search client will not be called back after this function is called.
   958      * The search client will not be called back after this function is called.
   959 	 *
   959      *
   960      * \note CancelSearch() method does NOT clear the search result cached in the store.
   960      * \note CancelSearch() method does NOT clear the search result cached in the store.
   961      *       A different sort order can be used for the same search string, and the
   961      *       A different sort order can be used for the same search string, and the
   962      *       cache will be utilized.  Only by using a different search string can the
   962      *       cache will be utilized.  Only by using a different search string can the
   963      *       cache be cleaned.
   963      *       cache be cleaned.
   964 	 *
   964      *
   965      * @paran aMailBoxId id of the mailbox where the search should be cancelled
   965      * @paran aMailBoxId id of the mailbox where the search should be cancelled
   966      */
   966      */
   967      virtual void CancelSearch( const TFSMailMsgId& aMailBoxId ) = 0;
   967      virtual void CancelSearch( const TFSMailMsgId& aMailBoxId ) = 0;
   968 
   968 
   969     /**
   969     /**
   970      * Inform the store to clean up its cache for search results.
   970      * Inform the store to clean up its cache for search results.
   971      *
   971      *
   972      * This method cancels the the ongoing search (if exists), and then clean ups store's cache.
   972      * This method cancels the the ongoing search (if exists), and then clean ups store's cache.
   973      *
   973      *
   974      * This function should be called when search results are no longer in display.
   974      * This function should be called when search results are no longer in display.
   975 	 *
   975      *
   976      * @paran aMailBoxId id of the mailbox where the search cache should be cleared
   976      * @paran aMailBoxId id of the mailbox where the search cache should be cleared
   977 	 */
   977      */
   978      virtual void ClearSearchResultCache( const TFSMailMsgId& aMailBoxId ) = 0;
   978      virtual void ClearSearchResultCache( const TFSMailMsgId& aMailBoxId ) = 0;
   979 
   979 
   980     /**
   980     /**
   981      * Adds a new event observer. There can be several observers active at the same time.
   981      * Adds a new event observer. There can be several observers active at the same time.
   982      * Caller MUST call RemoveObserver before destroying given observer object.
   982      * Caller MUST call RemoveObserver before destroying given observer object.
  1001      * @param aRequestId asynchronous request id
  1001      * @param aRequestId asynchronous request id
  1002      */
  1002      */
  1003      virtual void AuthenticateL(MFSMailRequestObserver& aOperationObserver, TInt aRequestId) = 0;
  1003      virtual void AuthenticateL(MFSMailRequestObserver& aOperationObserver, TInt aRequestId) = 0;
  1004 
  1004 
  1005     /**
  1005     /**
  1006 	 * sets authentication popup data
  1006      * sets authentication popup data
  1007      * @param aMailBoxId id of the mailbox
  1007      * @param aMailBoxId id of the mailbox
  1008      * @param aUsername email account user name
  1008      * @param aUsername email account user name
  1009      * @param aPassword email account password
  1009      * @param aPassword email account password
  1010      */
  1010      */
  1011     virtual void SetCredentialsL( const TFSMailMsgId& aMailBoxId,
  1011     virtual void SetCredentialsL( const TFSMailMsgId& aMailBoxId,
  1027      */
  1027      */
  1028      CFSMailPlugin();
  1028      CFSMailPlugin();
  1029 
  1029 
  1030 private:
  1030 private:
  1031 
  1031 
  1032   	/**
  1032     /**
  1033      * Two-phased constructor
  1033      * Two-phased constructor
  1034      */
  1034      */
  1035      void ConstructL();
  1035      void ConstructL();
  1036 
  1036 
  1037 private: // data
  1037 private: // data
  1038 
  1038 
  1039     /**
  1039     /**
  1040      * instance identifier key for destructor
  1040      * instance identifier key for destructor
  1041      */
  1041      */
  1042     TUid		iDtor_ID_Key;
  1042     TUid        iDtor_ID_Key;
  1043 
  1043 
  1044     };
  1044     };
  1045 
  1045 
  1046 //<cmail>
  1046 //<cmail>
  1047 #include "cfsmailplugin.inl"
  1047 #include "cfsmailplugin.inl"