Overview

Packages

  • PHP
  • PHPWord

Classes

  • PHPWord
  • PHPWord_Autoloader
  • PHPWord_DocumentProperties
  • PHPWord_HashTable
  • PHPWord_IOFactory
  • PHPWord_Media
  • PHPWord_Section
  • PHPWord_Section_Footer
  • PHPWord_Section_Footer_PreserveText
  • PHPWord_Section_Header
  • PHPWord_Section_Image
  • PHPWord_Section_Link
  • PHPWord_Section_ListItem
  • PHPWord_Section_MemoryImage
  • PHPWord_Section_Object
  • PHPWord_Section_PageBreak
  • PHPWord_Section_Settings
  • PHPWord_Section_Table
  • PHPWord_Section_Table_Cell
  • PHPWord_Section_Table_Row
  • PHPWord_Section_Text
  • PHPWord_Section_TextBreak
  • PHPWord_Section_TextRun
  • PHPWord_Section_Title
  • PHPWord_Shared_Drawing
  • PHPWord_Shared_File
  • PHPWord_Shared_Font
  • PHPWord_Shared_String
  • PHPWord_Shared_XMLWriter
  • PHPWord_Shared_ZipStreamWrapper
  • PHPWord_Style
  • PHPWord_Style_Cell
  • PHPWord_Style_Font
  • PHPWord_Style_Image
  • PHPWord_Style_ListItem
  • PHPWord_Style_Paragraph
  • PHPWord_Style_Row
  • PHPWord_Style_Tab
  • PHPWord_Style_Table
  • PHPWord_Style_TableFull
  • PHPWord_Style_Tabs
  • PHPWord_Style_TOC
  • PHPWord_Template
  • PHPWord_TOC
  • PHPWord_Writer_ODText
  • PHPWord_Writer_ODText_Content
  • PHPWord_Writer_ODText_Manifest
  • PHPWord_Writer_ODText_Meta
  • PHPWord_Writer_ODText_Mimetype
  • PHPWord_Writer_ODText_Styles
  • PHPWord_Writer_ODText_WriterPart
  • PHPWord_Writer_RTF
  • PHPWord_Writer_Word2007
  • PHPWord_Writer_Word2007_Base
  • PHPWord_Writer_Word2007_ContentTypes
  • PHPWord_Writer_Word2007_DocProps
  • PHPWord_Writer_Word2007_Document
  • PHPWord_Writer_Word2007_DocumentRels
  • PHPWord_Writer_Word2007_Footer
  • PHPWord_Writer_Word2007_Header
  • PHPWord_Writer_Word2007_Rels
  • PHPWord_Writer_Word2007_Styles
  • PHPWord_Writer_Word2007_WriterPart

Interfaces

  • PHPWord_Writer_IWriter

