1<?php
2
3/**
4 +-----------------------------------------------------------------------+
5 | This file is part of the Roundcube Webmail client                     |
6 |                                                                       |
7 | Copyright (C) The Roundcube Dev Team                                  |
8 | Copyright (C) Kolab Systems AG                                        |
9 |                                                                       |
10 | Licensed under the GNU General Public License version 3 or            |
11 | any later version with exceptions for skins & plugins.                |
12 | See the README file for a full license statement.                     |
13 |                                                                       |
14 | PURPOSE:                                                              |
15 |   Class representing a message part                                   |
16 +-----------------------------------------------------------------------+
17 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
18 | Author: Aleksander Machniak <alec@alec.pl>                            |
19 +-----------------------------------------------------------------------+
20*/
21
22/**
23 * Class representing a message part
24 *
25 * @package    Framework
26 * @subpackage Storage
27 */
28class rcube_message_part
29{
30    /**
31     * Part MIME identifier
32     *
33     * @var string
34     */
35    public $mime_id = '';
36
37    /**
38     * Content main type
39     *
40     * @var string
41     */
42    public $ctype_primary = 'text';
43
44    /**
45     * Content subtype
46     *
47     * @var string
48     */
49    public $ctype_secondary = 'plain';
50
51    /**
52     * Complete content type
53     *
54     * @var string
55     */
56    public $mimetype = 'text/plain';
57
58    /**
59     * Part size in bytes
60     *
61     * @var int
62     */
63    public $size = 0;
64
65    /**
66     * Part body
67     *
68     * @var string|null
69     */
70    public $body;
71
72    /**
73     * Part headers
74     *
75     * @var array
76     */
77    public $headers = [];
78
79    /**
80     * Sub-Parts
81     *
82     * @var array
83     */
84    public $parts = [];
85
86    public $type;
87    public $replaces     = [];
88    public $disposition  = '';
89    public $filename     = '';
90    public $encoding     = '8bit';
91    public $charset      = '';
92    public $d_parameters = [];
93    public $ctype_parameters = [];
94
95
96    /**
97     * Clone handler.
98     */
99    function __clone()
100    {
101        if (isset($this->parts)) {
102            foreach ($this->parts as $idx => $part) {
103                if (is_object($part)) {
104                    $this->parts[$idx] = clone $part;
105                }
106            }
107        }
108    }
109}
110