Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 19
CRAP
0.00% covered (danger)
0.00%
0 / 37
TPDFColumn
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 19
702
0.00% covered (danger)
0.00%
0 / 37
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 10
 setHeader
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getHeader
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 setWidth
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getWidth
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 setAlign
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getAlign
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setFieldName
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getFieldName
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 setFontColor
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getFontColor
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setFillColor
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 2
 getFillColor
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setFontStyle
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getFontStyle
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setFontSize
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getFontSize
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setFontFamily
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getFontFamily
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
1<?php
2/*
3 * Formdin Framework
4 * Copyright (C) 2012 Ministério do Planejamento
5 * Criado por Luís Eugênio Barbosa
6 * Essa versão é um Fork https://github.com/bjverde/formDin
7 *
8 * ----------------------------------------------------------------------------
9 * This file is part of Formdin Framework.
10 *
11 * Formdin Framework is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License version 3
13 * as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License version 3
21 * along with this program; if not,  see <http://www.gnu.org/licenses/>
22 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
23 * Fifth Floor, Boston, MA  02110-1301, USA.
24 * ----------------------------------------------------------------------------
25 * Este arquivo é parte do Framework Formdin.
26 *
27 * O Framework Formdin é um software livre; você pode redistribuí-lo e/ou
28 * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
29 * do Software Livre (FSF).
30 *
31 * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
32 * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
33 * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
34 * para maiores detalhes.
35 *
36 * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
37 * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
38 * ou escreva para a Fundação do Software Livre (FSF) Inc.,
39 * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
40 */
41
42class TPDFColumn
43{
44    private $header;
45    private $width;
46    private $align;
47    private $fieldName;
48    private $fontColor;
49    private $fontStyle;
50    private $fontSize;
51    private $fontFamily;
52    private $fillColor;
53
54    /**
55     * Add New Column in Grid. Need to use method printRows for show column in pdf.
56     * 
57     * Adicionar nova coluna na grade. Precisa usar o método printRows para mostrar coluna em pdf
58     * 
59     * @param string $strHeader      - 1: ID column
60     * @param string $intWidth       - 2: Size column
61     * @param string $strAlign       - 3: Align column, Values L = Left ,C= Center,R= ,J=justified
62     * @param string $strFieldName   - 4: Label column head
63     * @param string $hexFillColor   - 5: Cor do fundo, hexadecimal
64     * @param string $strFontStyle   - 6: Style da font: I, B
65     * @param string $intFontSize    - 7: Tamanho da fonte
66     * @param string $hexFontColor   - 8: Cor em HexaDecimal
67     * @param string $strFontFamily  - 9: 
68     * @return TPDFColumn
69     **/
70    public function __construct( $strHeader=null
71                               , $intWidth=null
72                               , $strAlign=null
73                               , $strFieldName=null
74                               , $hexFillColor=null
75                               , $strFontStyle=null
76                               , $intFontSize=null
77                               , $hexFontColor=null
78                               , $strFontFamily=null)
79    {
80        $this->setHeader($strHeader);
81        $this->setWidth($intWidth);
82        $this->setAlign($strAlign);
83        $this->setFieldName($strFieldName);
84        $this->setFillColor($hexFillColor);
85        $this->setFontStyle($strFontStyle);
86        $this->setFontSize($intFontSize);
87        $this->setFontColor($hexFontColor);
88        $this->setFontFamily($strFontFamily);
89    }
90    public function setHeader($strNewValue=null)
91    {
92        $this->header = $strNewValue;
93        return $this;
94    }
95    public function getHeader()
96    {
97        return $this->header;
98    }
99
100    public function setWidth($intNewValue=null)
101    {
102        $this->width = $intNewValue;
103        return $this;
104    }
105    public function getWidth()
106    {
107        return $this->width;
108    }
109
110    public function setAlign($strNewValue=null)
111    {
112        $this->align = $strNewValue;
113        return $this;
114    }
115    public function getAlign()
116    {
117        return is_null($this->align) ? 'L' : strtoupper($this->align);
118    }
119
120    public function setFieldName($strNewValue=null)
121    {
122        $this->fieldName = $strNewValue;
123        return $this;
124    }
125    public function getFieldName()
126    {
127        return $this->fieldName;
128    }
129
130    public function setFontColor($strHexColor=null)
131    {
132        $this->fontColor = $strHexColor;
133        return $this;
134    }
135    public function getFontColor()
136    {
137        return is_null($this->fontColor) ? 0 : $this->fontColor; // preta
138    }
139
140    public function setFillColor($hexFillColor=null)
141    {
142        $this->fillColor = ( $hexFillColor == '' ) ? null : $hexFillColor;
143        return $this;
144    }
145    public function getFillColor()
146    {
147        return is_null($this->fillColor) ? 255 : $this->fillColor; // branca
148    }
149
150    public function setFontStyle($strNewValue=null)
151    {
152        $this->fontStyle = $strNewValue;
153        return $this;
154    }
155    public function getFontStyle( $currentFontStyle=null )
156    {
157        return is_null( $this->fontStyle ) ? $currentFontStyle : $this->fontStyle;
158    }
159    public function setFontSize($intNewValue=null)
160    {
161        $this->fontSize = $intNewValue;
162        return $this;
163    }
164    public function getFontSize($currentValue=null)
165    {
166        return is_null($this->fontSize) ? $currentValue : $this->fontSize;
167    }
168    public function setFontFamily($strNewValue=null)
169    {
170        $this->fontFamily = $strNewValue;
171    }
172    public function getFontFamily($currentValue=null)
173    {
174        return is_null($this->fontFamily) ? $currentValue : $this->fontFamily;
175    }
176
177}
178?>