Exceptions

  • PHPWord_Exception
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * PHPWord
  4:  *
  5:  * Copyright (c) 2013 PHPWord
  6:  *
  7:  * This library is free software; you can redistribute it and/or
  8:  * modify it under the terms of the GNU Lesser General Public
  9:  * License as published by the Free Software Foundation; either
 10:  * version 2.1 of the License, or (at your option) any later version.
 11:  *
 12:  * This library is distributed in the hope that it will be useful,
 13:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15:  * Lesser General Public License for more details.
 16:  *
 17:  * You should have received a copy of the GNU Lesser General Public
 18:  * License along with this library; if not, write to the Free Software
 19:  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 20:  *
 21:  * @category   PHPWord
 22:  * @package    PHPWord
 23:  * @copyright  Copyright (c) 2013 PHPWord
 24:  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
 25:  * @version    0.7.0
 26:  */
 27: 
 28: /**
 29:  * Class PHPWord_Style_TableFull
 30:  */
 31: class PHPWord_Style_TableFull
 32: {
 33: 
 34:     /**
 35:      * Style for first row
 36:      *
 37:      * @var PHPWord_Style_Table
 38:      */
 39:     private $_firstRow = null;
 40: 
 41:     /**
 42:      * Cell Margin Top
 43:      *
 44:      * @var int
 45:      */
 46:     private $_cellMarginTop = null;
 47: 
 48:     /**
 49:      * Cell Margin Left
 50:      *
 51:      * @var int
 52:      */
 53:     private $_cellMarginLeft = null;
 54: 
 55:     /**
 56:      * Cell Margin Right
 57:      *
 58:      * @var int
 59:      */
 60:     private $_cellMarginRight = null;
 61: 
 62:     /**
 63:      * Cell Margin Bottom
 64:      *
 65:      * @var int
 66:      */
 67:     private $_cellMarginBottom = null;
 68: 
 69:     /**
 70:      * Background-Color
 71:      *
 72:      * @var string
 73:      */
 74:     private $_bgColor;
 75: 
 76:     /**
 77:      * Border Top Size
 78:      *
 79:      * @var int
 80:      */
 81:     private $_borderTopSize;
 82: 
 83:     /**
 84:      * Border Top Color
 85:      *
 86:      * @var string
 87:      */
 88:     private $_borderTopColor;
 89: 
 90:     /**
 91:      * Border Left Size
 92:      *
 93:      * @var int
 94:      */
 95:     private $_borderLeftSize;
 96: 
 97:     /**
 98:      * Border Left Color
 99:      *
100:      * @var string
101:      */
102:     private $_borderLeftColor;
103: 
104:     /**
105:      * Border Right Size
106:      *
107:      * @var int
108:      */
109:     private $_borderRightSize;
110: 
111:     /**
112:      * Border Right Color
113:      *
114:      * @var string
115:      */
116:     private $_borderRightColor;
117: 
118:     /**
119:      * Border Bottom Size
120:      *
121:      * @var int
122:      */
123:     private $_borderBottomSize;
124: 
125:     /**
126:      * Border Bottom Color
127:      *
128:      * @var string
129:      */
130:     private $_borderBottomColor;
131: 
132:     /**
133:      * Border InsideH Size
134:      *
135:      * @var int
136:      */
137:     private $_borderInsideHSize;
138: 
139:     /**
140:      * Border InsideH Color
141:      *
142:      * @var string
143:      */
144:     private $_borderInsideHColor;
145: 
146:     /**
147:      * Border InsideV Size
148:      *
149:      * @var int
150:      */
151:     private $_borderInsideVSize;
152: 
153:     /**
154:      * Border InsideV Color
155:      *
156:      * @var string
157:      */
158:     private $_borderInsideVColor;
159: 
160: 
161:     /**
162:      * Create a new TableFull Font
163:      */
164:     public function __construct($styleTable = null, $styleFirstRow = null, $styleLastRow = null)
165:     {
166: 
167:         if (!is_null($styleFirstRow) && is_array($styleFirstRow)) {
168:             $this->_firstRow = clone $this;
169: 
170:             unset($this->_firstRow->_firstRow);
171:             unset($this->_firstRow->_cellMarginBottom);
172:             unset($this->_firstRow->_cellMarginTop);
173:             unset($this->_firstRow->_cellMarginLeft);
174:             unset($this->_firstRow->_cellMarginRight);
175:             unset($this->_firstRow->_borderInsideVColor);
176:             unset($this->_firstRow->_borderInsideVSize);
177:             unset($this->_firstRow->_borderInsideHColor);
178:             unset($this->_firstRow->_borderInsideHSize);
179:             foreach ($styleFirstRow as $key => $value) {
180:                 if (substr($key, 0, 1) != '_') {
181:                     $key = '_' . $key;
182:                 }
183: 
184:                 $this->_firstRow->setStyleValue($key, $value);
185:             }
186:         }
187: 
188:         if (!is_null($styleTable) && is_array($styleTable)) {
189:             foreach ($styleTable as $key => $value) {
190:                 if (substr($key, 0, 1) != '_') {
191:                     $key = '_' . $key;
192:                 }
193:                 $this->setStyleValue($key, $value);
194:             }
195:         }
196:     }
197: 
198:     /**
199:      * Set style value
200:      *
201:      * @param string $key
202:      * @param mixed $value
203:      */
204:     public function setStyleValue($key, $value)
205:     {
206:         if ($key == '_borderSize') {
207:             $this->setBorderSize($value);
208:         } elseif ($key == '_borderColor') {
209:             $this->setBorderColor($value);
210:         } elseif ($key == '_cellMargin') {
211:             $this->setCellMargin($value);
212:         } else {
213:             $this->$key = $value;
214:         }
215:     }
216: 
217:     /**
218:      * Get First Row Style
219:      *
220:      * @return PHPWord_Style_TableFull
221:      */
222:     public function getFirstRow()
223:     {
224:         return $this->_firstRow;
225:     }
226: 
227:     /**
228:      * Get Last Row Style
229:      *
230:      * @return PHPWord_Style_TableFull
231:      */
232:     public function getLastRow()
233:     {
234:         return $this->_lastRow;
235:     }
236: 
237:     public function getBgColor()
238:     {
239:         return $this->_bgColor;
240:     }
241: 
242:     public function setBgColor($pValue = null)
243:     {
244:         $this->_bgColor = $pValue;
245:     }
246: 
247:     /**
248:      * Set TLRBVH Border Size
249:      *
250:      * @param int $pValue
251:      */
252:     public function setBorderSize($pValue = null)
253:     {
254:         $this->_borderTopSize = $pValue;
255:         $this->_borderLeftSize = $pValue;
256:         $this->_borderRightSize = $pValue;
257:         $this->_borderBottomSize = $pValue;
258:         $this->_borderInsideHSize = $pValue;
259:         $this->_borderInsideVSize = $pValue;
260:     }
261: 
262:     /**
263:      * Get TLRBVH Border Size
264:      *
265:      * @return array
266:      */
267:     public function getBorderSize()
268:     {
269:         $t = $this->getBorderTopSize();
270:         $l = $this->getBorderLeftSize();
271:         $r = $this->getBorderRightSize();
272:         $b = $this->getBorderBottomSize();
273:         $h = $this->getBorderInsideHSize();
274:         $v = $this->getBorderInsideVSize();
275: 
276:         return array($t, $l, $r, $b, $h, $v);
277:     }
278: 
279:     /**
280:      * Set TLRBVH Border Color
281:      */
282:     public function setBorderColor($pValue = null)
283:     {
284:         $this->_borderTopColor = $pValue;
285:         $this->_borderLeftColor = $pValue;
286:         $this->_borderRightColor = $pValue;
287:         $this->_borderBottomColor = $pValue;
288:         $this->_borderInsideHColor = $pValue;
289:         $this->_borderInsideVColor = $pValue;
290:     }
291: 
292:     /**
293:      * Get TLRB Border Color
294:      *
295:      * @return array
296:      */
297:     public function getBorderColor()
298:     {
299:         $t = $this->getBorderTopColor();
300:         $l = $this->getBorderLeftColor();
301:         $r = $this->getBorderRightColor();
302:         $b = $this->getBorderBottomColor();
303:         $h = $this->getBorderInsideHColor();
304:         $v = $this->getBorderInsideVColor();
305: 
306:         return array($t, $l, $r, $b, $h, $v);
307:     }
308: 
309:     public function setBorderTopSize($pValue = null)
310:     {
311:         $this->_borderTopSize = $pValue;
312:     }
313: 
314:     public function getBorderTopSize()
315:     {
316:         return $this->_borderTopSize;
317:     }
318: 
319:     public function setBorderTopColor($pValue = null)
320:     {
321:         $this->_borderTopColor = $pValue;
322:     }
323: 
324:     public function getBorderTopColor()
325:     {
326:         return $this->_borderTopColor;
327:     }
328: 
329:     public function setBorderLeftSize($pValue = null)
330:     {
331:         $this->_borderLeftSize = $pValue;
332:     }
333: 
334:     public function getBorderLeftSize()
335:     {
336:         return $this->_borderLeftSize;
337:     }
338: 
339:     public function setBorderLeftColor($pValue = null)
340:     {
341:         $this->_borderLeftColor = $pValue;
342:     }
343: 
344:     public function getBorderLeftColor()
345:     {
346:         return $this->_borderLeftColor;
347:     }
348: 
349:     public function setBorderRightSize($pValue = null)
350:     {
351:         $this->_borderRightSize = $pValue;
352:     }
353: 
354:     public function getBorderRightSize()
355:     {
356:         return $this->_borderRightSize;
357:     }
358: 
359:     public function setBorderRightColor($pValue = null)
360:     {
361:         $this->_borderRightColor = $pValue;
362:     }
363: 
364:     public function getBorderRightColor()
365:     {
366:         return $this->_borderRightColor;
367:     }
368: 
369:     public function setBorderBottomSize($pValue = null)
370:     {
371:         $this->_borderBottomSize = $pValue;
372:     }
373: 
374:     public function getBorderBottomSize()
375:     {
376:         return $this->_borderBottomSize;
377:     }
378: 
379:     public function setBorderBottomColor($pValue = null)
380:     {
381:         $this->_borderBottomColor = $pValue;
382:     }
383: 
384:     public function getBorderBottomColor()
385:     {
386:         return $this->_borderBottomColor;
387:     }
388: 
389:     public function setBorderInsideHColor($pValue = null)
390:     {
391:         $this->_borderInsideHColor = $pValue;
392:     }
393: 
394:     public function getBorderInsideHColor()
395:     {
396:         return (isset($this->_borderInsideHColor)) ? $this->_borderInsideHColor : null;
397:     }
398: 
399:     public function setBorderInsideVColor($pValue = null)
400:     {
401:         $this->_borderInsideVColor = $pValue;
402:     }
403: 
404:     public function getBorderInsideVColor()
405:     {
406:         return (isset($this->_borderInsideVColor)) ? $this->_borderInsideVColor : null;
407:     }
408: 
409:     public function setBorderInsideHSize($pValue = null)
410:     {
411:         $this->_borderInsideHSize = $pValue;
412:     }
413: 
414:     public function getBorderInsideHSize()
415:     {
416:         return (isset($this->_borderInsideHSize)) ? $this->_borderInsideHSize : null;
417:     }
418: 
419:     public function setBorderInsideVSize($pValue = null)
420:     {
421:         $this->_borderInsideVSize = $pValue;
422:     }
423: 
424:     public function getBorderInsideVSize()
425:     {
426:         return (isset($this->_borderInsideVSize)) ? $this->_borderInsideVSize : null;
427:     }
428: 
429:     public function setCellMarginTop($pValue = null)
430:     {
431:         $this->_cellMarginTop = $pValue;
432:     }
433: 
434:     public function getCellMarginTop()
435:     {
436:         return $this->_cellMarginTop;
437:     }
438: 
439:     public function setCellMarginLeft($pValue = null)
440:     {
441:         $this->_cellMarginLeft = $pValue;
442:     }
443: 
444:     public function getCellMarginLeft()
445:     {
446:         return $this->_cellMarginLeft;
447:     }
448: 
449:     public function setCellMarginRight($pValue = null)
450:     {
451:         $this->_cellMarginRight = $pValue;
452:     }
453: 
454:     public function getCellMarginRight()
455:     {
456:         return $this->_cellMarginRight;
457:     }
458: 
459:     public function setCellMarginBottom($pValue = null)
460:     {
461:         $this->_cellMarginBottom = $pValue;
462:     }
463: 
464:     public function getCellMarginBottom()
465:     {
466:         return $this->_cellMarginBottom;
467:     }
468: 
469:     public function setCellMargin($pValue = null)
470:     {
471:         $this->_cellMarginTop = $pValue;
472:         $this->_cellMarginLeft = $pValue;
473:         $this->_cellMarginRight = $pValue;
474:         $this->_cellMarginBottom = $pValue;
475:     }
476: 
477:     public function getCellMargin()
478:     {
479:         return array($this->_cellMarginTop, $this->_cellMarginLeft, $this->_cellMarginRight, $this->_cellMarginBottom);
480:     }
481: }
482: 
PHPWord API Docs API documentation generated by ApiGen 2.8.0