DocBlock corrections

This commit is contained in:
Ivan Lanin 2014-03-17 07:26:25 +07:00
parent 12a79779bf
commit fca9e532cf
51 changed files with 984 additions and 109 deletions

View File

@ -188,8 +188,8 @@ class PHPWord
/**
* Adds a paragraph style definition to styles.xml
*
* @param $styleName string
* @param $styles array
* @param string $styleName
* @param array $styles
*/
public function addParagraphStyle($styleName, $styles)
{
@ -199,8 +199,9 @@ class PHPWord
/**
* Adds a font style definition to styles.xml
*
* @param $styleName string
* @param $styles array
* @param string $styleName
* @param array $styleFont
* @param array $styleParagraph
*/
public function addFontStyle($styleName, $styleFont, $styleParagraph = null)
{
@ -210,8 +211,9 @@ class PHPWord
/**
* Adds a table style definition to styles.xml
*
* @param $styleName string
* @param $styles array
* @param string $styleName
* @param array $styleTable
* @param array $styleFirstRow
*/
public function addTableStyle($styleName, $styleTable, $styleFirstRow = null)
{
@ -221,8 +223,9 @@ class PHPWord
/**
* Adds a heading style definition to styles.xml
*
* @param $titleCount int
* @param $styles array
* @param int $titleCount
* @param array $styleFont
* @param array $styleParagraph
*/
public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null)
{
@ -232,8 +235,8 @@ class PHPWord
/**
* Adds a hyperlink style to styles.xml
*
* @param $styleName string
* @param $styles array
* @param string $styleName
* @param array $styles
*/
public function addLinkStyle($styleName, $styles)
{

View File

@ -69,7 +69,7 @@ class PHPWord_Autoloader
/**
* Autoloader
*
* @param string
* @param string $class
*/
public static function autoload($class)
{

View File

@ -1,4 +1,29 @@
<?php
/**
* PHPWord
*
* Copyright (c) 2014 PHPWord
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0
*/
namespace PhpOffice\PhpWord\Exceptions;
/**

View File

@ -1,4 +1,29 @@
<?php
/**
* PHPWord
*
* Copyright (c) 2014 PHPWord
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0
*/
namespace PhpOffice\PhpWord\Exceptions;
/**

View File

@ -1,4 +1,29 @@
<?php
/**
* PHPWord
*
* Copyright (c) 2014 PHPWord
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0
*/
namespace PhpOffice\PhpWord\Exceptions;
use InvalidArgumentException;

View File

@ -1,4 +1,29 @@
<?php
/**
* PHPWord
*
* Copyright (c) 2014 PHPWord
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0
*/
namespace PhpOffice\PhpWord\Exceptions;
/**

View File

@ -86,8 +86,7 @@ class PHPWord_Footnote
/**
* Add new Footnote Link Element
*
* @param string $src
* @param string $type
* @param string $linkSrc
*
* @return mixed
*/

View File

@ -42,6 +42,8 @@ abstract class PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
protected $readDataOnly = true;
/**
* File pointer
*
* @var bool|resource
*/
protected $fileHandle = true;

View File

@ -54,6 +54,8 @@ class PHPWord_Section_Footer
/**
* Create a new Footer
*
* @param int $sectionCount
*/
public function __construct($sectionCount)
{
@ -95,6 +97,7 @@ class PHPWord_Section_Footer
/**
* Create a new TextRun
*
* @param null|string|array|PHPWord_Style_Paragraph $styleParagraph
* @return PHPWord_Section_TextRun
*/
public function createTextRun($styleParagraph = null)

View File

@ -56,8 +56,10 @@ class PHPWord_Section_Footer_PreserveText
/**
* Create a new Preserve Text Element
*
* @var string $text
* @var mixed $style
* @param string $text
* @param mixed $styleFont
* @param mixed $styleParagraph
* @return PHPWord_Section_Footer_PreserveText
*/
public function __construct($text = null, $styleFont = null, $styleParagraph = null)
{

View File

@ -54,6 +54,8 @@ class PHPWord_Section_Footnote
/**
* Create a new Footnote Element
*
* @param mixed $styleParagraph
*/
public function __construct($styleParagraph = null)
{
@ -78,8 +80,8 @@ class PHPWord_Section_Footnote
/**
* Add a Text Element
*
* @var string $text
* @var mixed $styleFont
* @param null|string $text
* @param mixed $styleFont
* @return PHPWord_Section_Text
*/
public function addText($text = null, $styleFont = null)

View File

@ -83,6 +83,8 @@ class PHPWord_Section_Header
/**
* Create a new Header
*
* @param int $sectionCount
*/
public function __construct($sectionCount)
{
@ -124,6 +126,7 @@ class PHPWord_Section_Header
/**
* Create a new TextRun
*
* @param mixed $styleParagraph
* @return PHPWord_Section_TextRun
*/
public function createTextRun($styleParagraph = null)

View File

@ -70,10 +70,10 @@ class PHPWord_Section_Link
/**
* Create a new Link Element
*
* @var string $linkSrc
* @var string $linkName
* @var mixed $styleFont
* @var mixed $styleParagraph
* @param string $linkSrc
* @param string $linkName
* @param mixed $styleFont
* @param mixed $styleParagraph
*/
public function __construct($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null)
{

View File

@ -58,8 +58,9 @@ class PHPWord_Section_ListItem
*
* @param string $text
* @param int $depth
* @param mixed $styleText
* @param mixed $styleFont
* @param mixed $styleList
* @param mixed $styleParagraph
*/
public function __construct($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null)
{

View File

@ -158,11 +158,15 @@ class PHPWord_Section_Settings
private $pageNumberingStart;
/**
* Header height
*
* @var int
*/
private $headerHeight;
/**
* Footer height
*
* @var int
*/
private $footerHeight;
@ -594,6 +598,8 @@ class PHPWord_Section_Settings
}
/**
* Set page numbering start
*
* @param null|int $pageNumberingStart
* @return $this
*/
@ -604,6 +610,8 @@ class PHPWord_Section_Settings
}
/**
* Get page numbering start
*
* @return null|int
*/
public function getPageNumberingStart()

View File

@ -99,6 +99,7 @@ class PHPWord_Section_Table
* Add a row
*
* @param int $height
* @param mixed $style
*/
public function addRow($height = null, $style = null)
{
@ -144,7 +145,7 @@ class PHPWord_Section_Table
/**
* Set table width
*
* @var int $width
* @param int $width
*/
public function setWidth($width)
{

View File

@ -100,7 +100,8 @@ class PHPWord_Section_Table_Cell
* Add a Text Element
*
* @param string $text
* @param mixed $style
* @param mixed $styleFont
* @param mixed $styleParagraph
* @return PHPWord_Section_Text
*/
public function addText($text, $styleFont = null, $styleParagraph = null)
@ -299,6 +300,7 @@ class PHPWord_Section_Table_Cell
/**
* Create a new TextRun
*
* @param mixed $styleParagraph
* @return PHPWord_Section_TextRun
*/
public function createTextRun($styleParagraph = null)

View File

@ -131,6 +131,8 @@ class PHPWord_Section_Text
}
/**
* Set text content
*
* @param string $text
* @return $this
*/

View File

@ -46,6 +46,9 @@ class PHPWord_Section_TextBreak
/**
* Create a new TextBreak Element
*
* @param mixed $fontStyle
* @param mixed $paragraphStyle
*/
public function __construct($fontStyle = null, $paragraphStyle = null)
{
@ -60,8 +63,8 @@ class PHPWord_Section_TextBreak
/**
* Set Text style
*
* @param null|array|\PHPWord_Style_Font $style
* @param null|array|\PHPWord_Style_Paragraph $paragraphStyle
* @param mixed $style
* @param mixed $paragraphStyle
* @return PHPWord_Style_Font
*/
public function setFontStyle($style = null, $paragraphStyle = null)

View File

@ -48,6 +48,8 @@ class PHPWord_Section_TextRun
/**
* Create a new TextRun Element
*
* @param mixed $styleParagraph
*/
public function __construct($styleParagraph = null)
{
@ -72,8 +74,8 @@ class PHPWord_Section_TextRun
/**
* Add a Text Element
*
* @var string $text
* @var mixed $styleFont
* @param string $text
* @param mixed $styleFont
* @return PHPWord_Section_Text
*/
public function addText($text = null, $styleFont = null)
@ -113,7 +115,7 @@ class PHPWord_Section_TextRun
* Add a Image Element
*
* @param string $imageSrc
* @param mixed $styleFont
* @param mixed $style
* @return PHPWord_Section_Image
*/
public function addImage($imageSrc, $style = null)
@ -134,9 +136,9 @@ class PHPWord_Section_TextRun
/**
* Add TextBreak
*
* @param int $count
* @param null|string|array|PHPWord_Style_Font $fontStyle
* @param null|string|array|PHPWord_Style_Paragraph $paragraphStyle
* @param int $count
* @param mixed $fontStyle
* @param mixed $paragraphStyle
*/
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{
@ -148,7 +150,7 @@ class PHPWord_Section_TextRun
/**
* Create a new Footnote Element
*
* @param string $text
* @param mixed $styleParagraph
* @return PHPWord_Section_Footnote
*/
public function createFootnote($styleParagraph = null)

View File

@ -70,8 +70,9 @@ class PHPWord_Section_Title
/**
* Create a new Title Element
*
* @var string $text
* @var int $depth
* @param string $text
* @param int $depth
* @param mixed $style
*/
public function __construct($text, $depth = 1, $style = null)
{
@ -88,7 +89,7 @@ class PHPWord_Section_Title
/**
* Set Anchor
*
* @var int $anchor
* @param int $anchor
*/
public function setAnchor($anchor)
{
@ -108,7 +109,7 @@ class PHPWord_Section_Title
/**
* Set Bookmark ID
*
* @var int $bookmarkId
* @param int $bookmarkId
*/
public function setBookmarkId($bookmarkId)
{

View File

@ -44,8 +44,8 @@ class PHPWord_Shared_Font
/**
* Calculate an (approximate) pixel size, based on inch size
*
* @param int $sizeInInch Font size (in inch)
* @return int Size (in pixels)
* @param int $sizeInInch Font size (in inch)
* @return int Size (in pixels)
*/
public static function inchSizeToPixels($sizeInInch = 1)
{
@ -55,24 +55,42 @@ class PHPWord_Shared_Font
/**
* Calculate an (approximate) pixel size, based on centimeter size
*
* @param int $sizeInCm Font size (in centimeters)
* @return int Size (in pixels)
* @param int $sizeInCm Font size (in centimeters)
* @return int Size (in pixels)
*/
public static function centimeterSizeToPixels($sizeInCm = 1)
{
return ($sizeInCm * 37.795275591);
}
/**
* Convert centimeter to twip
*
* @param int $sizeInCm
* @return int
*/
public static function centimeterSizeToTwips($sizeInCm = 1)
{
return ($sizeInCm * 565.217);
}
/**
* Convert inch to twip
*
* @param int $sizeInInch
* @return int
*/
public static function inchSizeToTwips($sizeInInch = 1)
{
return self::centimeterSizeToTwips($sizeInInch * 2.54);
}
/**
* Convert pixel to twip
*
* @param int $sizeInPixel
* @return int
*/
public static function pixelSizeToTwips($sizeInPixel = 1)
{
return self::centimeterSizeToTwips($sizeInPixel / 37.795275591);

View File

@ -109,7 +109,7 @@ class PHPWord_Shared_XMLWriter
/**
* Get written data
*
* @return $data
* @return string XML data
*/
public function getData()
{
@ -124,8 +124,8 @@ class PHPWord_Shared_XMLWriter
/**
* Catch function calls (and pass them to internal XMLWriter)
*
* @param unknown_type $function
* @param unknown_type $args
* @param mixed $function
* @param mixed $args
*/
public function __call($function, $args)
{

View File

@ -71,6 +71,11 @@ class PHPWord_Shared_ZipStreamWrapper
/**
* Open stream
*
* @param string $path
* @param string $mode
* @param string $options
* @param string $opened_path
*/
public function stream_open($path, $mode, $options, &$opened_path)
{
@ -119,6 +124,8 @@ class PHPWord_Shared_ZipStreamWrapper
/**
* Read stream
*
* @param int $count
*/
public function stream_read($count)
{
@ -145,6 +152,9 @@ class PHPWord_Shared_ZipStreamWrapper
/**
* Seek stream
*
* @param int $offset
* @param mixed $whence
*/
public function stream_seek($offset, $whence)
{

View File

@ -106,7 +106,9 @@ class PHPWord_Style
* Add a table style
*
* @param string $styleName
* @param array $styles
* @param array $styleTable
* @param null|array $styleFirstRow
* @param null|array $styleLastRow
*/
public static function addTableStyle($styleName, $styleTable, $styleFirstRow = null, $styleLastRow = null)
{
@ -120,9 +122,9 @@ class PHPWord_Style
/**
* Add a title style
*
* @param string $styleName
* @param int $titleCount
* @param array $styleFont
* @param array $styleParagraph
* @param nullarray $styleParagraph
*/
public static function addTitleStyle($titleCount, $styleFont, $styleParagraph = null)
{
@ -143,7 +145,7 @@ class PHPWord_Style
/**
* Set default paragraph style
*
* @param array $styles Paragraph style definition
* @param array $styles Paragraph style definition
*/
public static function setDefaultParagraphStyle($styles)
{
@ -153,7 +155,7 @@ class PHPWord_Style
/**
* Get all styles
*
* @return PHPWord_Style_Font[]
* @return array
*/
public static function getStyles()
{
@ -163,8 +165,8 @@ class PHPWord_Style
/**
* Get style
*
* @param string
* @return PHPWord_Style
* @param string $styleName
* @return null|PHPWord_Style
*/
public static function getStyle($styleName)
{

View File

@ -157,8 +157,8 @@ class PHPWord_Style_Cell
/**
* Set style value
*
* @var string $key
* @var mixed $value
* @param string $key
* @param mixed $value
*/
public function setStyleValue($key, $value)
{
@ -171,36 +171,65 @@ class PHPWord_Style_Cell
}
}
/**
* Get vertical align
*/
public function getVAlign()
{
return $this->_valign;
}
/**
* Set vertical align
*
* @param string $pValue
*/
public function setVAlign($pValue = null)
{
$this->_valign = $pValue;
}
/**
* Get text direction
*/
public function getTextDirection()
{
return $this->_textDirection;
}
/**
* Set text direction
*
* @param string $pValue
*/
public function setTextDirection($pValue = null)
{
$this->_textDirection = $pValue;
}
/**
* Get background color
*/
public function getBgColor()
{
return $this->_bgColor;
}
/**
* Set background color
*
* @param string $pValue
*/
public function setBgColor($pValue = null)
{
$this->_bgColor = $pValue;
}
/**
* Set border size
*
* @param int $pValue
*/
public function setBorderSize($pValue = null)
{
$this->_borderTopSize = $pValue;
@ -209,6 +238,9 @@ class PHPWord_Style_Cell
$this->_borderBottomSize = $pValue;
}
/**
* Get border size
*/
public function getBorderSize()
{
$t = $this->getBorderTopSize();
@ -219,6 +251,11 @@ class PHPWord_Style_Cell
return array($t, $l, $r, $b);
}
/**
* Set border color
*
* @param string $pValue
*/
public function setBorderColor($pValue = null)
{
$this->_borderTopColor = $pValue;
@ -227,6 +264,9 @@ class PHPWord_Style_Cell
$this->_borderBottomColor = $pValue;
}
/**
* Get border color
*/
public function getBorderColor()
{
$t = $this->getBorderTopColor();
@ -237,107 +277,189 @@ class PHPWord_Style_Cell
return array($t, $l, $r, $b);
}
/**
* Set border top size
*
* @param int $pValue
*/
public function setBorderTopSize($pValue = null)
{
$this->_borderTopSize = $pValue;
}
/**
* Get border top size
*/
public function getBorderTopSize()
{
return $this->_borderTopSize;
}
/**
* Set border top color
*
* @param string $pValue
*/
public function setBorderTopColor($pValue = null)
{
$this->_borderTopColor = $pValue;
}
/**
* Get border top color
*/
public function getBorderTopColor()
{
return $this->_borderTopColor;
}
/**
* Set border left size
*
* @param int $pValue
*/
public function setBorderLeftSize($pValue = null)
{
$this->_borderLeftSize = $pValue;
}
/**
* Get border left size
*/
public function getBorderLeftSize()
{
return $this->_borderLeftSize;
}
/**
* Set border left color
*
* @param string $pValue
*/
public function setBorderLeftColor($pValue = null)
{
$this->_borderLeftColor = $pValue;
}
/**
* Get border left color
*/
public function getBorderLeftColor()
{
return $this->_borderLeftColor;
}
/**
* Set border right size
*
* @param int $pValue
*/
public function setBorderRightSize($pValue = null)
{
$this->_borderRightSize = $pValue;
}
/**
* Get border right size
*/
public function getBorderRightSize()
{
return $this->_borderRightSize;
}
/**
* Set border right color
*
* @param string $pValue
*/
public function setBorderRightColor($pValue = null)
{
$this->_borderRightColor = $pValue;
}
/**
* Get border right color
*/
public function getBorderRightColor()
{
return $this->_borderRightColor;
}
/**
* Set border bottom size
*
* @param int $pValue
*/
public function setBorderBottomSize($pValue = null)
{
$this->_borderBottomSize = $pValue;
}
/**
* Get border bottom size
*/
public function getBorderBottomSize()
{
return $this->_borderBottomSize;
}
/**
* Set border bottom color
*
* @param string $pValue
*/
public function setBorderBottomColor($pValue = null)
{
$this->_borderBottomColor = $pValue;
}
/**
* Get border bottom color
*/
public function getBorderBottomColor()
{
return $this->_borderBottomColor;
}
/**
* Get default border color
*/
public function getDefaultBorderColor()
{
return $this->_defaultBorderColor;
}
/**
* Set grid span (colspan)
*
* @param int $pValue
*/
public function setGridSpan($pValue = null)
{
$this->_gridSpan = $pValue;
}
/**
* Get grid span (colspan)
*/
public function getGridSpan()
{
return $this->_gridSpan;
}
/**
* Set vertical merge (rowspan)
*
* @param string $pValue
*/
public function setVMerge($pValue = null)
{
$this->_vMerge = $pValue;
}
/**
* Get vertical merge (rowspan)
*/
public function getVMerge()
{
return $this->_vMerge;

View File

@ -185,6 +185,8 @@ class PHPWord_Style_Font
}
/**
* Set style using associative array
*
* @param array $style
* @return $this
*/
@ -510,6 +512,8 @@ class PHPWord_Style_Font
}
/**
* Get line height
*
* @return int|float
*/
public function getLineHeight()

View File

@ -36,9 +36,32 @@ class PHPWord_Style_Image
const WRAPPING_STYLE_BEHIND = 'behind';
const WRAPPING_STYLE_INFRONT = 'infront';
/**
* Image width
*
* @var int
*/
private $_width;
/**
* Image width
*
* @var int
*/
private $_height;
/**
* Alignment
*
* @var string
*/
private $_align;
/**
* Wrapping style
*
* @var string
*/
private $wrappingStyle;
/**
@ -55,6 +78,9 @@ class PHPWord_Style_Image
*/
private $_marginLeft;
/**
* Constructor
*/
public function __construct()
{
$this->_width = null;
@ -65,36 +91,66 @@ class PHPWord_Style_Image
$this->setWrappingStyle(self::WRAPPING_STYLE_INLINE);
}
/**
* Set style value
*
* @param string $key
* @param mixed $value
*/
public function setStyleValue($key, $value)
{
$this->$key = $value;
}
/**
* Get width
*/
public function getWidth()
{
return $this->_width;
}
/**
* Set width
*
* @param int $pValue
*/
public function setWidth($pValue = null)
{
$this->_width = $pValue;
}
/**
* Get height
*/
public function getHeight()
{
return $this->_height;
}
/**
* Set height
*
* @param int $pValue
*/
public function setHeight($pValue = null)
{
$this->_height = $pValue;
}
/**
* Get alignment
*/
public function getAlign()
{
return $this->_align;
}
/**
* Set alignment
*
* @param string $pValue
*/
public function setAlign($pValue = null)
{
$this->_align = $pValue;
@ -145,6 +201,8 @@ class PHPWord_Style_Image
}
/**
* Set wrapping style
*
* @param string $wrappingStyle
* @throws InvalidArgumentException
* @return $this
@ -167,6 +225,8 @@ class PHPWord_Style_Image
}
/**
* Get wrapping style
*
* @return string
*/
public function getWrappingStyle()

View File

@ -133,6 +133,8 @@ class PHPWord_Style_Paragraph
private $_pageBreakBefore = false;
/**
* Set style using associative array
*
* @param array $style
* @return $this
*/
@ -319,11 +321,11 @@ class PHPWord_Style_Paragraph
return $this->_tabs;
}
/*
/**
* Set tabs
*
* @param array $pValue
* @return PHPWord_Style_Paragraph
* @param array $pValue
* @return PHPWord_Style_Paragraph
*/
public function setTabs($pValue = null)
{
@ -500,6 +502,8 @@ class PHPWord_Style_Paragraph
}
/**
* Get line height
*
* @return int|float
*/
public function getLineHeight()

View File

@ -54,12 +54,21 @@ class PHPWord_Style_Row
/**
* Set style value
*
* @param string $key
* @param mixed $value
*/
public function setStyleValue($key, $value)
{
$this->$key = $value;
}
/**
* Set tblHeader
*
* @param boolean $pValue
* @return PHPWord_Style_Row
*/
public function setTblHeader($pValue = false)
{
if (!is_bool($pValue)) {
@ -69,11 +78,22 @@ class PHPWord_Style_Row
return $this;
}
/**
* Get tblHeader
*
* @return boolean
*/
public function getTblHeader()
{
return $this->_tblHeader;
}
/**
* Set cantSplit
*
* @param boolean $pValue
* @return PHPWord_Style_Row
*/
public function setCantSplit($pValue = false)
{
if (!is_bool($pValue)) {
@ -83,6 +103,11 @@ class PHPWord_Style_Row
return $this;
}
/**
* Get cantSplit
*
* @return boolean
*/
public function getCantSplit()
{
return $this->_cantSplit;

View File

@ -30,12 +30,37 @@
*/
class PHPWord_Style_Table
{
/**
* Cell margin top
*
* @var int
*/
private $_cellMarginTop;
/**
* Cell margin left
*
* @var int
*/
private $_cellMarginLeft;
/**
* Cell margin right
*
* @var int
*/
private $_cellMarginRight;
/**
* Cell margin bottom
*
* @var int
*/
private $_cellMarginBottom;
/**
* Constructor
*/
public function __construct()
{
$this->_cellMarginTop = null;
@ -44,51 +69,92 @@ class PHPWord_Style_Table
$this->_cellMarginBottom = null;
}
/**
* Set style value
*
* @param string $key
* @param mixed $value
*/
public function setStyleValue($key, $value)
{
$this->$key = $value;
}
/**
* Set cell margin top
*
* @param int $pValue
*/
public function setCellMarginTop($pValue = null)
{
$this->_cellMarginTop = $pValue;
}
/**
* Get cell margin top
*/
public function getCellMarginTop()
{
return $this->_cellMarginTop;
}
/**
* Set cell margin left
*
* @param int $pValue
*/
public function setCellMarginLeft($pValue = null)
{
$this->_cellMarginLeft = $pValue;
}
/**
* Get cell margin left
*/
public function getCellMarginLeft()
{
return $this->_cellMarginLeft;
}
/**
* Set cell margin right
*
* @param int $pValue
*/
public function setCellMarginRight($pValue = null)
{
$this->_cellMarginRight = $pValue;
}
/**
* Get cell margin right
*/
public function getCellMarginRight()
{
return $this->_cellMarginRight;
}
/**
* Set cell margin bottom
*
* @param int $pValue
*/
public function setCellMarginBottom($pValue = null)
{
$this->_cellMarginBottom = $pValue;
}
/**
* Get cell margin bottom
*/
public function getCellMarginBottom()
{
return $this->_cellMarginBottom;
}
/**
* Get cell margin
*/
public function getCellMargin()
{
return array($this->_cellMarginTop, $this->_cellMarginLeft, $this->_cellMarginRight, $this->_cellMarginBottom);

View File

@ -30,7 +30,6 @@
*/
class PHPWord_Style_TableFull
{
/**
* Style for first row
*
@ -160,6 +159,10 @@ class PHPWord_Style_TableFull
/**
* Create a new TableFull Font
*
* @param null|array $styleTable
* @param null|array $styleFirstRow
* @param null|array $styleLastRow
*/
public function __construct($styleTable = null, $styleFirstRow = null, $styleLastRow = null)
{
@ -234,11 +237,19 @@ class PHPWord_Style_TableFull
return $this->_lastRow;
}
/**
* Get background color
*/
public function getBgColor()
{
return $this->_bgColor;
}
/**
* Set background color
*
* @param string $pValue
*/
public function setBgColor($pValue = null)
{
$this->_bgColor = $pValue;
@ -247,7 +258,7 @@ class PHPWord_Style_TableFull
/**
* Set TLRBVH Border Size
*
* @param int $pValue Border size in eighths of a point (1/8 point)
* @param int $pValue Border size in eighths of a point (1/8 point)
*/
public function setBorderSize($pValue = null)
{
@ -278,6 +289,8 @@ class PHPWord_Style_TableFull
/**
* Set TLRBVH Border Color
*
* @param string $pValue
*/
public function setBorderColor($pValue = null)
{
@ -306,161 +319,293 @@ class PHPWord_Style_TableFull
return array($t, $l, $r, $b, $h, $v);
}
/**
* Set border top size
*
* @param int $pValue
*/
public function setBorderTopSize($pValue = null)
{
$this->_borderTopSize = $pValue;
}
/**
* Get border top size
*/
public function getBorderTopSize()
{
return $this->_borderTopSize;
}
/**
* Set border top color
*
* @param string $pValue
*/
public function setBorderTopColor($pValue = null)
{
$this->_borderTopColor = $pValue;
}
/**
* Get border top color
*/
public function getBorderTopColor()
{
return $this->_borderTopColor;
}
/**
* Set border left size
*
* @param int $pValue
*/
public function setBorderLeftSize($pValue = null)
{
$this->_borderLeftSize = $pValue;
}
/**
* Get border left size
*/
public function getBorderLeftSize()
{
return $this->_borderLeftSize;
}
/**
* Set border left color
*
* @param string $pValue
*/
public function setBorderLeftColor($pValue = null)
{
$this->_borderLeftColor = $pValue;
}
/**
* Get border left color
*/
public function getBorderLeftColor()
{
return $this->_borderLeftColor;
}
/**
* Set border right size
*
* @param int $pValue
*/
public function setBorderRightSize($pValue = null)
{
$this->_borderRightSize = $pValue;
}
/**
* Get border right size
*
* @param int $pValue
*/
public function getBorderRightSize()
{
return $this->_borderRightSize;
}
/**
* Set border right color
*
* @param string $pValue
*/
public function setBorderRightColor($pValue = null)
{
$this->_borderRightColor = $pValue;
}
/**
* Get border right color
*/
public function getBorderRightColor()
{
return $this->_borderRightColor;
}
/**
* Set border bottom size
*
*
* @param string $pValue
* @param int $pValue
*/
public function setBorderBottomSize($pValue = null)
{
$this->_borderBottomSize = $pValue;
}
/**
* Get border bottom size
*/
public function getBorderBottomSize()
{
return $this->_borderBottomSize;
}
/**
* Set border bottom color
*
* @param string $pValue
*/
public function setBorderBottomColor($pValue = null)
{
$this->_borderBottomColor = $pValue;
}
/**
* Get border bottom color
*/
public function getBorderBottomColor()
{
return $this->_borderBottomColor;
}
/**
* Set border inside horizontal color
*
* @param string $pValue
*/
public function setBorderInsideHColor($pValue = null)
{
$this->_borderInsideHColor = $pValue;
}
/**
* Get border inside horizontal color
*/
public function getBorderInsideHColor()
{
return (isset($this->_borderInsideHColor)) ? $this->_borderInsideHColor : null;
}
/**
* Set border inside vertical color
*
* @param string $pValue
*/
public function setBorderInsideVColor($pValue = null)
{
$this->_borderInsideVColor = $pValue;
}
/**
* Get border inside vertical color
*/
public function getBorderInsideVColor()
{
return (isset($this->_borderInsideVColor)) ? $this->_borderInsideVColor : null;
}
/**
* Set border inside horizontal size
*
* @param int $pValue
*/
public function setBorderInsideHSize($pValue = null)
{
$this->_borderInsideHSize = $pValue;
}
/**
* Get border inside horizontal size
*/
public function getBorderInsideHSize()
{
return (isset($this->_borderInsideHSize)) ? $this->_borderInsideHSize : null;
}
/**
* Set border inside vertical size
*
* @param int $pValue
*/
public function setBorderInsideVSize($pValue = null)
{
$this->_borderInsideVSize = $pValue;
}
/**
* Get border inside vertical size
*/
public function getBorderInsideVSize()
{
return (isset($this->_borderInsideVSize)) ? $this->_borderInsideVSize : null;
}
/**
* Set cell margin top
*
* @param int $pValue
*/
public function setCellMarginTop($pValue = null)
{
$this->_cellMarginTop = $pValue;
}
/**
* Get cell margin top
*/
public function getCellMarginTop()
{
return $this->_cellMarginTop;
}
/**
* Set cell margin left
*
* @param int $pValue
*/
public function setCellMarginLeft($pValue = null)
{
$this->_cellMarginLeft = $pValue;
}
/**
* Get cell margin left
*/
public function getCellMarginLeft()
{
return $this->_cellMarginLeft;
}
/**
* Set cell margin right
*
* @param int $pValue
*/
public function setCellMarginRight($pValue = null)
{
$this->_cellMarginRight = $pValue;
}
/**
* Get cell margin right
*/
public function getCellMarginRight()
{
return $this->_cellMarginRight;
}
/**
* Set cell margin bottom
*
* @param int $pValue
*/
public function setCellMarginBottom($pValue = null)
{
$this->_cellMarginBottom = $pValue;
}
/**
* Get cell margin bottom
*/
public function getCellMarginBottom()
{
return $this->_cellMarginBottom;
@ -479,6 +624,9 @@ class PHPWord_Style_TableFull
$this->_cellMarginBottom = $pValue;
}
/**
* Get cell margin
*/
public function getCellMargin()
{
return array($this->_cellMarginTop, $this->_cellMarginLeft, $this->_cellMarginRight, $this->_cellMarginBottom);

View File

@ -39,6 +39,7 @@ class PHPWord_Style_Tabs
private $_tabs;
/**
* Constructor
*
* @param array $tabs
*/
@ -48,6 +49,7 @@ class PHPWord_Style_Tabs
}
/**
* Convert to XML
*
* @param PHPWord_Shared_XMLWriter $objWriter
*/

View File

@ -105,6 +105,8 @@ class PHPWord_TOC
/**
* Add a Title
*
* @param string $text
* @param int $depth
* @return array
*/
public static function addTitle($text, $depth = 0)

View File

@ -33,8 +33,8 @@ interface PHPWord_Writer_IWriter
/**
* Save PHPWord to file
*
* @param string $pFileName
* @throws Exception
* @param string $pFilename
* @throws Exception
*/
public function save($pFilename = null);
}

View File

@ -68,7 +68,7 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter
/**
* Create a new PHPWord_Writer_ODText
*
* @param PHPWord $pPHPWord
* @param PHPWord $pPHPWord
*/
public function __construct(PHPWord $pPHPWord = null)
{
@ -98,8 +98,8 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter
/**
* Save PHPWord to file
*
* @param string $pFileName
* @throws Exception
* @param string $pFilename
* @throws Exception
*/
public function save($pFilename = null)
{
@ -212,8 +212,8 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter
/**
* Get PHPWord object
*
* @param PHPWord $pPHPWord PHPWord object
* @throws Exception
* @param PHPWord $pPHPWord PHPWord object
* @throws Exception
* @return PHPWord_Writer_ODText
*/
public function setPHPWord(PHPWord $pPHPWord = null)
@ -226,6 +226,7 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter
* Get PHPWord_Worksheet_BaseDrawing HashTable
*
* @return PHPWord_HashTable
* @codeCoverageIgnore
*/
public function getDrawingHashTable()
{
@ -235,8 +236,8 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter
/**
* Get writer part
*
* @param string $pPartName Writer part name
* @return PHPWord_Writer_ODText_WriterPart
* @param string $pPartName Writer part name
* @return PHPWord_Writer_ODText_WriterPart
*/
public function getWriterPart($pPartName = '')
{
@ -260,9 +261,9 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter
/**
* Set use disk caching where possible?
*
* @param boolean $pValue
* @param string $pDirectory Disk caching directory
* @throws Exception Exception when directory does not exist
* @param boolean $pValue
* @param string $pDirectory Disk caching directory
* @throws Exception Exception when directory does not exist
* @return PHPWord_Writer_ODText
*/
public function setUseDiskCaching($pValue = false, $pDirectory = null)

View File

@ -344,9 +344,9 @@ class PHPWord_Writer_ODText_Content extends PHPWord_Writer_ODText_WriterPart
/**
* Write TextRun section
*
* @param PHPWord_Shared_XMLWriter $objWriter
* @param PHPWord_Section_TextRun $textrun
* @todo Enable all other section types
* @param PHPWord_Shared_XMLWriter $objWriter
* @param PHPWord_Section_TextRun $textrun
* @todo Enable all other section types
*/
protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun)
{
@ -364,6 +364,8 @@ class PHPWord_Writer_ODText_Content extends PHPWord_Writer_ODText_WriterPart
/**
* Write TextBreak
*
* @param PHPWord_Shared_XMLWriter $objWriter
*/
protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null)
{
@ -373,10 +375,22 @@ class PHPWord_Writer_ODText_Content extends PHPWord_Writer_ODText_WriterPart
}
// @codeCoverageIgnoreStart
/**
* Write end section
*
* @param PHPWord_Shared_XMLWriter $objWriter
* @param PHPWord_Section $section
*/
private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null)
{
}
/**
* Write section
*
* @param PHPWord_Shared_XMLWriter $objWriter
* @param PHPWord_Section $section
*/
private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null)
{
}

View File

@ -44,14 +44,31 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
*/
private $_drawingHashTable;
/**
* Color table
*
* @var array
*/
private $_colorTable;
/**
* Font table
*
* @var array
*/
private $_fontTable;
/**
* Last paragraph style
*
* @var PHPWord_Style_Paragraph
*/
private $_lastParagraphStyle;
/**
* Create a new PHPWord_Writer_ODText
*
* @param PHPWord $pPHPWord
* @param PHPWord $pPHPWord
*/
public function __construct(PHPWord $pPHPWord = null)
{
@ -65,8 +82,8 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
/**
* Save PHPWord to file
*
* @param string $pFileName
* @throws Exception
* @param string $pFilename
* @throws Exception
*/
public function save($pFilename = null)
{
@ -115,8 +132,8 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
/**
* Get PHPWord object
*
* @param PHPWord $pPHPWord PHPWord object
* @throws Exception
* @param PHPWord $pPHPWord PHPWord object
* @throws Exception
* @return PHPWord_Writer_RTF
*/
public function setPHPWord(PHPWord $pPHPWord = null)
@ -129,12 +146,18 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
* Get PHPWord_Worksheet_BaseDrawing HashTable
*
* @return PHPWord_HashTable
* @codeCoverageIgnore
*/
public function getDrawingHashTable()
{
return $this->_drawingHashTable;
}
/**
* Get document data
*
* @return string
*/
private function getData()
{
// PHPWord object : $this->_document
@ -188,6 +211,11 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
return $sRTFContent;
}
/**
* Get font table
*
* @return array
*/
private function getDataFont()
{
$pPHPWord = $this->_document;
@ -238,6 +266,11 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
return $arrFonts;
}
/**
* Get color tables
*
* @return array
*/
private function getDataColor()
{
$pPHPWord = $this->_document;
@ -294,6 +327,11 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
return $arrColors;
}
/**
* Get content
*
* @return string
*/
private function getDataContent()
{
$pPHPWord = $this->_document;
@ -342,6 +380,10 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
/**
* Get text
*
* @param PHPWord_Section_Text $text
* @param boolean $withoutP
* @return string
*/
private function getDataContentText(PHPWord_Section_Text $text, $withoutP = false)
{
@ -428,11 +470,15 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
if (!$withoutP) {
$sRTFText .= '\par' . PHP_EOL;
}
return $sRTFText;
}
/**
* Get text run content
*
* @param PHPWord_Section_TextRun $textrun
* @return string
*/
private function getDataContentTextRun(PHPWord_Section_TextRun $textrun)
{
@ -449,9 +495,15 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
}
$sRTFText .= '\par' . PHP_EOL;
}
return $sRTFText;
}
/**
* Get text break
*
* @return string
*/
private function getDataContentTextBreak()
{
$this->_lastParagraphStyle = '';
@ -463,6 +515,7 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter
* Write unsupported element
*
* @param string $element
* @return string
*/
private function getDataContentUnsupportedElement($element)
{

View File

@ -24,7 +24,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.8.0
*/
use PhpOffice\PhpWord\Exceptions\InvalidImageException;
use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException;
@ -33,15 +32,54 @@ use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException;
*/
class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
{
/**
* PHPWord object
*
* @var PHPWord
*/
private $_document;
/**
* Writer parts
*
* @var array
*/
private $_writerParts;
/**
* Directory for caching
*
* @var string
*/
private $_diskCachingDirectory;
/**
* Use disk caching
*
* @var boolean
*/
private $_useDiskCaching = false;
/**
* Image types
*
* @var array
*/
private $_imageTypes = array();
/**
* Object types
*
* @var array
*/
private $_objectTypes = array();
public function __construct(PHPWord $PHPWord = null)
/**
* Constructor
*
* @param PHPWord $PHPWord
*/
public function __construct(PHPWord $PHPWord = null)
{
$this->_document = $PHPWord;
@ -63,6 +101,11 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
}
}
/**
* Save
*
* @param string $pFilename
*/
public function save($pFilename = null)
{
if (!is_null($this->_document)) {
@ -204,6 +247,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
}
/**
* Check content types
*
* @param string $src
*/
private function checkContentTypes($src)
@ -230,6 +275,11 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
}
}
/**
* Get writer part
*
* @param string $pPartName
*/
public function getWriterPart($pPartName = '')
{
if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) {
@ -239,11 +289,20 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
}
}
/**
* Get use disk catching setting
*/
public function getUseDiskCaching()
{
return $this->_useDiskCaching;
}
/**
* Set use disk catching setting
*
* @param boolean $pValue
* @param string $pDirectory
*/
public function setUseDiskCaching($pValue = false, $pDirectory = null)
{
$this->_useDiskCaching = $pValue;
@ -259,6 +318,12 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
return $this;
}
/**
* Add file to package
*
* @param mixed $objZip
* @param array $element
*/
private function _addFileToPackage($objZip, $element)
{
if (isset($element['isMemImage']) && $element['isMemImage']) {

View File

@ -31,9 +31,10 @@
*/
class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart
{
/**
* Write text
*
* @param boolean $withoutP
*/
protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Text $text, $withoutP = false)
{
@ -232,6 +233,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart
/**
* Write link
*
* @param boolean $withoutP
*/
protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false)
{
@ -791,8 +794,11 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart
}
/**
* Write image
*
* @param \PHPWord_Shared_XMLWriter $objWriter
* @param \PHPWord_Section_Image|\PHPWord_Section_MemoryImage $image
* @param boolean $withoutP
*/
protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $image, $withoutP = false)
{
@ -873,6 +879,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart
/**
* Write watermark
*
* @param PHP_Section_Image|PHP_Section_MemoryImage $image
*/
protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image)
{
@ -1003,6 +1011,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart
/**
* Write footnote reference
*
* @param boolean $withoutP
*/
protected function _writeFootnoteReference(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote, $withoutP = false)
{

View File

@ -30,7 +30,15 @@
*/
class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_WriterPart
{
/**
* Write contenttypes.xml
*
* @param array $_imageTypes
* @param array $_objectTypes
* @param int $_cHdrs
* @param array $footers
* @return string XML data
*/
public function writeContentTypes($_imageTypes, $_objectTypes, $_cHdrs, $footers)
{
// Create XML writer
@ -163,7 +171,6 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write
}
}
$objWriter->endElement();
// Return
@ -173,9 +180,9 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write
/**
* Get image mime type
*
* @param string $pFile Filename
* @return string Mime Type
* @throws Exception
* @param string $pFile Filename
* @return string Mime Type
* @throws Exception
*/
private function _getImageMimeType($pFile = '')
{
@ -190,10 +197,10 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write
/**
* Write Default content type
*
* @param PHPWord_Shared_XMLWriter $objWriter XML Writer
* @param string $pPartname Part name
* @param string $pContentType Content type
* @throws Exception
* @param PHPWord_Shared_XMLWriter $objWriter XML Writer
* @param string $pPartname Part name
* @param string $pContentType Content type
* @throws Exception
*/
private function _writeDefaultContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
{
@ -211,10 +218,10 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write
/**
* Write Override content type
*
* @param PHPWord_Shared_XMLWriter $objWriter XML Writer
* @param string $pPartname Part name
* @param string $pContentType Content type
* @throws Exception
* @param PHPWord_Shared_XMLWriter $objWriter XML Writer
* @param string $pPartname Part name
* @param string $pContentType Content type
* @throws Exception
*/
private function _writeOverrideContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
{

View File

@ -30,7 +30,12 @@
*/
class PHPWord_Writer_Word2007_DocProps extends PHPWord_Writer_Word2007_WriterPart
{
/**
* Write app.xml
*
* @param PHPWord $pPHPWord
* @return string XML data
*/
public function writeDocPropsApp(PHPWord $pPHPWord = null)
{
// Create XML writer
@ -122,7 +127,12 @@ class PHPWord_Writer_Word2007_DocProps extends PHPWord_Writer_Word2007_WriterPar
return $objWriter->getData();
}
/**
* Write core.xml
*
* @param PHPWord $pPHPWord
* @return string XML data
*/
public function writeDocPropsCore(PHPWord $pPHPWord = null)
{
// Create XML writer

View File

@ -30,7 +30,9 @@
*/
class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
{
/**
* Write document.xml
*/
public function writeDocument(PHPWord $pPHPWord = null)
{
// Create XML writer
@ -114,6 +116,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
return $objWriter->getData();
}
/**
* Write section start
*/
private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section)
{
$objWriter->startElement('w:p');
@ -123,6 +128,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
$objWriter->endElement();
}
/**
* Write section end
*/
private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section)
{
$settings = $section->getSettings();
@ -256,6 +264,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
$objWriter->endElement();
}
/**
* Write page break element
*/
private function _writePageBreak(PHPWord_Shared_XMLWriter $objWriter = null)
{
$objWriter->startElement('w:p');
@ -267,6 +278,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
$objWriter->endElement();
}
/**
* Write list item element
*/
public function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_ListItem $listItem)
{
$textObject = $listItem->getTextObject();
@ -306,6 +320,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
$objWriter->endElement();
}
/**
* Write object element
*/
protected function _writeObject(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Object $object)
{
$rIdObject = $object->getRelationId();
@ -365,6 +382,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
$objWriter->endElement(); // w:p
}
/**
* Write TOC element
*/
private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null)
{
$titles = PHPWord_TOC::getTitles();

View File

@ -30,7 +30,12 @@
*/
class PHPWord_Writer_Word2007_DocumentRels extends PHPWord_Writer_Word2007_WriterPart
{
/**
* Write word/_rels/document.xml.rels
*
* @param array $_relsCollection
* @return string XML data
*/
public function writeDocumentRels($_relsCollection)
{
// Create XML writer
@ -119,6 +124,12 @@ class PHPWord_Writer_Word2007_DocumentRels extends PHPWord_Writer_Word2007_Write
return $objWriter->getData();
}
/**
* Write word/_rels/(header|footer)(\d).xml.rels
*
* @param array $_relsCollection
* @return string XML data
*/
public function writeHeaderFooterRels($_relsCollection)
{
// Create XML writer
@ -150,13 +161,21 @@ class PHPWord_Writer_Word2007_DocumentRels extends PHPWord_Writer_Word2007_Write
);
}
$objWriter->endElement();
// Return
return $objWriter->getData();
}
/**
* Write individual relations
*
* @param PHPWord_Shared_XMLWriter $objWriter
* @param int $pId
* @param string $pType
* @param string $pTarget
* @param string $pTargetMode
*/
private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '')
{
if ($pType != '' && $pTarget != '') {

View File

@ -30,7 +30,12 @@
*/
class PHPWord_Writer_Word2007_Footer extends PHPWord_Writer_Word2007_Base
{
/**
* Write footer
*
* @param PHPWord_Section_Footer $footer
* @return string XML data
*/
public function writeFooter(PHPWord_Section_Footer $footer)
{
// Create XML writer

View File

@ -25,9 +25,17 @@
* @version 0.8.0
*/
/**
* Class PHPWord_Writer_Word2007_Footnotes
*/
class PHPWord_Writer_Word2007_Footnotes extends PHPWord_Writer_Word2007_Base
{
/**
* Write footnotes.xml
*
* @param array $allFootnotesCollection
* @return string XML data
*/
public function writeFootnotes($allFootnotesCollection)
{
// Create XML writer

View File

@ -25,9 +25,16 @@
* @version 0.8.0
*/
/**
* Class PHPWord_Writer_Word2007_FootnotesRels
*/
class PHPWord_Writer_Word2007_FootnotesRels extends PHPWord_Writer_Word2007_WriterPart
{
/**
* Write footnotes relationships
*
* @param array $_relsCollection
*/
public function writeFootnotesRels($_relsCollection)
{
// Create XML writer
@ -61,6 +68,15 @@ class PHPWord_Writer_Word2007_FootnotesRels extends PHPWord_Writer_Word2007_Writ
return $objWriter->getData();
}
/**
* Write individual relations
*
* @param PHPWord_Shared_XMLWriter $objWriter
* @param int $pId
* @param string $pType
* @param string $pTarget
* @param string $pTargetMode
*/
private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '')
{
if ($pType != '' && $pTarget != '') {

View File

@ -30,7 +30,12 @@
*/
class PHPWord_Writer_Word2007_Header extends PHPWord_Writer_Word2007_Base
{
/**
* Write header
*
* @param PHPWord_Section_Header $header
* @return string XML data
*/
public function writeHeader(PHPWord_Section_Header $header)
{
// Create XML writer

View File

@ -30,7 +30,11 @@
*/
class PHPWord_Writer_Word2007_Rels extends PHPWord_Writer_Word2007_WriterPart
{
/**
* Write _rels/.rels
*
* @param PHPWord $pPHPWord
*/
public function writeRelationships(PHPWord $pPHPWord = null)
{
// Create XML writer

View File

@ -30,9 +30,18 @@
*/
class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base
{
/**
* PHPWord object
*
* @var PHPWord
*/
private $_document;
/**
* Write styles
*
* @param PHPWord $pPHPWord
*/
public function writeStyles(PHPWord $pPHPWord = null)
{
// Create XML writer
@ -181,6 +190,12 @@ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base
return $objWriter->getData();
}
/**
* Write style
*
* @param PHPWord_Shared_XMLWriter $objWriter
* @param PHPWord_Style_TableFull $style
*/
private function _writeFullTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_TableFull $style)
{
@ -302,6 +317,13 @@ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base
}
}
/**
* Write row style
*
* @param PHPWord_Shared_XMLWriter $objWriter
* @param string $type
* @param PHPWord_Style_TableFull $style
*/
private function _writeRowStyle(PHPWord_Shared_XMLWriter $objWriter = null, $type, PHPWord_Style_TableFull $style)
{
$brdSz = $style->getBorderSize();
@ -362,7 +384,11 @@ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base
$objWriter->endElement();
}
/**
* Write doc defaults
*
* @param PHPWord_Shared_XMLWriter $objWriter
*/
private function _writeDocDefaults(PHPWord_Shared_XMLWriter $objWriter = null)
{
$fontName = $this->_document->getDefaultFontName();

View File

@ -30,13 +30,28 @@
*/
abstract class PHPWord_Writer_Word2007_WriterPart
{
/**
* Parent writer object
*
* @var PHPWord_Writer_Word2007
*/
private $_parentWriter;
/**
* Set parent writer
*
* @param PHPWord_Writer_IWriter
*/
public function setParentWriter(PHPWord_Writer_IWriter $pWriter = null)
{
$this->_parentWriter = $pWriter;
}
/**
* Get parent writer
*
* @return PHPWord_Writer_IWriter
*/
public function getParentWriter()
{
if (!is_null($this->_parentWriter)) {