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