| 1 |
|
<?php |
| 2 |
|
/** |
| 3 |
|
* AutomaticStyles Class |
| 4 |
|
* |
| 5 |
|
* @todo Not much functionality is added to this class. Here can be done a lot. |
| 6 |
|
* |
| 7 |
|
* $Id: AutomaticStyles.php 42 2006-03-30 08:24:22Z nmarkgraf $ |
| 8 |
|
* |
| 9 |
|
* @license GNU General Public License |
| 10 |
|
* @copyright Copyright &copy; 2006, Norman Markgraf, Alex Latchford, et al. |
| 11 |
|
* @author Norman Markgraf <nmarkgraf@users.sourceforge.net> |
| 12 |
|
* @version $Revision: 42 $ |
| 13 |
|
* @package OpenDocument |
| 14 |
|
* @subpackage styles |
| 15 |
|
* @since 0.4.4 |
| 16 |
|
*/ |
| 17 |
1 |
require_once( "OpenDocumentObjectAbstract.php" ); |
| 18 |
1 |
require_once( "util/NameSpaces.php" ); |
| 19 |
|
|
| 20 |
|
class AutomaticStyles extends OpenDocumentObjectAbstract { |
| 21 |
|
|
| 22 |
|
/** |
| 23 |
|
* |
| 24 |
|
* @since 0.4.4 |
| 25 |
|
*/ |
| 26 |
|
private $style; |
| 27 |
|
|
| 28 |
|
/** |
| 29 |
|
* |
| 30 |
|
* @since 0.4.4 |
| 31 |
|
*/ |
| 32 |
|
private $root; |
| 33 |
|
|
| 34 |
|
/** |
| 35 |
|
* |
| 36 |
|
* @param DOMDocument $dom |
| 37 |
|
* |
| 38 |
|
* @access public |
| 39 |
|
* |
| 40 |
|
* @since 0.4.4 |
| 41 |
|
*/ |
| 42 |
|
public function __construct( $dom, $root=0) { |
| 43 |
2 |
parent::__construct(); |
| 44 |
|
|
| 45 |
2 |
$this->logger->debug( "Constructing styles/AutomaticStyles." ); |
| 46 |
|
|
| 47 |
2 |
$this->dom = $dom; |
| 48 |
2 |
$this->root = $this->dom->createElementNS( NS::OFFICE, "office:automatic-styles" ); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
/** |
| 52 |
|
* |
| 53 |
|
* @access public |
| 54 |
|
* |
| 55 |
|
* @since 0.4.4 |
| 56 |
|
*/ |
| 57 |
|
public function commit() { |
| 58 |
0 |
$this->isCommited = true; |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
/** |
| 62 |
|
* |
| 63 |
|
* @return DOMDocument |
| 64 |
|
* |
| 65 |
|
* @access public |
| 66 |
|
* @final |
| 67 |
|
* |
| 68 |
|
* @since 0.4.4 |
| 69 |
|
*/ |
| 70 |
|
final public function get() { |
| 71 |
0 |
if (!$this->isCommited) { |
| 72 |
0 |
$this->commit(); |
| 73 |
0 |
} |
| 74 |
0 |
return $this->root; |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
} |
| 78 |
|
?> |