. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseCell */ class ReportBaseCell extends ReportBaseElement { // Center or align the text. Possible values are: // left or empty string: left align // center: center align // right: right align // justify: justification (default value when $ishtml=false) public string $align = ''; // Whether a border should be printed around this box. // 0 = no border (default) // 1 = border // a string containing some or all of the following characters (in any order): // L: left // T: top // R: right // B: bottom /** @var int|string */ public $border; /** * Border color in HTML code * * @var string */ public $bocolor; /** * The HTML color code to fill the background of this cell. * * @var string */ public $bgcolor; /** * Indicates if the cell background must be painted (1) or transparent (0). Default value: 1. * If no background color is set then it will not be painted * * @var int */ public $fill; /** * Cell height DEFAULT 0 (expressed in points) * The starting height of this cell. If the text wraps the height will automatically be adjusted. * * @var float */ public $height; /** * Left position in user units (X-position). Default is the current position * * @var mixed */ public $left; /** * Indicates where the current position should go after the call. Possible values are: * * @var int */ public $newline; /** * The name of the Style that should be used to render the text. * * @var string */ public $styleName; /** * Stretch carachter mode: * * @var int */ public $stretch; /** * Text color in HTML code * * @var string */ public $tcolor; /** * Top position in user units (Y-position). Default is the current position * * @var mixed */ public $top; /** * URL address * * @var string */ public $url; /** * Cell width DEFAULT 0 (expressed in points) * Setting the width to 0 will make it the width from the current location to the right margin. * * @var float */ public $width; /** @var bool */ public $reseth; /** * CELL - Element * * @param int $width cell width (expressed in points) * @param int $height cell height (expressed in points) * @param mixed $border Border style * @param string $align Text alignement * @param string $bgcolor Background color code * @param string $style The name of the text style * @param int $ln Indicates where the current position should go after the call * @param mixed $top Y-position * @param mixed $left X-position * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. * @param int $stretch Stretch carachter mode * @param string $bocolor Border color * @param string $tcolor Text color * @param bool $reseth */ public function __construct( int $width, int $height, $border, string $align, string $bgcolor, string $style, int $ln, $top, $left, int $fill, int $stretch, string $bocolor, string $tcolor, bool $reseth ) { $this->align = $align; $this->border = $border; $this->bgcolor = $bgcolor; $this->bocolor = $bocolor; $this->fill = $fill; $this->height = $height; $this->left = $left; $this->newline = $ln; $this->styleName = $style; $this->text = ''; $this->tcolor = $tcolor; $this->top = $top; $this->url = ''; $this->stretch = $stretch; $this->width = $width; $this->reseth = $reseth; } /** * Get the cell height * * @param HtmlRenderer|PdfRenderer $renderer * * @return float */ public function getHeight($renderer): float { return $this->height; } /** * Sets the current cells URL * * @param string $url The URL address to save * * @return void */ public function setUrl($url): void { $this->url = $url; } /** * Get the cell width * * @param HtmlRenderer|PdfRenderer $renderer * * @return array{0:float,1:int,2:float|int} */ public function getWidth($renderer): array { return [$this->width, 1, $this->height]; } }