Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
namespace PhpOffice\PhpSpreadsheet\Worksheet;
4
 
5
class PageMargins
6
{
7
    /**
8
     * Left.
9
     *
10
     * @var float
11
     */
12
    private $left = 0.7;
13
 
14
    /**
15
     * Right.
16
     *
17
     * @var float
18
     */
19
    private $right = 0.7;
20
 
21
    /**
22
     * Top.
23
     *
24
     * @var float
25
     */
26
    private $top = 0.75;
27
 
28
    /**
29
     * Bottom.
30
     *
31
     * @var float
32
     */
33
    private $bottom = 0.75;
34
 
35
    /**
36
     * Header.
37
     *
38
     * @var float
39
     */
40
    private $header = 0.3;
41
 
42
    /**
43
     * Footer.
44
     *
45
     * @var float
46
     */
47
    private $footer = 0.3;
48
 
49
    /**
50
     * Create a new PageMargins.
51
     */
52
    public function __construct()
53
    {
54
    }
55
 
56
    /**
57
     * Get Left.
58
     *
59
     * @return float
60
     */
61
    public function getLeft()
62
    {
63
        return $this->left;
64
    }
65
 
66
    /**
67
     * Set Left.
68
     *
69
     * @param float $left
70
     *
71
     * @return $this
72
     */
73
    public function setLeft($left)
74
    {
75
        $this->left = $left;
76
 
77
        return $this;
78
    }
79
 
80
    /**
81
     * Get Right.
82
     *
83
     * @return float
84
     */
85
    public function getRight()
86
    {
87
        return $this->right;
88
    }
89
 
90
    /**
91
     * Set Right.
92
     *
93
     * @param float $right
94
     *
95
     * @return $this
96
     */
97
    public function setRight($right)
98
    {
99
        $this->right = $right;
100
 
101
        return $this;
102
    }
103
 
104
    /**
105
     * Get Top.
106
     *
107
     * @return float
108
     */
109
    public function getTop()
110
    {
111
        return $this->top;
112
    }
113
 
114
    /**
115
     * Set Top.
116
     *
117
     * @param float $top
118
     *
119
     * @return $this
120
     */
121
    public function setTop($top)
122
    {
123
        $this->top = $top;
124
 
125
        return $this;
126
    }
127
 
128
    /**
129
     * Get Bottom.
130
     *
131
     * @return float
132
     */
133
    public function getBottom()
134
    {
135
        return $this->bottom;
136
    }
137
 
138
    /**
139
     * Set Bottom.
140
     *
141
     * @param float $bottom
142
     *
143
     * @return $this
144
     */
145
    public function setBottom($bottom)
146
    {
147
        $this->bottom = $bottom;
148
 
149
        return $this;
150
    }
151
 
152
    /**
153
     * Get Header.
154
     *
155
     * @return float
156
     */
157
    public function getHeader()
158
    {
159
        return $this->header;
160
    }
161
 
162
    /**
163
     * Set Header.
164
     *
165
     * @param float $header
166
     *
167
     * @return $this
168
     */
169
    public function setHeader($header)
170
    {
171
        $this->header = $header;
172
 
173
        return $this;
174
    }
175
 
176
    /**
177
     * Get Footer.
178
     *
179
     * @return float
180
     */
181
    public function getFooter()
182
    {
183
        return $this->footer;
184
    }
185
 
186
    /**
187
     * Set Footer.
188
     *
189
     * @param float $footer
190
     *
191
     * @return $this
192
     */
193
    public function setFooter($footer)
194
    {
195
        $this->footer = $footer;
196
 
197
        return $this;
198
    }
199
 
200
    public static function fromCentimeters(float $value): float
201
    {
202
        return $value / 2.54;
203
    }
204
 
205
    public static function toCentimeters(float $value): float
206
    {
207
        return $value * 2.54;
208
    }
209
 
210
    public static function fromMillimeters(float $value): float
211
    {
212
        return $value / 25.4;
213
    }
214
 
215
    public static function toMillimeters(float $value): float
216
    {
217
        return $value * 25.4;
218
    }
219
 
220
    public static function fromPoints(float $value): float
221
    {
222
        return $value / 72;
223
    }
224
 
225
    public static function toPoints(float $value): float
226
    {
227
        return $value * 72;
228
    }
229
}