Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Ddeboer\Imap; |
| 6 | |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 7 | use Ddeboer\Imap\Exception\MessageCopyException; |
| 8 | use Ddeboer\Imap\Exception\MessageDeleteException; |
| 9 | use Ddeboer\Imap\Exception\MessageMoveException; |
| 10 | use Ddeboer\Imap\Exception\MessageUndeleteException; |
| 11 | |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 12 | /** |
| 13 | * An IMAP message (e-mail). |
| 14 | */ |
| 15 | interface MessageInterface extends Message\BasicMessageInterface |
| 16 | { |
| 17 | /** |
| 18 | * Get raw part content. |
| 19 | */ |
| 20 | public function getContent(): string; |
| 21 | |
| 22 | /** |
| 23 | * Get message recent flag value (from headers). |
| 24 | */ |
| 25 | public function isRecent(): ?string; |
| 26 | |
| 27 | /** |
| 28 | * Get message unseen flag value (from headers). |
| 29 | */ |
| 30 | public function isUnseen(): bool; |
| 31 | |
| 32 | /** |
| 33 | * Get message flagged flag value (from headers). |
| 34 | */ |
| 35 | public function isFlagged(): bool; |
| 36 | |
| 37 | /** |
| 38 | * Get message answered flag value (from headers). |
| 39 | */ |
| 40 | public function isAnswered(): bool; |
| 41 | |
| 42 | /** |
| 43 | * Get message deleted flag value (from headers). |
| 44 | */ |
| 45 | public function isDeleted(): bool; |
| 46 | |
| 47 | /** |
| 48 | * Get message draft flag value (from headers). |
| 49 | */ |
| 50 | public function isDraft(): bool; |
| 51 | |
| 52 | /** |
| 53 | * Has the message been marked as read? |
| 54 | */ |
| 55 | public function isSeen(): bool; |
| 56 | |
| 57 | /** |
| 58 | * Mark message as seen. |
| 59 | * |
| 60 | * @deprecated since version 1.1, to be removed in 2.0 |
| 61 | */ |
| 62 | public function maskAsSeen(): bool; |
| 63 | |
| 64 | /** |
| 65 | * Mark message as seen. |
| 66 | */ |
| 67 | public function markAsSeen(): bool; |
| 68 | |
| 69 | /** |
| 70 | * Move message to another mailbox. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 71 | * |
| 72 | * @throws MessageCopyException |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 73 | */ |
| 74 | public function copy(MailboxInterface $mailbox): void; |
| 75 | |
| 76 | /** |
| 77 | * Move message to another mailbox. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 78 | * |
| 79 | * @throws MessageMoveException |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 80 | */ |
| 81 | public function move(MailboxInterface $mailbox): void; |
| 82 | |
| 83 | /** |
| 84 | * Delete message. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 85 | * |
| 86 | * @throws MessageDeleteException |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 87 | */ |
| 88 | public function delete(): void; |
| 89 | |
| 90 | /** |
| 91 | * Undelete message. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 92 | * |
| 93 | * @throws MessageUndeleteException |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 94 | */ |
| 95 | public function undelete(): void; |
| 96 | |
| 97 | /** |
| 98 | * Set Flag Message. |
| 99 | * |
| 100 | * @param string $flag \Seen, \Answered, \Flagged, \Deleted, and \Draft |
| 101 | */ |
| 102 | public function setFlag(string $flag): bool; |
| 103 | |
| 104 | /** |
| 105 | * Clear Flag Message. |
| 106 | * |
| 107 | * @param string $flag \Seen, \Answered, \Flagged, \Deleted, and \Draft |
| 108 | */ |
| 109 | public function clearFlag(string $flag): bool; |
| 110 | } |