1<?php
2
3declare(strict_types=1);
4
5/**
6 * @author Christoph Wurst <christoph@winzerhof-wurst.at>
7 *
8 * Mail
9 *
10 * This code is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License, version 3,
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
18 *
19 * You should have received a copy of the GNU Affero General Public License, version 3,
20 * along with this program.  If not, see <http://www.gnu.org/licenses/>
21 *
22 */
23
24namespace OCA\Mail;
25
26use Horde_Imap_Client_Mailbox;
27
28class Folder {
29
30	/** @var int */
31	private $accountId;
32
33	/** @var Horde_Imap_Client_Mailbox */
34	private $mailbox;
35
36	/** @var array */
37	private $attributes;
38
39	/** @var string */
40	private $delimiter;
41
42	/** @var array */
43	private $status;
44
45	/** @var string[] */
46	private $specialUse;
47
48	public function __construct(int $accountId, Horde_Imap_Client_Mailbox $mailbox, array $attributes, ?string $delimiter) {
49		$this->accountId = $accountId;
50		$this->mailbox = $mailbox;
51		$this->attributes = $attributes;
52		$this->delimiter = $delimiter;
53		$this->status = [];
54		$this->specialUse = [];
55	}
56
57	/**
58	 * @return string
59	 */
60	public function getMailbox() {
61		return $this->mailbox->utf8;
62	}
63
64	public function getDelimiter(): ?string {
65		return $this->delimiter;
66	}
67
68	public function getAttributes(): array {
69		return $this->attributes;
70	}
71
72	/**
73	 * @return array
74	 */
75	public function getStatus(): array {
76		return $this->status;
77	}
78
79	/**
80	 * @param array $status
81	 *
82	 * @return void
83	 */
84	public function setStatus(array $status): void {
85		$this->status = $status;
86	}
87
88	/**
89	 * @param string $use
90	 *
91	 * @return void
92	 */
93	public function addSpecialUse($use): void {
94		$this->specialUse[] = $use;
95	}
96
97	/**
98	 * @return string[]
99	 */
100	public function getSpecialUse() {
101		return $this->specialUse;
102	}
103}
104