-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add reader/writer for additional values in settings.xml (#1098)
* add reader/writer for settings.xml The following values can currently be set/read - w:trackRevisions - w:doNotTrackMoves - w:doNotTrackFormatting - w:proofState - w:zoom - w:decimalSymbol - w:revisionView
- Loading branch information
Showing
12 changed files
with
934 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
/** | ||
* This file is part of PHPWord - A pure PHP library for reading and writing | ||
* word processing documents. | ||
* | ||
* PHPWord is free software distributed under the terms of the GNU Lesser | ||
* General Public License version 3 as published by the Free Software Foundation. | ||
* | ||
* For the full copyright and license information, please read the LICENSE | ||
* file that was distributed with this source code. For the full list of | ||
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors. | ||
* | ||
* @link https://github.com/PHPOffice/PHPWord | ||
* @copyright 2010-2016 PHPWord contributors | ||
* @license https://www.gnu.org/licenses/lgpl.txt LGPL version 3 | ||
*/ | ||
namespace PhpOffice\PhpWord\ComplexType; | ||
|
||
/** | ||
* Spelling and Grammatical Checking State | ||
* | ||
* @see https://www.datypic.com/sc/ooxml/e-w_proofState-1.html | ||
*/ | ||
final class ProofState | ||
{ | ||
|
||
/** | ||
* Check Completed | ||
*/ | ||
const CLEAN = 'clean'; | ||
|
||
/** | ||
* Check Not Completed | ||
*/ | ||
const DIRTY = 'dirty'; | ||
|
||
/** | ||
* Spell Checking State | ||
* | ||
* @var string | ||
*/ | ||
private $spelling; | ||
|
||
/** | ||
* Grammatical Checking State | ||
* | ||
* @var string | ||
*/ | ||
private $grammar; | ||
|
||
/** | ||
* Set the Spell Checking State (dirty or clean) | ||
* | ||
* @param string $spelling | ||
* @throws \InvalidArgumentException | ||
* @return self | ||
*/ | ||
public function setSpelling($spelling) | ||
{ | ||
if ($spelling == self::CLEAN || $spelling == self::DIRTY) { | ||
$this->spelling = $spelling; | ||
} else { | ||
throw new \InvalidArgumentException("Invalid value, dirty or clean possible"); | ||
} | ||
return $this; | ||
} | ||
|
||
/** | ||
* Get the Spell Checking State | ||
* | ||
* @return string | ||
*/ | ||
public function getSpelling() | ||
{ | ||
return $this->spelling; | ||
} | ||
|
||
/** | ||
* Set the Grammatical Checking State (dirty or clean) | ||
* | ||
* @param string $grammar | ||
* @throws \InvalidArgumentException | ||
* @return self | ||
*/ | ||
public function setGrammar($grammar) | ||
{ | ||
if ($grammar == self::CLEAN || $grammar == self::DIRTY) { | ||
$this->grammar = $grammar; | ||
} else { | ||
throw new \InvalidArgumentException("Invalid value, dirty or clean possible"); | ||
} | ||
return $this; | ||
} | ||
|
||
/** | ||
* Get the Grammatical Checking State | ||
* | ||
* @return string | ||
*/ | ||
public function getGrammar() | ||
{ | ||
return $this->grammar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
<?php | ||
/** | ||
* This file is part of PHPWord - A pure PHP library for reading and writing | ||
* word processing documents. | ||
* | ||
* PHPWord is free software distributed under the terms of the GNU Lesser | ||
* General Public License version 3 as published by the Free Software Foundation. | ||
* | ||
* For the full copyright and license information, please read the LICENSE | ||
* file that was distributed with this source code. For the full list of | ||
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors. | ||
* | ||
* @link https://github.com/PHPOffice/PHPWord | ||
* @copyright 2010-2016 PHPWord contributors | ||
* @license https://www.gnu.org/licenses/lgpl.txt LGPL version 3 | ||
*/ | ||
namespace PhpOffice\PhpWord\ComplexType; | ||
|
||
/** | ||
* Visibility of Annotation Types | ||
* | ||
* @see https://www.datypic.com/sc/ooxml/e-w_revisionView-1.html | ||
*/ | ||
final class TrackChangesView | ||
{ | ||
|
||
/** | ||
* Display Visual Indicator Of Markup Area | ||
* | ||
* @var boolean | ||
*/ | ||
private $markup; | ||
|
||
/** | ||
* Display Comments | ||
* | ||
* @var boolean | ||
*/ | ||
private $comments; | ||
|
||
/** | ||
* Display Content Revisions | ||
* | ||
* @var boolean | ||
*/ | ||
private $insDel; | ||
|
||
/** | ||
* Display Formatting Revisions | ||
* | ||
* @var boolean | ||
*/ | ||
private $formatting; | ||
|
||
/** | ||
* Display Ink Annotations | ||
* | ||
* @var boolean | ||
*/ | ||
private $inkAnnotations; | ||
|
||
/** | ||
* Get Display Visual Indicator Of Markup Area | ||
* | ||
* @return boolean True if markup is shown | ||
*/ | ||
public function hasMarkup() | ||
{ | ||
return $this->markup; | ||
} | ||
|
||
/** | ||
* Set Display Visual Indicator Of Markup Area | ||
* | ||
* @param boolean $markup | ||
* Set to true to show markup | ||
*/ | ||
public function setMarkup($markup) | ||
{ | ||
$this->markup = $markup === null ? true : $markup; | ||
} | ||
|
||
/** | ||
* Get Display Comments | ||
* | ||
* @return boolean True if comments are shown | ||
*/ | ||
public function hasComments() | ||
{ | ||
return $this->comments; | ||
} | ||
|
||
/** | ||
* Set Display Comments | ||
* | ||
* @param boolean $comments | ||
* Set to true to show comments | ||
*/ | ||
public function setComments($comments) | ||
{ | ||
$this->comments = $comments === null ? true : $comments; | ||
} | ||
|
||
/** | ||
* Get Display Content Revisions | ||
* | ||
* @return boolean True if content revisions are shown | ||
*/ | ||
public function hasInsDel() | ||
{ | ||
return $this->insDel; | ||
} | ||
|
||
/** | ||
* Set Display Content Revisions | ||
* | ||
* @param boolean $insDel | ||
* Set to true to show content revisions | ||
*/ | ||
public function setInsDel($insDel) | ||
{ | ||
$this->insDel = $insDel === null ? true : $insDel; | ||
} | ||
|
||
/** | ||
* Get Display Formatting Revisions | ||
* | ||
* @return boolean True if formatting revisions are shown | ||
*/ | ||
public function hasFormatting() | ||
{ | ||
return $this->formatting; | ||
} | ||
|
||
/** | ||
* Set Display Formatting Revisions | ||
* | ||
* @param boolean $insDel | ||
* Set to true to show formatting revisions | ||
*/ | ||
public function setFormatting($formatting) | ||
{ | ||
$this->formatting = $formatting === null ? true : $formatting; | ||
} | ||
|
||
/** | ||
* Get Display Ink Annotations | ||
* | ||
* @return boolean True if ink annotations are shown | ||
*/ | ||
public function hasInkAnnotations() | ||
{ | ||
return $this->inkAnnotations; | ||
} | ||
|
||
/** | ||
* Set Display Ink Annotations | ||
* | ||
* @param boolean $inkAnnotations | ||
* Set to true to show ink annotations | ||
*/ | ||
public function setInkAnnotations($inkAnnotations) | ||
{ | ||
$this->inkAnnotations = $inkAnnotations === null ? true : $inkAnnotations; | ||
} | ||
} |
Oops, something went wrong.