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