blob: 286e188851838d20350c8e8730070d681854b7ec [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001<?php
2
3declare(strict_types=1);
4
5namespace Ddeboer\Imap\Message;
6
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02007use Ddeboer\Imap\Exception\NotEmbeddedMessageException;
8
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01009/**
10 * An e-mail attachment.
11 */
12interface AttachmentInterface extends PartInterface
13{
14 /**
15 * Get attachment filename.
16 */
17 public function getFilename(): ?string;
18
19 /**
20 * Get attachment file size.
21 *
22 * @return null|int Number of bytes
23 */
24 public function getSize();
25
26 /**
27 * Is this attachment also an Embedded Message?
28 */
29 public function isEmbeddedMessage(): bool;
30
31 /**
32 * Return embedded message.
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020033 *
34 * @throws NotEmbeddedMessageException
35 *
36 * @return EmbeddedMessageInterface<PartInterface>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010037 */
38 public function getEmbeddedMessage(): EmbeddedMessageInterface;
39}