emailservices/emailframework/inc/CFSMailPlugin.h
changeset 72 64e38f08e49c
parent 65 478bc57ad291
child 68 83cc6bae1de8
equal deleted inserted replaced
65:478bc57ad291 72:64e38f08e49c
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-2009 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".
    35 class MFSMailIterator;
    35 class MFSMailIterator;
    36 
    36 
    37 /**
    37 /**
    38  *  Freestyle Email Framework Plugin Interface
    38  *  Freestyle Email Framework Plugin Interface
    39  *
    39  *
    40  *  class MFSMailPlugin defines functions used by email framework
    40  *  class CFSMailPlugin defines functions used by email framework
    41  *  and implemented by plugin implementor.
    41  *  and implemented by plugin implementor.
    42  *
    42  *
    43  *  Plugin implementor inherits from class CFSMailPlugin,
    43  *  Plugin implementor inherits from class CFSMailPlugin,
    44  *  but plugin load medhods are provided by framework in file CFSMailPlugin.inl
    44  *  but plugin load medhods are provided by framework in file CFSMailPlugin.inl
    45  *  CFSMailPlugin,CFSMailPlugin.inl are exported by framework
    45  *  CFSMailPlugin,CFSMailPlugin.inl are exported by framework
   131      * @param aMailBoxId defines mailbox
   131      * @param aMailBoxId defines mailbox
   132      * @param aOperationObserver is client provided observer that
   132      * @param aOperationObserver is client provided observer that
   133      *        will receive progress notifications during the operation.
   133      *        will receive progress notifications during the operation.
   134      * @param aRequestId identifies asynchronous request if parallel
   134      * @param aRequestId identifies asynchronous request if parallel
   135      * requests exist
   135      * requests exist
   136      * @param aSilentConnection defines if connection is needed to be 
   136      * @param aSilentConnection defines if connection is needed to be
   137      *        silent connection or non-silent one (default).
   137      *        silent connection or non-silent one (default).
   138      */
   138      */
   139      virtual void RefreshNowL( const TFSMailMsgId& aMailBoxId,
   139      virtual void RefreshNowL( const TFSMailMsgId& aMailBoxId,
   140                                MFSMailRequestObserver& aOperationObserver,
   140                                MFSMailRequestObserver& aOperationObserver,
   141                                TInt aRequestId,
   141                                TInt aRequestId,
   142                                const TBool aSilentConnection=EFalse ) = 0;
   142                                const TBool aSilentConnection=EFalse ) = 0;
   143 
   143 
   144     /**
   144     /**
   145      * Returns last synchronization operation status.
       
   146      *
       
   147      * @param aMailBoxId mailbox id
       
   148      *
       
   149      * @return last sync operation status
       
   150      *
       
   151      */
       
   152      virtual const TFSProgress GetLastSyncStatusL( const TFSMailMsgId& aMailBoxId ) = 0;
       
   153 
       
   154     /**
       
   155      * cancels all ongoing synchronizations in given mailbox regardless if initiated
       
   156      * by email framework or plugin itself
       
   157      *
       
   158      * @return error code
       
   159      */
       
   160      virtual TInt CancelSyncL( const TFSMailMsgId& aMailBoxId ) = 0;
       
   161 
       
   162     /**
       
   163      * Returns the current synchronization state of mailbox.
   145      * Returns the current synchronization state of mailbox.
   164      *
   146      *
   165      * @param aMailboxId id of the target mailbox
   147      * @param aMailboxId id of the target mailbox
   166      *
   148      *
   167      * @return mailbox synchronizing state data structure
   149      * @return mailbox synchronizing state data structure
   174      * @param aMailboxId id of target mailbox
   156      * @param aMailboxId id of target mailbox
   175      *
   157      *
   176      * @return online / offline
   158      * @return online / offline
   177      */
   159      */
   178      virtual TFSMailBoxStatus GetMailBoxStatus( const TFSMailMsgId& aMailBoxId ) = 0;
   160      virtual TFSMailBoxStatus GetMailBoxStatus( const TFSMailMsgId& aMailBoxId ) = 0;
   179 
       
   180     /**
       
   181      * checks if mailbox supports given capability
       
   182      *
       
   183      * @param aCapability capability to be checked
       
   184      * @param aMailBoxId id of the target mailbox
       
   185      *
       
   186      * @return true/false
       
   187      */
       
   188      virtual TBool MailboxHasCapabilityL(   TFSMailBoxCapabilities aCapability,
       
   189                                             TFSMailMsgId aMailBoxId ) = 0;
       
   190 
   161 
   191     /**
   162     /**
   192      * lists existing mailboxes contained by plugin
   163      * lists existing mailboxes contained by plugin
   193      *
   164      *
   194      * @param aMailBoxes plugin writes list of existing mailboxes into this
   165      * @param aMailBoxes plugin writes list of existing mailboxes into this
   222      virtual void DeleteMailBoxByUidL(  const TFSMailMsgId& aMailBoxId,
   193      virtual void DeleteMailBoxByUidL(  const TFSMailMsgId& aMailBoxId,
   223                                         MFSMailRequestObserver& aOperationObserver,
   194                                         MFSMailRequestObserver& aOperationObserver,
   224                                         const TInt aRequestId ) = 0;
   195                                         const TInt aRequestId ) = 0;
   225 
   196 
   226     /**
   197     /**
   227      * Returns branding id of this mailbox.
       
   228      * This function is used by Branding Manager to associate mailbox to a branding
       
   229      * definition. Plugin should return incoming mail server associated with this mailbox.
       
   230      *
       
   231      * @param aMailBoxId defines the target mailbox
       
   232      * @return branding id
       
   233      */
       
   234      virtual TDesC& GetBrandingIdL(const TFSMailMsgId& aMailboxId) = 0;
       
   235 
       
   236     /**
       
   237      * Subscribes events coming from given mailbox. UnsubscribeMailboxEvents
   198      * Subscribes events coming from given mailbox. UnsubscribeMailboxEvents
   238      * MUST be called before destroying given observer object.
   199      * MUST be called before destroying given observer object.
   239      *
   200      *
   240      * @param aMailboxId id of target mailbox
   201      * @param aMailboxId id of target mailbox
   241      * @param aObserver event observer implementation
   202      * @param aObserver event observer implementation
   249      * @param aMailboxId id of target mailbox
   210      * @param aMailboxId id of target mailbox
   250      * @param aObserver event observer
   211      * @param aObserver event observer
   251      */
   212      */
   252      virtual void UnsubscribeMailboxEvents(const TFSMailMsgId& aMailboxId,
   213      virtual void UnsubscribeMailboxEvents(const TFSMailMsgId& aMailboxId,
   253                                            MFSMailEventObserver& aObserver) = 0;
   214                                            MFSMailEventObserver& aObserver) = 0;
   254 
       
   255     /**
       
   256      * Gives notification that new account data may be available from Email Wizard.
       
   257      * Plugin must check if there is Wizard Data available for it and create
       
   258      * new account if necessary. If plugin does not support Email Wizard this
       
   259      * function can just return immediately.
       
   260      *
       
   261      * Should return KErrNone if no data found or configuration was successful.
       
   262      * otherwise any of the standard Symbian error codes.
       
   263      */
       
   264      virtual TInt WizardDataAvailableL() = 0;
       
   265 
       
   266     /**
       
   267      * reads connection id from plugin
       
   268      *
       
   269      * @param  aConnectionId reference to connection id
       
   270      * @return KErrNone or error code
       
   271      */
       
   272      virtual TInt GetConnectionId( TFSMailMsgId aMailBoxId, TUint32& aConnectionId );
       
   273 
       
   274     /**
       
   275      * checks from plugin if connection is allowed when roaming
       
   276      *
       
   277      * @param  aConnectionAllowed
       
   278      * @return KErrNone or error code
       
   279      */
       
   280      virtual TInt IsConnectionAllowedWhenRoaming( TFSMailMsgId aMailBoxId, TBool& aConnectionAllowed );
       
   281 
       
   282 
       
   283     /**
       
   284       * Reads email from file stream and converts it to class CFSMailMessage
       
   285       *
       
   286       * @param  aMailBoxId mailbox where email exists
       
   287       * @param  aFile input file given by user
       
   288       * @return CFSMailMessage
       
   289       */
       
   290      virtual CFSMailMessage* CreateMessageFromFileL( const TFSMailMsgId /*aMailboxId*/,
       
   291                                                      const RFile& /*aFile*/ )
       
   292                                                      { return NULL; };
       
   293 
   215 
   294     /**
   216     /**
   295      * Moves a messages between the given folders.
   217      * Moves a messages between the given folders.
   296      *
   218      *
   297      * @param aMailBoxId id of the target mailbox
   219      * @param aMailBoxId id of the target mailbox
   335      virtual void CopyMessagesL( const TFSMailMsgId& aMailBoxId,
   257      virtual void CopyMessagesL( const TFSMailMsgId& aMailBoxId,
   336                                  const RArray<TFSMailMsgId>& aMessageIds,
   258                                  const RArray<TFSMailMsgId>& aMessageIds,
   337                                  RArray<TFSMailMsgId>& aNewMessages,
   259                                  RArray<TFSMailMsgId>& aNewMessages,
   338                                  const TFSMailMsgId& aSourceFolderId,
   260                                  const TFSMailMsgId& aSourceFolderId,
   339                                  const TFSMailMsgId& aDestinationFolderId ) = 0;
   261                                  const TFSMailMsgId& aDestinationFolderId ) = 0;
   340 
       
   341     /** Get a list of most recently used addresses of desired mailbox.
       
   342      *  Each MRU entry consists of two descriptors placed sequentially
       
   343      *  in the array. First one is the display name and the second
       
   344      *  one is the actual email address. If for example some entry does
       
   345      *  not contain a name at all then a KNullDesC is found in place of
       
   346      *  the name.
       
   347      *
       
   348      *  The function will leave with KErrNotFound if a mailbox with
       
   349      *  given id is not found.
       
   350      *
       
   351      * @param aMailBoxId target mailbox id
       
   352      *
       
   353      * @return Array of descriptors containing MRUs. Ownership
       
   354      * is transferred. Empty if no entries are found.
       
   355      */
       
   356      virtual MDesCArray* GetMrusL( const TFSMailMsgId& aMailBoxId ) = 0;
       
   357 
       
   358     /** Set a list of most recently used addresses for given mailbox.
       
   359      *  Each MRU entry consists of two descriptors placed sequentially
       
   360      *  in the array. First one is the display name and the second
       
   361      *  one is the actual email address. If for example some entry does
       
   362      *  not contain a name at all then a KNullDesC is found in place of
       
   363      *  the name.
       
   364      *
       
   365      *  The function will leave with KErrNotFound if a mailbox with
       
   366      *  given id is not found.
       
   367      *
       
   368      * @param aMailBoxId target mailbox id
       
   369      * @param aNewMruList Array of descriptors containing MRUs.
       
   370      * Empty if no entries are found.
       
   371      */
       
   372      virtual void SetMrusL( const TFSMailMsgId& aMailBoxId,
       
   373                             MDesCArray* aNewMruList ) = 0;
       
   374 
   262 
   375     /** FOLDER HANDLING API */
   263     /** FOLDER HANDLING API */
   376     /**
   264     /**
   377      * returns email folder object related to given folder id
   265      * returns email folder object related to given folder id
   378      * folder data set by plugin :
   266      * folder data set by plugin :
   530      * @param aMessages ids of messages to be deleted
   418      * @param aMessages ids of messages to be deleted
   531      */
   419      */
   532      virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
   420      virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
   533                                         const TFSMailMsgId& aFolderId,
   421                                         const TFSMailMsgId& aFolderId,
   534                                         const RArray<TFSMailMsgId>& aMessages ) = 0;
   422                                         const RArray<TFSMailMsgId>& aMessages ) = 0;
   535      
   423 
   536 // <qmail>
   424 // <qmail>
       
   425 
   537      /**
   426      /**
   538       * deletes email defined by message id
   427       * deletes email defined by message id
   539       *
   428       *
   540       * @param aMailBoxId id of the mailbox containing email
   429       * @param aMailBoxId id of the mailbox containing email
   541       * @param aFolderId email parent folder id
   430       * @param aFolderId email parent folder id
   542       * @param aMessages ids of messages to be deleted
   431       * @param aMessages ids of messages to be deleted
   543       * @param aOperationObserver Observer for the operation 
   432       * @param aOperationObserver Observer for the operation
   544       * @param aRequestId id of the operation
   433       * @param aRequestId id of the operation
   545       * @return KErrNone if this method is supported, KErrNotSupported if not
   434       * @return KErrNone if this method is supported, KErrNotSupported if not
   546       */
   435       */
   547       virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
   436       virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
   548                                          const TFSMailMsgId& aFolderId,
   437                                          const TFSMailMsgId& aFolderId,
   549                                          const RArray<TFSMailMsgId>& aMessages,
   438                                          const RArray<TFSMailMsgId>& aMessages,
   550                                          MFSMailRequestObserver& aOperationObserver,
   439                                          MFSMailRequestObserver& aOperationObserver,
   551                                          const TInt aRequestId );
   440                                          const TInt aRequestId );
   552 // </qmail>
   441 // </qmail>
   553       
   442 
   554     /**
   443     /**
   555      * creates new email template into drafts folder
   444      * creates new email template into drafts folder
   556      *
   445      *
   557      * @param aMailBoxId id of the mailbox where new email is created
   446      * @param aMailBoxId id of the mailbox where new email is created
   558      * @return email object to be modified by user, ownership is transferred to user
   447      * @return email object to be modified by user, ownership is transferred to user
   559      */
   448      */
   560      virtual CFSMailMessage* CreateMessageToSendL( const TFSMailMsgId& aMailBoxId ) = 0;
   449      virtual CFSMailMessage* CreateMessageToSendL( const TFSMailMsgId& aMailBoxId ) = 0;
   561 
   450 
   562 // <qmail>
   451 // <qmail>
   563      /**
   452     /**
   564       * Asynchronous creation of new email template into drafts folder. When the operation
   453      * Asynchronous creation of new email template into drafts folder. When the operation
   565       * finishes, RequestResponseL is called on the observer and the created message is 
   454      * finishes, RequestResponseL is called on the observer and the created message is
   566       * passed along with the TFSProgress data. It is not necessary for a plugin to 
   455      * passed along with the TFSProgress data. It is not necessary for a plugin to
   567 	  * implement this method if using the synchronous version does not cause performance
   456      * implement this method if using the synchronous version does not cause performance
   568 	  * problems for the UI or general problems for the application. UI uses these methods
   457      * problems for the UI or general problems for the application. UI uses these methods
   569 	  * via an operation class NmMessageCreationOperation (see NmailUiEngine). If a plugin
   458      * via an operation class NmMessageCreationOperation (see NmailUiEngine). If a plugin
   570 	  * doesn't implement this method the operation class automatically selects the
   459      * doesn't implement this method the operation class automatically selects the
   571 	  * synchronous version.
   460      * synchronous version.
   572       *
   461      *
   573       * @param aMailBoxId id of the mailbox where new email is created
   462      * @param aMailBoxId id of the mailbox where new email is created
   574       * @param aOperationObserver Observer for the operation 
   463      * @param aOperationObserver Observer for the operation
   575       * @param aRequestId id of the operation
   464      * @param aRequestId id of the operation
   576 	  * @return KErrNone if this method is supported, KErrNotSupported if not
   465      * @return KErrNone if this method is supported, KErrNotSupported if not
   577       */
   466      */
   578      virtual void CreateMessageToSendL(
   467      virtual void CreateMessageToSendL( const TFSMailMsgId& aMailBoxId,
   579 	     const TFSMailMsgId& aMailBoxId,
   468                                         MFSMailRequestObserver& aOperationObserver,
   580          MFSMailRequestObserver& aOperationObserver,
   469                                         const TInt aRequestId ) = 0;
   581          const TInt aRequestId );
       
   582 // </qmail>
   470 // </qmail>
   583 
   471 
   584     /**
   472     /**
   585      * creates new email template to drafts folder to be forwarded
   473      * creates new email template to drafts folder to be forwarded
   586      *
   474      *
   589      * @return email object to be modified by user, ownership is transferred to user
   477      * @return email object to be modified by user, ownership is transferred to user
   590      */
   478      */
   591      virtual CFSMailMessage* CreateForwardMessageL( const TFSMailMsgId& aMailBoxId,
   479      virtual CFSMailMessage* CreateForwardMessageL( const TFSMailMsgId& aMailBoxId,
   592                                                     const TFSMailMsgId& aOriginalMessageId,
   480                                                     const TFSMailMsgId& aOriginalMessageId,
   593                                                     const TDesC& aHeaderDescriptor = KNullDesC ) = 0;
   481                                                     const TDesC& aHeaderDescriptor = KNullDesC ) = 0;
   594 	 
   482 
   595 // <qmail>
   483 // <qmail>
   596      /**
   484      /**
   597       * Asynchronous creation of new forwarded email into drafts folder. When the operation
   485       * Asynchronous creation of new forwarded email into drafts folder. When the operation
   598       * finishes, RequestResponseL is called on the observer and the created message is 
   486       * finishes, RequestResponseL is called on the observer and the created message is
   599       * passed along with the TFSProgress data.
   487       * passed along with the TFSProgress data.
   600       *
   488       *
   601       * @param aMailBoxId id of the mailbox where new email is created
   489       * @param aMailBoxId id of the mailbox where new email is created
   602       * @param aOriginalMessageId if of the (original) message,which is forwarded
   490       * @param aOriginalMessageId if of the (original) message,which is forwarded
   603       * @param aOperationObserver Observer for the operation 
   491       * @param aOperationObserver Observer for the operation
   604       * @param aRequestId id of the operation
   492       * @param aRequestId id of the operation
   605       * @param aHeaderDescriptor user can give quote headers data to plugin as
   493       * @param aHeaderDescriptor user can give quote headers data to plugin as
   606       *  parameter if needed
   494       *  parameter if needed
   607       * @return email object to be modified by user, ownership is transferred to user
   495       * @return email object to be modified by user, ownership is transferred to user
   608       */
   496       */
   627      virtual CFSMailMessage* CreateReplyMessageL( const TFSMailMsgId& aMailBoxId,
   515      virtual CFSMailMessage* CreateReplyMessageL( const TFSMailMsgId& aMailBoxId,
   628                                                   const TFSMailMsgId& aOriginalMessageId,
   516                                                   const TFSMailMsgId& aOriginalMessageId,
   629                                                   const TBool aReplyToAll,
   517                                                   const TBool aReplyToAll,
   630                                                   const TDesC& aHeaderDescriptor = KNullDesC) = 0;
   518                                                   const TDesC& aHeaderDescriptor = KNullDesC) = 0;
   631 
   519 
   632 // <qmail>	 
   520 // <qmail>
   633      /**
   521      /**
   634       * Asynchronous creation of new mail template to drafts folder to be replied. When the operation
   522       * Asynchronous creation of new mail template to drafts folder to be replied. When the operation
   635       * finishes, RequestResponseL is called on the observer and the created message is 
   523       * finishes, RequestResponseL is called on the observer and the created message is
   636       * passed along with the TFSProgress data.
   524       * passed along with the TFSProgress data.
   637       *
   525       *
   638       * @param aMailBoxId id of the mailbox where new email is created
   526       * @param aMailBoxId id of the mailbox where new email is created
   639       * @param aOriginalMessageId id of original email,which is replied to
   527       * @param aOriginalMessageId id of original email,which is replied to
   640       * @param aReplyToAll true if reply to all is wanted
   528       * @param aReplyToAll true if reply to all is wanted
   641       * @param aOperationObserver Observer for the operation 
   529       * @param aOperationObserver Observer for the operation
   642       * @param aRequestId id of the operation
   530       * @param aRequestId id of the operation
   643       * @param aHeaderDescriptor user can give quote headers data to plugin as
   531       * @param aHeaderDescriptor user can give quote headers data to plugin as
   644       *        parameter if needed
   532       *        parameter if needed
   645       *
   533       *
   646       * @return email object to be modified by user, ownership is transferred to user
   534       * @return email object to be modified by user, ownership is transferred to user
   649                                        const TFSMailMsgId& aOriginalMessageId,
   537                                        const TFSMailMsgId& aOriginalMessageId,
   650                                        const TBool aReplyToAll,
   538                                        const TBool aReplyToAll,
   651                                        MFSMailRequestObserver& aOperationObserver,
   539                                        MFSMailRequestObserver& aOperationObserver,
   652                                        const TInt aRequestId,
   540                                        const TInt aRequestId,
   653                                        const TDesC& aHeaderDescriptor = KNullDesC);
   541                                        const TDesC& aHeaderDescriptor = KNullDesC);
   654 // </qmail>	 
   542 // </qmail>
   655 
   543 
   656     /**
   544     /**
   657      * stores email object data to message store after modifications (commit)
   545      * stores email object data to message store after modifications (commit)
   658      *
   546      *
   659      * @param aMailBoxId id of the mailbox where email is stored
   547      * @param aMailBoxId id of the mailbox where email is stored
   666     // <qmail>
   554     // <qmail>
   667     /**
   555     /**
   668     * Asynchronous message storing
   556     * Asynchronous message storing
   669     *
   557     *
   670     * @param aMailBoxId id of the mailbox where the messages are
   558     * @param aMailBoxId id of the mailbox where the messages are
   671     * @param aOperationObserver Observer for the operation 
   559     * @param aOperationObserver Observer for the operation
   672     * @param aRequestId id of the operation
   560     * @param aRequestId id of the operation
   673     */
   561     */
   674     virtual void StoreMessagesL(
   562     virtual void StoreMessagesL(
   675         const TFSMailMsgId& aMailBoxId,
   563         const TFSMailMsgId& aMailBoxId,
   676         RPointerArray<CFSMailMessage> &messages,
   564         RPointerArray<CFSMailMessage> &messages,
   677         MFSMailRequestObserver& aOperationObserver,
   565         MFSMailRequestObserver& aOperationObserver,
   678         const TInt aRequestId ) = 0;
   566         const TInt aRequestId ) = 0;
   679     // </qmail>
   567     // </qmail>
   680     
   568 
   681     /**
   569     /**
   682      * starts email fetching from email server
   570      * starts email fetching from email server
   683      *
   571      *
   684      * @param aMailBoxId id of the mailbox where email is located
   572      * @param aMailBoxId id of the mailbox where email is located
   685      * @param aFolderId id of the parent folder containing email
   573      * @param aFolderId id of the parent folder containing email
   808                                                         const TDesC& aFilePath) = 0;
   696                                                         const TDesC& aFilePath) = 0;
   809 
   697 
   810 // <qmail>
   698 // <qmail>
   811 	    /**
   699 	    /**
   812 	     * Creates and adds a new child part from file to given email part.
   700 	     * Creates and adds a new child part from file to given email part.
   813 	     * 
   701 	     *
   814 	     * @param aMailBoxId id of the mailbox where parent part is located
   702 	     * @param aMailBoxId id of the mailbox where parent part is located
   815 	     * @param aParentFolderId id of the parent folder where email is located
   703 	     * @param aParentFolderId id of the parent folder where email is located
   816 	     * @param aMessageId id of the email parent part belongs to
   704 	     * @param aMessageId id of the email parent part belongs to
   817 	     * @param aParentPartId id of the parent part of the new part
   705 	     * @param aParentPartId id of the parent part of the new part
   818 	     * @param aInsertBefore id of existing part that new part should precede.
   706 	     * @param aInsertBefore id of existing part that new part should precede.
   819 	     * If aInsertBefore is NULL id then new part is added as last.
   707 	     * If aInsertBefore is NULL id then new part is added as last.
   820 	     * @param aContentType content type of the new message part
   708 	     * @param aContentType content type of the new message part
   821 	     * @param aFilePath file containing new child part contents
   709 	     * @param aFilePath file containing new child part contents
   822          * @param aOperationObserver Observer for the operation 
   710          * @param aOperationObserver Observer for the operation
   823          * @param aRequestId id of the operation
   711          * @param aRequestId id of the operation
   824 	     *
   712 	     *
   825 	     * return new child part object, ownership is transferred to user
   713 	     * return new child part object, ownership is transferred to user
   826 	     */        
   714 	     */
   827         virtual void NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId,
   715         virtual void NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId,
   828 	                                        const TFSMailMsgId& aParentFolderId,
   716 	                                        const TFSMailMsgId& aParentFolderId,
   829 	                                        const TFSMailMsgId& aMessageId,
   717 	                                        const TFSMailMsgId& aMessageId,
   830 	                                        const TFSMailMsgId& aParentPartId,
   718 	                                        const TFSMailMsgId& aParentPartId,
   831 	                                        const TDesC& aContentType,
   719 	                                        const TDesC& aContentType,
   832 	                                        const TDesC& aFilePath,
   720 	                                        const TDesC& aFilePath,
   833 	                                        MFSMailRequestObserver& aOperationObserver,
   721 	                                        MFSMailRequestObserver& aOperationObserver,
   834 	                                        const TInt aRequestId );
   722 	                                        const TInt aRequestId );
   835 // </qmail>
   723 // </qmail>
   836 	 
   724 
   837 	 /**
   725 	 /**
   838 	  * Creates and adds a new child part from file to given email part.
   726 	  * Creates and adds a new child part from file to given email part.
   839 	  * 
   727 	  *
   840 	  * @param aMailBoxId id of the mailbox where parent part is located
   728 	  * @param aMailBoxId id of the mailbox where parent part is located
   841 	  * @param aParentFolderId id of the parent folder where email is located
   729 	  * @param aParentFolderId id of the parent folder where email is located
   842 	  * @param aMessageId id of the email parent part belongs to
   730 	  * @param aMessageId id of the email parent part belongs to
   843 	  * @param aParentPartId id of the parent part of the new part
   731 	  * @param aParentPartId id of the parent part of the new part
   844 	  * @param aInsertBefore id of existing part that new part should precede.
   732 	  * @param aInsertBefore id of existing part that new part should precede.
   846 	  * @param aContentType content type of the new message part
   734 	  * @param aContentType content type of the new message part
   847 	  * @param aFile access to file containing new child part contents,
   735 	  * @param aFile access to file containing new child part contents,
   848 	  *  ownership is transferred
   736 	  *  ownership is transferred
   849 	  *
   737 	  *
   850 	  * return new child part object, ownership is transferred to user
   738 	  * return new child part object, ownership is transferred to user
   851 	  */        
   739 	  */
   852 	  virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId, 
   740 	  virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId,
   853 	                                                     const TFSMailMsgId& aParentFolderId, 
   741 	                                                     const TFSMailMsgId& aParentFolderId,
   854 	                                                     const TFSMailMsgId& aMessageId, 
   742 	                                                     const TFSMailMsgId& aMessageId,
   855 	                                                     const TFSMailMsgId& aParentPartId, 
   743 	                                                     const TFSMailMsgId& aParentPartId,
   856 	                                                     const TDesC& aContentType, 
   744 	                                                     const TDesC& aContentType,
   857 	                                                     RFile& aFile ) = 0; 
   745 	                                                     RFile& aFile ) = 0;
   858 
       
   859 
       
   860     /**
       
   861      * Copies given email as new child part to given email part.
       
   862      *
       
   863      * @param aMailBoxId id of the mailbox where email is located
       
   864      * @param aParentFolderId id of the parent folder where email is located
       
   865      * @param aMessageId id of the email parent part belongs to
       
   866      * @param aParentPartId id of the parent part of the new part
       
   867      * @param aInsertBefore id of existing part that new part should precede.
       
   868      *        If NULL id then new part is added as last.
       
   869      * @param aMessage id of the email that is copied as child part
       
   870      *
       
   871      * return new child part object, ownership is transferred to user
       
   872      */
       
   873      virtual CFSMailMessagePart* CopyMessageAsChildPartL( const TFSMailMsgId& aMailBoxId,
       
   874                                                           const TFSMailMsgId& aParentFolderId,
       
   875                                                           const TFSMailMsgId& aMessageId,
       
   876                                                           const TFSMailMsgId& aParentPartId,
       
   877                                                           const TFSMailMsgId& aInsertBefore,
       
   878                                                           const CFSMailMessage& aMessage) = 0;
       
   879 
   746 
   880     /**
   747     /**
   881      * Removes child part (and its children, if any) from given email part
   748      * Removes child part (and its children, if any) from given email part
   882      *
   749      *
   883      * @param aMailBoxId id of the mailbox where email is located
   750      * @param aMailBoxId id of the mailbox where email is located
   893                                     const TFSMailMsgId& aPartId) = 0;
   760                                     const TFSMailMsgId& aPartId) = 0;
   894 
   761 
   895 // <qmail>
   762 // <qmail>
   896      /**
   763      /**
   897       * Removes child part (and its children, if any) from given email part
   764       * Removes child part (and its children, if any) from given email part
   898       * 
   765       *
   899       * @param aMailBoxId id of the mailbox where email is located
   766       * @param aMailBoxId id of the mailbox where email is located
   900       * @param aParentFolderId id of the parent folder where email is located
   767       * @param aParentFolderId id of the parent folder where email is located
   901       * @param aMessageId id of the email parent part belongs to
   768       * @param aMessageId id of the email parent part belongs to
   902       * @param aParentPartId id of the parent of the part
   769       * @param aParentPartId id of the parent of the part
   903       * @param aPartId id of the part to removed
   770       * @param aPartId id of the part to removed
   904       * @param aOperationObserver Observer for the operation 
   771       * @param aOperationObserver Observer for the operation
   905       * @param aRequestId id of the operation
   772       * @param aRequestId id of the operation
   906       */        
   773       */
   907       virtual void RemoveChildPartL( const TFSMailMsgId& aMailBoxId,
   774       virtual void RemoveChildPartL( const TFSMailMsgId& aMailBoxId,
   908                                      const TFSMailMsgId& aParentFolderId,
   775                                      const TFSMailMsgId& aParentFolderId,
   909                                      const TFSMailMsgId& aMessageId,
   776                                      const TFSMailMsgId& aMessageId,
   910                                      const TFSMailMsgId& aParentPartId,
   777                                      const TFSMailMsgId& aParentPartId,
   911                                      const TFSMailMsgId& aPartId,
   778                                      const TFSMailMsgId& aPartId,
   912                                      MFSMailRequestObserver& aOperationObserver,
   779                                      MFSMailRequestObserver& aOperationObserver,
   913                                      const TInt aRequestId);
   780                                      const TInt aRequestId);
   914 // </qmail>
   781 // </qmail>
   915       
   782 
   916     /**
   783     /**
   917      * Returns given message part. Ownership of object is transferred to caller.
   784      * Returns given message part. Ownership of object is transferred to caller.
   918      *
   785      *
   919      * @param aMailBoxId id of the mailbox where email is located
   786      * @param aMailBoxId id of the mailbox where email is located
   920      * @param aParentFolderId id of the parent folder where email is located
   787      * @param aParentFolderId id of the parent folder where email is located
   998                                 const TFSMailMsgId& aParentFolderId,
   865                                 const TFSMailMsgId& aParentFolderId,
   999                                 const TFSMailMsgId& aMessageId,
   866                                 const TFSMailMsgId& aMessageId,
  1000                                 const TFSMailMsgId& aMessagePartId) = 0;
   867                                 const TFSMailMsgId& aMessagePartId) = 0;
  1001 
   868 
  1002     /**
   869     /**
  1003      * Removes fetched contents of these parts.
       
  1004      *
       
  1005      * @param aMailBoxId defines mailbox where message is located
       
  1006      * @param aParentFolderId defines parent folder where message is located
       
  1007      * @param aMessageId gives the id of the message that message part belongs to
       
  1008      * @param aPartIds message part ids to be removed
       
  1009      */
       
  1010      virtual void RemovePartContentL(   const TFSMailMsgId& aMailBoxId,
       
  1011                                         const TFSMailMsgId& aParentFolderId,
       
  1012                                         const TFSMailMsgId& aMessageId,
       
  1013                                         const RArray<TFSMailMsgId>& aPartIds) = 0;
       
  1014 
       
  1015     /**
       
  1016      * Sets email part contents from given file.
       
  1017      * Possible old contents are replaced.
       
  1018      *
       
  1019      * @param aMailBoxId id of the mailbox where email is located
       
  1020      * @param aParentFolderId id of the parent folder where email is located
       
  1021      * @param aMessageId id of the email part belongs to
       
  1022      * @param aMessagePartId id of the message part
       
  1023      * @param aFilePath source file path
       
  1024      */
       
  1025      virtual void SetPartContentFromFileL( const TFSMailMsgId& aMailBoxId,
       
  1026                                            const TFSMailMsgId& aParentFolderId,
       
  1027                                            const TFSMailMsgId& aMessageId,
       
  1028                                            const TFSMailMsgId& aMessagePartId,
       
  1029                                            const TDesC& aFilePath) = 0;
       
  1030 
       
  1031     /**
       
  1032      * stores email part object data to message store after modifications (commit)
   870      * stores email part object data to message store after modifications (commit)
  1033      *
   871      *
  1034      * @param aMailBoxId id of the mailbox where email is located
   872      * @param aMailBoxId id of the mailbox where email is located
  1035      * @param aParentFolderId id of the parent folder where email is located
   873      * @param aParentFolderId id of the parent folder where email is located
  1036      * @param aMessageId id of the email part belongs to
   874      * @param aMessageId id of the email part belongs to
  1038      */
   876      */
  1039      virtual void StoreMessagePartL( const TFSMailMsgId& aMailBoxId,
   877      virtual void StoreMessagePartL( const TFSMailMsgId& aMailBoxId,
  1040                                      const TFSMailMsgId& aParentFolderId,
   878                                      const TFSMailMsgId& aParentFolderId,
  1041                                      const TFSMailMsgId& aMessageId,
   879                                      const TFSMailMsgId& aMessageId,
  1042                                      CFSMailMessagePart& aMessagePart) = 0;
   880                                      CFSMailMessagePart& aMessagePart) = 0;
  1043      
   881 
  1044     // <qmail>
   882     // <qmail>
  1045     /**
   883     /**
  1046      * Asynchronous message parts storing
   884      * Asynchronous message parts storing
  1047      *
   885      *
  1048      * @param aMessagePart email parts data to be stored
   886      * @param aMessagePart email parts data to be stored
  1049      * @param aOperationObserver Observer for the operation 
   887      * @param aOperationObserver Observer for the operation
  1050      * @param aRequestId id of the operation
   888      * @param aRequestId id of the operation
  1051      */
   889      */
  1052     virtual void StoreMessagePartsL( RPointerArray<CFSMailMessagePart>& aMessagePart,
   890     virtual void StoreMessagePartsL( RPointerArray<CFSMailMessagePart>& aMessagePart,
  1053                                     MFSMailRequestObserver& aOperationObserver,
   891                                     MFSMailRequestObserver& aOperationObserver,
  1054                                     const TInt aRequestId ) = 0;
   892                                     const TInt aRequestId ) = 0;
  1182      * @param aRequestId asynchronous request id
  1020      * @param aRequestId asynchronous request id
  1183      */
  1021      */
  1184      virtual void AuthenticateL(MFSMailRequestObserver& aOperationObserver, TInt aRequestId) = 0;
  1022      virtual void AuthenticateL(MFSMailRequestObserver& aOperationObserver, TInt aRequestId) = 0;
  1185 
  1023 
  1186     /**
  1024     /**
  1187      * sets authentication popup data
       
  1188      * @param aMailBoxId id of the mailbox
       
  1189      * @param aUsername email account user name
       
  1190      * @param aPassword email account password
       
  1191      */
       
  1192     virtual void SetCredentialsL( const TFSMailMsgId& aMailBoxId,
       
  1193                                   const TDesC& aUsername,
       
  1194                                   const TDesC& aPassword )  = 0;
       
  1195 
       
  1196     /**
       
  1197       * Sets the mailbox name for this mailbox.
  1025       * Sets the mailbox name for this mailbox.
  1198       *
  1026       *
  1199       * @param aMailboxId id of target mailbox
  1027       * @param aMailboxId id of target mailbox
  1200       * @param aMailboxName new name for the mailbox
  1028       * @param aMailboxName new name for the mailbox
  1201       */
  1029       */
  1202     virtual void SetMailboxName(const TFSMailMsgId& aMailboxId, const TDesC& aMailboxName ) = 0;
  1030     virtual void SetMailboxName(const TFSMailMsgId& aMailboxId, const TDesC& aMailboxName ) = 0;
  1203     
  1031 
  1204     /**
  1032     /**
  1205      * Prepares and sets the MR description by converting HTML body to Plain text
  1033      * Prepares and sets the MR description by converting HTML body to Plain text
  1206      *
  1034      *
  1207      * @param aMailboxId mailbox id
  1035      * @param aMailboxId mailbox id
  1208      * @param aMessageId message id
  1036      * @param aMessageId message id
  1209      */     
  1037      */
  1210     virtual void PrepareMrDescriptionL( const TFSMailMsgId& /*aMailBoxId*/,
  1038     virtual void PrepareMrDescriptionL( const TFSMailMsgId& /*aMailBoxId*/,
  1211                                         const TFSMailMsgId& /*aMessageId*/ )
  1039                                         const TFSMailMsgId& /*aMessageId*/ )
  1212                                         { return; };
  1040                                     { return; };
  1213 
       
  1214 
  1041 
  1215     /**
  1042     /**
  1216      * Gets the signature for the given mailbox. Returns NULL if there is no signature defined for
  1043      * Gets the signature for the given mailbox. Returns NULL if there is no signature defined for
  1217      * the given mailbox.
  1044      * the given mailbox.
  1218      *
  1045      *
  1219      * @param aMailboxId mailbox id
  1046      * @param aMailboxId mailbox id
  1220      */     
  1047      */
  1221     virtual HBufC* GetSignatureL( const TFSMailMsgId& aMailBoxId );
  1048     virtual HBufC* GetSignatureL( const TFSMailMsgId& aMailBoxId );
  1222     
  1049 
  1223 protected:
  1050 protected:
  1224 
  1051 
  1225     /**
  1052     /**
  1226      * C++ default constructor.
  1053      * C++ default constructor.
  1227      */
  1054      */