16 */ |
16 */ |
17 |
17 |
18 #ifndef CFSFWMAILPLUGIN_H |
18 #ifndef CFSFWMAILPLUGIN_H |
19 #define CFSFWMAILPLUGIN_H |
19 #define CFSFWMAILPLUGIN_H |
20 |
20 |
21 #include <ecom.h> |
21 #include <ecom/ecom.h> |
22 |
22 |
23 //<cmail> |
23 #include "mfsmailrequestobserver.h" |
24 #include "MFSMailRequestObserver.h" |
24 #include "mfsmaileventobserver.h" |
25 #include "MFSMailEventObserver.h" |
25 #include "cfsmailbox.h" |
26 #include "CFSMailBox.h" |
26 #include "cfsmailplugin.hrh" |
27 #include "CFSMailPlugin.hrh" |
|
28 #include "cemailextensionbase.h" |
27 #include "cemailextensionbase.h" |
29 //</cmail> |
|
30 |
|
31 // constants |
28 // constants |
32 const TUid KFSMailPluginInterface = { FSMAILPLUGININTERFACE }; |
29 const TUid KFSMailPluginInterface = { FSMAILPLUGININTERFACE }; |
33 _LIT8( KFSPluginInterfaceImplementationType, "Plug-In Interface / Freestyle Email Framework"); |
30 _LIT8( KFSPluginInterfaceImplementationType, "Plug-In Interface / Freestyle Email Framework"); |
34 |
|
35 class MFSMailIterator; |
|
36 |
31 |
37 /** |
32 /** |
38 * Freestyle Email Framework Plugin Interface |
33 * Freestyle Email Framework Plugin Interface |
39 * |
34 * |
40 * class MFSMailPlugin defines functions used by email framework |
35 * class MFSMailPlugin defines functions used by email framework |
41 * and implemented by plugin implementor. |
36 * and implemented by plugin implementor. |
42 * |
37 * |
43 * Plugin implementor inherits from class CFSMailPlugin, |
38 * Plugin implementor inherits from class CFSMailPlugin, |
44 * but plugin load medhods are provided by framework in file CFSMailPlugin.inl |
39 * but plugin load medhods are provided by framework in file cfsmailplugin.inl |
45 * CFSMailPlugin,CFSMailPlugin.inl are exported by framework |
40 * CFSMailPlugin,cfsmailplugin.inl are exported by framework |
46 * |
41 * |
47 * @lib FSFWCommonLib |
42 * @lib FSFWCommonLib |
48 * |
43 * |
49 */ |
44 */ |
50 NONSHARABLE_CLASS ( CFSMailPlugin ) : public CExtendableEmail |
45 class CFSMailPlugin : public CExtendableEmail |
51 { |
46 { |
52 |
47 |
53 public: // Methods |
48 public: // Methods |
54 |
49 |
55 /** |
50 /** |
131 * @param aMailBoxId defines mailbox |
126 * @param aMailBoxId defines mailbox |
132 * @param aOperationObserver is client provided observer that |
127 * @param aOperationObserver is client provided observer that |
133 * will receive progress notifications during the operation. |
128 * will receive progress notifications during the operation. |
134 * @param aRequestId identifies asynchronous request if parallel |
129 * @param aRequestId identifies asynchronous request if parallel |
135 * requests exist |
130 * requests exist |
136 * @param aSilentConnection defines if connection is needed to be |
|
137 * silent connection or non-silent one (default). |
|
138 */ |
131 */ |
139 virtual void RefreshNowL( const TFSMailMsgId& aMailBoxId, |
132 virtual void RefreshNowL( const TFSMailMsgId& aMailBoxId, |
140 MFSMailRequestObserver& aOperationObserver, |
133 MFSMailRequestObserver& aOperationObserver, |
141 TInt aRequestId, |
134 TInt aRequestId ) = 0; |
142 const TBool aSilentConnection=EFalse ) = 0; |
|
143 |
135 |
144 /** |
136 /** |
145 * Returns last synchronization operation status. |
137 * Returns last synchronization operation status. |
146 * |
138 * |
147 * @param aMailBoxId mailbox id |
139 * @param aMailBoxId mailbox id |
530 * @param aMessages ids of messages to be deleted |
522 * @param aMessages ids of messages to be deleted |
531 */ |
523 */ |
532 virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId, |
524 virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId, |
533 const TFSMailMsgId& aFolderId, |
525 const TFSMailMsgId& aFolderId, |
534 const RArray<TFSMailMsgId>& aMessages ) = 0; |
526 const RArray<TFSMailMsgId>& aMessages ) = 0; |
535 |
527 |
536 // <qmail> |
|
537 /** |
|
538 * deletes email defined by message id |
|
539 * |
|
540 * @param aMailBoxId id of the mailbox containing email |
|
541 * @param aFolderId email parent folder id |
|
542 * @param aMessages ids of messages to be deleted |
|
543 * @param aOperationObserver Observer for the operation |
|
544 * @param aRequestId id of the operation |
|
545 * @return KErrNone if this method is supported, KErrNotSupported if not |
|
546 */ |
|
547 virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId, |
|
548 const TFSMailMsgId& aFolderId, |
|
549 const RArray<TFSMailMsgId>& aMessages, |
|
550 MFSMailRequestObserver& aOperationObserver, |
|
551 const TInt aRequestId ); |
|
552 // </qmail> |
|
553 |
|
554 /** |
528 /** |
555 * creates new email template into drafts folder |
529 * creates new email template into drafts folder |
556 * |
530 * |
557 * @param aMailBoxId id of the mailbox where new email is created |
531 * @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 |
532 * @return email object to be modified by user, ownership is transferred to user |
559 */ |
533 */ |
560 virtual CFSMailMessage* CreateMessageToSendL( const TFSMailMsgId& aMailBoxId ) = 0; |
534 virtual CFSMailMessage* CreateMessageToSendL( const TFSMailMsgId& aMailBoxId ) = 0; |
561 |
|
562 // <qmail> |
|
563 /** |
|
564 * 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 |
|
566 * 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 |
|
568 * 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 |
|
570 * doesn't implement this method the operation class automatically selects the |
|
571 * synchronous version. |
|
572 * |
|
573 * @param aMailBoxId id of the mailbox where new email is created |
|
574 * @param aOperationObserver Observer for the operation |
|
575 * @param aRequestId id of the operation |
|
576 * @return KErrNone if this method is supported, KErrNotSupported if not |
|
577 */ |
|
578 virtual void CreateMessageToSendL( |
|
579 const TFSMailMsgId& aMailBoxId, |
|
580 MFSMailRequestObserver& aOperationObserver, |
|
581 const TInt aRequestId ); |
|
582 // </qmail> |
|
583 |
535 |
584 /** |
536 /** |
585 * creates new email template to drafts folder to be forwarded |
537 * creates new email template to drafts folder to be forwarded |
586 * |
538 * |
587 * @param aMailBoxId id of the mailbox where new email is created |
539 * @param aMailBoxId id of the mailbox where new email is created |
589 * @return email object to be modified by user, ownership is transferred to user |
541 * @return email object to be modified by user, ownership is transferred to user |
590 */ |
542 */ |
591 virtual CFSMailMessage* CreateForwardMessageL( const TFSMailMsgId& aMailBoxId, |
543 virtual CFSMailMessage* CreateForwardMessageL( const TFSMailMsgId& aMailBoxId, |
592 const TFSMailMsgId& aOriginalMessageId, |
544 const TFSMailMsgId& aOriginalMessageId, |
593 const TDesC& aHeaderDescriptor = KNullDesC ) = 0; |
545 const TDesC& aHeaderDescriptor = KNullDesC ) = 0; |
594 |
|
595 // <qmail> |
|
596 /** |
|
597 * 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 |
|
599 * passed along with the TFSProgress data. |
|
600 * |
|
601 * @param aMailBoxId id of the mailbox where new email is created |
|
602 * @param aOriginalMessageId if of the (original) message,which is forwarded |
|
603 * @param aOperationObserver Observer for the operation |
|
604 * @param aRequestId id of the operation |
|
605 * @param aHeaderDescriptor user can give quote headers data to plugin as |
|
606 * parameter if needed |
|
607 * @return email object to be modified by user, ownership is transferred to user |
|
608 */ |
|
609 virtual void CreateForwardMessageL( const TFSMailMsgId& aMailBoxId, |
|
610 const TFSMailMsgId& aOriginalMessageId, |
|
611 MFSMailRequestObserver& aOperationObserver, |
|
612 const TInt aRequestId, |
|
613 const TDesC& aHeaderDescriptor = KNullDesC ); |
|
614 // </qmail> |
|
615 |
546 |
616 /** |
547 /** |
617 * creates new email template to drafts folder to be replied |
548 * creates new email template to drafts folder to be replied |
618 * |
549 * |
619 * @param aMailBoxId id of the mailbox where new email is created |
550 * @param aMailBoxId id of the mailbox where new email is created |
627 virtual CFSMailMessage* CreateReplyMessageL( const TFSMailMsgId& aMailBoxId, |
558 virtual CFSMailMessage* CreateReplyMessageL( const TFSMailMsgId& aMailBoxId, |
628 const TFSMailMsgId& aOriginalMessageId, |
559 const TFSMailMsgId& aOriginalMessageId, |
629 const TBool aReplyToAll, |
560 const TBool aReplyToAll, |
630 const TDesC& aHeaderDescriptor = KNullDesC) = 0; |
561 const TDesC& aHeaderDescriptor = KNullDesC) = 0; |
631 |
562 |
632 // <qmail> |
|
633 /** |
|
634 * 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 |
|
636 * passed along with the TFSProgress data. |
|
637 * |
|
638 * @param aMailBoxId id of the mailbox where new email is created |
|
639 * @param aOriginalMessageId id of original email,which is replied to |
|
640 * @param aReplyToAll true if reply to all is wanted |
|
641 * @param aOperationObserver Observer for the operation |
|
642 * @param aRequestId id of the operation |
|
643 * @param aHeaderDescriptor user can give quote headers data to plugin as |
|
644 * parameter if needed |
|
645 * |
|
646 * @return email object to be modified by user, ownership is transferred to user |
|
647 */ |
|
648 virtual void CreateReplyMessageL( const TFSMailMsgId& aMailBoxId, |
|
649 const TFSMailMsgId& aOriginalMessageId, |
|
650 const TBool aReplyToAll, |
|
651 MFSMailRequestObserver& aOperationObserver, |
|
652 const TInt aRequestId, |
|
653 const TDesC& aHeaderDescriptor = KNullDesC); |
|
654 // </qmail> |
|
655 |
|
656 /** |
563 /** |
657 * stores email object data to message store after modifications (commit) |
564 * stores email object data to message store after modifications (commit) |
658 * |
565 * |
659 * @param aMailBoxId id of the mailbox where email is stored |
566 * @param aMailBoxId id of the mailbox where email is stored |
660 * @param aMessage email data to be stored by plugin |
567 * @param aMessage email data to be stored by plugin |
661 */ |
568 */ |
662 virtual void StoreMessageL( const TFSMailMsgId& aMailBoxId, |
569 virtual void StoreMessageL( const TFSMailMsgId& aMailBoxId, |
663 CFSMailMessage& aMessage ) = 0; |
570 CFSMailMessage& aMessage ) = 0; |
664 |
571 |
665 |
|
666 // <qmail> |
|
667 /** |
|
668 * Asynchronous message storing |
|
669 * |
|
670 * @param aMailBoxId id of the mailbox where the messages are |
|
671 * @param aOperationObserver Observer for the operation |
|
672 * @param aRequestId id of the operation |
|
673 */ |
|
674 virtual void StoreMessagesL( |
|
675 const TFSMailMsgId& aMailBoxId, |
|
676 RPointerArray<CFSMailMessage> &messages, |
|
677 MFSMailRequestObserver& aOperationObserver, |
|
678 const TInt aRequestId ) = 0; |
|
679 // </qmail> |
|
680 |
|
681 /** |
572 /** |
682 * starts email fetching from email server |
573 * starts email fetching from email server |
683 * |
574 * |
684 * @param aMailBoxId id of the mailbox where email is located |
575 * @param aMailBoxId id of the mailbox where email is located |
685 * @param aFolderId id of the parent folder containing email |
576 * @param aFolderId id of the parent folder containing email |
805 const TFSMailMsgId& aMessageId, |
696 const TFSMailMsgId& aMessageId, |
806 const TFSMailMsgId& aParentPartId, |
697 const TFSMailMsgId& aParentPartId, |
807 const TDesC& aContentType, |
698 const TDesC& aContentType, |
808 const TDesC& aFilePath) = 0; |
699 const TDesC& aFilePath) = 0; |
809 |
700 |
810 // <qmail> |
701 |
811 /** |
702 /** |
812 * 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. |
813 * |
704 * |
814 * @param aMailBoxId id of the mailbox where parent part is located |
705 * @param aMailBoxId id of the mailbox where parent part is located |
815 * @param aParentFolderId id of the parent folder where email is located |
706 * @param aParentFolderId id of the parent folder where email is located |
816 * @param aMessageId id of the email parent part belongs to |
707 * @param aMessageId id of the email parent part belongs to |
817 * @param aParentPartId id of the parent part of the new part |
708 * @param aParentPartId id of the parent part of the new part |
818 * @param aInsertBefore id of existing part that new part should precede. |
709 * @param aInsertBefore id of existing part that new part should precede. |
819 * 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. |
820 * @param aContentType content type of the new message part |
711 * @param aContentType content type of the new message part |
821 * @param aFilePath file containing new child part contents |
712 * @param aFile access to file containing new child part contents, |
822 * @param aOperationObserver Observer for the operation |
713 * ownership is transferred |
823 * @param aRequestId id of the operation |
714 * |
824 * |
715 * return new child part object, ownership is transferred to user |
825 * return new child part object, ownership is transferred to user |
716 */ |
826 */ |
717 virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId, |
827 virtual void NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId, |
718 const TFSMailMsgId& aParentFolderId, |
828 const TFSMailMsgId& aParentFolderId, |
719 const TFSMailMsgId& aMessageId, |
829 const TFSMailMsgId& aMessageId, |
720 const TFSMailMsgId& aParentPartId, |
830 const TFSMailMsgId& aParentPartId, |
721 const TDesC& aContentType, |
831 const TDesC& aContentType, |
722 RFile& aFile ) = 0; |
832 const TDesC& aFilePath, |
|
833 MFSMailRequestObserver& aOperationObserver, |
|
834 const TInt aRequestId ); |
|
835 // </qmail> |
|
836 |
|
837 /** |
|
838 * Creates and adds a new child part from file to given email part. |
|
839 * |
|
840 * @param aMailBoxId id of the mailbox where parent part is located |
|
841 * @param aParentFolderId id of the parent folder where email is located |
|
842 * @param aMessageId id of the email parent part belongs to |
|
843 * @param aParentPartId id of the parent part of the new part |
|
844 * @param aInsertBefore id of existing part that new part should precede. |
|
845 * If aInsertBefore is NULL id then new part is added as last. |
|
846 * @param aContentType content type of the new message part |
|
847 * @param aFile access to file containing new child part contents, |
|
848 * ownership is transferred |
|
849 * |
|
850 * return new child part object, ownership is transferred to user |
|
851 */ |
|
852 virtual CFSMailMessagePart* NewChildPartFromFileL( const TFSMailMsgId& aMailBoxId, |
|
853 const TFSMailMsgId& aParentFolderId, |
|
854 const TFSMailMsgId& aMessageId, |
|
855 const TFSMailMsgId& aParentPartId, |
|
856 const TDesC& aContentType, |
|
857 RFile& aFile ) = 0; |
|
858 |
723 |
859 |
724 |
860 /** |
725 /** |
861 * Copies given email as new child part to given email part. |
726 * Copies given email as new child part to given email part. |
862 * |
727 * |
890 const TFSMailMsgId& aParentFolderId, |
755 const TFSMailMsgId& aParentFolderId, |
891 const TFSMailMsgId& aMessageId, |
756 const TFSMailMsgId& aMessageId, |
892 const TFSMailMsgId& aParentPartId, |
757 const TFSMailMsgId& aParentPartId, |
893 const TFSMailMsgId& aPartId) = 0; |
758 const TFSMailMsgId& aPartId) = 0; |
894 |
759 |
895 // <qmail> |
|
896 /** |
|
897 * Removes child part (and its children, if any) from given email part |
|
898 * |
|
899 * @param aMailBoxId id of the mailbox where email is located |
|
900 * @param aParentFolderId id of the parent folder where email is located |
|
901 * @param aMessageId id of the email parent part belongs to |
|
902 * @param aParentPartId id of the parent of the part |
|
903 * @param aPartId id of the part to removed |
|
904 * @param aOperationObserver Observer for the operation |
|
905 * @param aRequestId id of the operation |
|
906 */ |
|
907 virtual void RemoveChildPartL( const TFSMailMsgId& aMailBoxId, |
|
908 const TFSMailMsgId& aParentFolderId, |
|
909 const TFSMailMsgId& aMessageId, |
|
910 const TFSMailMsgId& aParentPartId, |
|
911 const TFSMailMsgId& aPartId, |
|
912 MFSMailRequestObserver& aOperationObserver, |
|
913 const TInt aRequestId); |
|
914 // </qmail> |
|
915 |
|
916 /** |
760 /** |
917 * Returns given message part. Ownership of object is transferred to caller. |
761 * Returns given message part. Ownership of object is transferred to caller. |
918 * |
762 * |
919 * @param aMailBoxId id of the mailbox where email is located |
763 * @param aMailBoxId id of the mailbox where email is located |
920 * @param aParentFolderId id of the parent folder where email is located |
764 * @param aParentFolderId id of the parent folder where email is located |
1038 */ |
882 */ |
1039 virtual void StoreMessagePartL( const TFSMailMsgId& aMailBoxId, |
883 virtual void StoreMessagePartL( const TFSMailMsgId& aMailBoxId, |
1040 const TFSMailMsgId& aParentFolderId, |
884 const TFSMailMsgId& aParentFolderId, |
1041 const TFSMailMsgId& aMessageId, |
885 const TFSMailMsgId& aMessageId, |
1042 CFSMailMessagePart& aMessagePart) = 0; |
886 CFSMailMessagePart& aMessagePart) = 0; |
1043 |
|
1044 // <qmail> |
|
1045 /** |
|
1046 * Asynchronous message parts storing |
|
1047 * |
|
1048 * @param aMessagePart email parts data to be stored |
|
1049 * @param aOperationObserver Observer for the operation |
|
1050 * @param aRequestId id of the operation |
|
1051 */ |
|
1052 virtual void StoreMessagePartsL( RPointerArray<CFSMailMessagePart>& aMessagePart, |
|
1053 MFSMailRequestObserver& aOperationObserver, |
|
1054 const TInt aRequestId ) = 0; |
|
1055 // <//qmail> |
|
1056 |
887 |
1057 /** |
888 /** |
1058 * unregisters request observer to cancel pending events |
889 * unregisters request observer to cancel pending events |
1059 * |
890 * |
1060 * @param aRequestId request id of the pending asynchronous request |
891 * @param aRequestId request id of the pending asynchronous request |
1066 * cancellation is deleting the message from outbox. |
897 * cancellation is deleting the message from outbox. |
1067 * |
898 * |
1068 * @param aMessage email to be sent |
899 * @param aMessage email to be sent |
1069 */ |
900 */ |
1070 virtual void SendMessageL( CFSMailMessage& aMessage ) = 0; |
901 virtual void SendMessageL( CFSMailMessage& aMessage ) = 0; |
1071 |
|
1072 // <qmail> |
|
1073 /** |
|
1074 * Launches email sending in plugin, |
|
1075 * @param aMessage email to be sent |
|
1076 * @param aOperationObserver Operation observer |
|
1077 * @param aRequestId Request id |
|
1078 */ |
|
1079 virtual void SendMessageL( CFSMailMessage& aMessage, |
|
1080 MFSMailRequestObserver& aOperationObserver, |
|
1081 const TInt aRequestId ); |
|
1082 // </qmail> |
|
1083 |
902 |
1084 /** |
903 /** |
1085 * Returns pending asynchronous request status, request is identified |
904 * Returns pending asynchronous request status, request is identified |
1086 * by request id if parallel requests exists |
905 * by request id if parallel requests exists |
1087 * |
906 * |