xref: /webtrees/app/Report/ReportBaseTextbox.php (revision cbc1590a8c715aa2d88bd745610b899587bd9563)
1a25f0a04SGreg Roach<?php
2dd04c183SGreg Roachnamespace Fisharebest\Webtrees;
3a25f0a04SGreg Roach
4a25f0a04SGreg Roach/**
5a25f0a04SGreg Roach * webtrees: online genealogy
6a25f0a04SGreg Roach * Copyright (C) 2015 webtrees development team
7a25f0a04SGreg Roach * This program is free software: you can redistribute it and/or modify
8a25f0a04SGreg Roach * it under the terms of the GNU General Public License as published by
9a25f0a04SGreg Roach * the Free Software Foundation, either version 3 of the License, or
10a25f0a04SGreg Roach * (at your option) any later version.
11a25f0a04SGreg Roach * This program is distributed in the hope that it will be useful,
12a25f0a04SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
13a25f0a04SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14a25f0a04SGreg Roach * GNU General Public License for more details.
15a25f0a04SGreg Roach * You should have received a copy of the GNU General Public License
16a25f0a04SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
17a25f0a04SGreg Roach */
18a25f0a04SGreg Roach
19a25f0a04SGreg Roach/**
20a25f0a04SGreg Roach * Class ReportBaseTextbox
21a25f0a04SGreg Roach */
22a25f0a04SGreg Roachclass ReportBaseTextbox extends ReportBaseElement {
23a25f0a04SGreg Roach	/**
24a25f0a04SGreg Roach	 * Array of elements in the TextBox
25a25f0a04SGreg Roach	 *
26a25f0a04SGreg Roach	 * @var array
27a25f0a04SGreg Roach	 */
28a25f0a04SGreg Roach	public $elements = array();
29a25f0a04SGreg Roach
30a25f0a04SGreg Roach	/**
31a25f0a04SGreg Roach	 *  Background color in HTML code
32a25f0a04SGreg Roach	 *
33a25f0a04SGreg Roach	 * @var string
34a25f0a04SGreg Roach	 */
35a25f0a04SGreg Roach	public $bgcolor;
36a25f0a04SGreg Roach	/**
37a25f0a04SGreg Roach	 * Whether or not paint the background
38a25f0a04SGreg Roach	 *
39*cbc1590aSGreg Roach	 * @var bool
40a25f0a04SGreg Roach	 */
41a25f0a04SGreg Roach	public $fill;
42a25f0a04SGreg Roach
43a25f0a04SGreg Roach	/**
44a25f0a04SGreg Roach	 * Position the left corner of this box on the page(expressed in points). The default is the current position.
45a25f0a04SGreg Roach	 *
46a25f0a04SGreg Roach	 * @var mixed
47a25f0a04SGreg Roach	 */
48a25f0a04SGreg Roach	public $left;
49a25f0a04SGreg Roach	/**
50a25f0a04SGreg Roach	 * Position the top corner of this box on the page(expressed in points). the default is the current position
51a25f0a04SGreg Roach	 *
52a25f0a04SGreg Roach	 * @var mixed
53a25f0a04SGreg Roach	 */
54a25f0a04SGreg Roach	public $top;
55a25f0a04SGreg Roach	/**
56a25f0a04SGreg Roach	 * After this box is finished rendering, should the next section of text start immediately after the this box or should it start on a new line under this box. 0 = no new line, 1 = force new line. Default is 0
57a25f0a04SGreg Roach	 *
58*cbc1590aSGreg Roach	 * @var bool
59a25f0a04SGreg Roach	 */
60a25f0a04SGreg Roach	public $newline;
61a25f0a04SGreg Roach
62a25f0a04SGreg Roach	/**
63*cbc1590aSGreg Roach	 * @var bool
64a25f0a04SGreg Roach	 */
65a25f0a04SGreg Roach	public $pagecheck;
66a25f0a04SGreg Roach
67a25f0a04SGreg Roach	/**
68a25f0a04SGreg Roach	 * Whether or not a border should be printed around this box. 0 = no border, 1 = border. Default is 0
69a25f0a04SGreg Roach	 *
70*cbc1590aSGreg Roach	 * @var bool
71a25f0a04SGreg Roach	 */
72a25f0a04SGreg Roach	public $border;
73a25f0a04SGreg Roach	/**
74a25f0a04SGreg Roach	 * Style of rendering
75a25f0a04SGreg Roach	 *
76a25f0a04SGreg Roach	 * <ul>
77a25f0a04SGreg Roach	 * <li>D or empty string: Draw (default).</li>
78a25f0a04SGreg Roach	 * <li>F: Fill.</li>
79a25f0a04SGreg Roach	 * <li>DF or FD: Draw and fill.</li>
80a25f0a04SGreg Roach	 * <li>CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).</li>
81a25f0a04SGreg Roach	 *<li>CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).</li>
82a25f0a04SGreg Roach	 * </ul>
83a25f0a04SGreg Roach	 *
84a25f0a04SGreg Roach	 * @var string
85a25f0a04SGreg Roach	 */
86a25f0a04SGreg Roach	public $style;
87a25f0a04SGreg Roach
88a25f0a04SGreg Roach	/**
89*cbc1590aSGreg Roach	 * @var array Border style of rectangle. Array with keys among the following:
90a25f0a04SGreg Roach	 * <ul>
91a25f0a04SGreg Roach	 * <li>all: Line style of all borders. Array like for {@link SetLineStyle SetLineStyle}.</li>
92a25f0a04SGreg Roach	 * <li>L, T, R, B or combinations: Line style of left, top, right or bottom border. Array like for {@link SetLineStyle SetLineStyle}.</li>
93a25f0a04SGreg Roach	 * </ul>
94a25f0a04SGreg Roach	 * Not yet in use
95a25f0a04SGreg Roach	 * var $borderstyle;
96a25f0a04SGreg Roach	 */
97a25f0a04SGreg Roach
98a25f0a04SGreg Roach	/**
99a25f0a04SGreg Roach	 * The starting height of this cell. If the text wraps the height will automatically be adjusted
100a25f0a04SGreg Roach	 *
101a25f0a04SGreg Roach	 * @var float
102a25f0a04SGreg Roach	 */
103a25f0a04SGreg Roach	public $height;
104a25f0a04SGreg Roach	/**
105a25f0a04SGreg Roach	 * Setting the width to 0 will make it the width from the current location to the right margin
106a25f0a04SGreg Roach	 *
107a25f0a04SGreg Roach	 * @var float
108a25f0a04SGreg Roach	 */
109a25f0a04SGreg Roach	public $width;
110a25f0a04SGreg Roach	/**
111a25f0a04SGreg Roach	 * Use cell padding or not
112a25f0a04SGreg Roach	 *
113*cbc1590aSGreg Roach	 * @var bool
114a25f0a04SGreg Roach	 */
115a25f0a04SGreg Roach	public $padding;
116a25f0a04SGreg Roach	/**
117a25f0a04SGreg Roach	 * Resets this box last height after it’s done
118a25f0a04SGreg Roach	 */
119a25f0a04SGreg Roach	public $reseth;
120a25f0a04SGreg Roach
121a25f0a04SGreg Roach	/**
122a25f0a04SGreg Roach	 * TextBox - Element - Base
123a25f0a04SGreg Roach	 *
124a25f0a04SGreg Roach	 * @param float  $width   Text box width
125a25f0a04SGreg Roach	 * @param float  $height  Text box height
126*cbc1590aSGreg Roach	 * @param bool   $border
127a25f0a04SGreg Roach	 * @param string $bgcolor Background color code in HTML
128*cbc1590aSGreg Roach	 * @param bool   $newline
129a25f0a04SGreg Roach	 * @param mixed  $left
130a25f0a04SGreg Roach	 * @param mixed  $top
131*cbc1590aSGreg Roach	 * @param bool   $pagecheck
132a25f0a04SGreg Roach	 * @param string $style
133*cbc1590aSGreg Roach	 * @param bool   $fill
134*cbc1590aSGreg Roach	 * @param bool   $padding
135*cbc1590aSGreg Roach	 * @param bool   $reseth
136a25f0a04SGreg Roach	 */
137e2d2f0ebSGreg Roach	public function __construct(
138a25f0a04SGreg Roach		$width, $height, $border, $bgcolor, $newline, $left, $top, $pagecheck, $style, $fill, $padding, $reseth
139a25f0a04SGreg Roach	) {
140a25f0a04SGreg Roach		$this->border    = $border;
141a25f0a04SGreg Roach		$this->bgcolor   = $bgcolor;
142a25f0a04SGreg Roach		$this->fill      = $fill;
143a25f0a04SGreg Roach		$this->height    = $height;
144a25f0a04SGreg Roach		$this->left      = $left;
145a25f0a04SGreg Roach		$this->newline   = $newline;
146a25f0a04SGreg Roach		$this->pagecheck = $pagecheck;
147a25f0a04SGreg Roach		$this->style     = $style;
148a25f0a04SGreg Roach		$this->top       = $top;
149a25f0a04SGreg Roach		$this->width     = $width;
150a25f0a04SGreg Roach		$this->padding   = $padding;
151a25f0a04SGreg Roach		$this->reseth    = $reseth;
152a25f0a04SGreg Roach
153a25f0a04SGreg Roach		return 0;
154a25f0a04SGreg Roach	}
155a25f0a04SGreg Roach
156a25f0a04SGreg Roach	/**
157a25f0a04SGreg Roach	 * Add an element to the TextBox
158a25f0a04SGreg Roach	 *
159a25f0a04SGreg Roach	 * @param object|string $element
160a25f0a04SGreg Roach	 *
161*cbc1590aSGreg Roach	 * @return int
162a25f0a04SGreg Roach	 */
163ffd703eaSGreg Roach	public function addElement($element) {
164a25f0a04SGreg Roach		$this->elements[] = $element;
165a25f0a04SGreg Roach
166a25f0a04SGreg Roach		return 0;
167a25f0a04SGreg Roach	}
168a25f0a04SGreg Roach}
169