Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 liveuser 1
<?php
2
 
3
//require_once 'functions.php';
4
//require_once 'class.odt.php';
5
 
6
include_once 'phpodt.php';
7
 
8
/**
9
 * Base class for paragraph & text styles.
10
 * 
11
 * @author Issam RACHDI
12
 */
13
class Style {
14
 
15
	/**
16
	 * The DOMDocument representing the styles xml file
17
	 * @access private
18
	 * @var DOMDocument
19
	 */
20
	protected $styleDocument;
21
	/**
22
	 * The name of the style
23
	 * @access private
24
	 * @var string
25
	 */
26
	protected $name;
27
	/**
28
	 * The DOMElement representing this style
29
	 * @access private
30
	 * @var DOMElement
31
	 */
32
	protected $styleElement;
33
 
34
	/**
35
	 * The constructor initializes the properties, then creates a <style:style>
36
	 * element representing this specific style, and add it to <office:styles> element
37
	 * 
38
	 * @param DOMDocument $styleDoc
39
	 * @param string $name
40
	 */
41
	function __construct($name) {
42
		$this->styleDocument = ODT::getInstance()->getStyleDocument();
43
		$this->name = $name;
44
		$this->styleElement = $this->styleDocument->createElement('style:style');
45
		$this->styleElement->setAttribute('style:name', $name);
46
		$this->styleDocument->getElementsByTagName('office:styles')->item(0)->appendChild($this->styleElement);
47
	}
48
 
49
	/**
50
	 * return the name of this style
51
	 * @return string
52
	 */
53
	function getStyleName() {
54
		return $this->name;
55
	}
56
 
57
	public function setStyleName($name) {
58
		$this->name = $name;
59
	}
60
 
61
 
62
}
63
 
64
?>