Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 915 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 liveuser 1
<?php
2
 
3
//require_once 'class.styleconstants.php';
4
 
5
include_once 'phpodt.php';
6
 
7
class ListLevelProp {
8
 
9
	private $align = NULL;
10
	private $indent = NULL;
11
	private $minLabelWidth = NULL;
12
	private $minLabelDistance = NULL;
13
	private $vAlign = NULL;
14
	private $imageWidth = NULL;
15
	private $imageHeight = NULL;
16
 
17
	function __construct() {
18
 
19
	}
20
 
21
	public function getAlign() {
22
		return $this->align;
23
	}
24
 
25
	/**
26
	 * Specifies the horizontal alignment of a label (number) within the width 
27
	 * specified by the {@link #setMinLabelWidth setMinLabelWidth()} method
28
	 * 
29
	 * @param integer $align 
30
	 */
31
	public function setAlign($align) {
32
		switch($align) {
33
			case StyleConstants::START:
34
				$align = 'start';break;
35
			case StyleConstants::END:
36
				$align = 'end';break;
37
			case StyleConstants::LEFT:
38
				$align = 'left';break;
39
			case StyleConstants::RIGHT:
40
				$align = 'right';break;
41
			case StyleConstants::CENTER:
42
				$align = 'center';break;
43
			case StyleConstants::JUSTIFY:
44
				$align = 'justify';break;
45
			default:
46
				throw new StyleException('Invalid align value');
47
		}
48
		$this->align = $align;
49
	}
50
 
51
	public function getIndent() {
52
		return $this->indent;
53
	}
54
 
55
	/**
56
	 * Specifies the space to include before the number for all paragraphs at this level. 
57
	 * The value of this property is absolute. This means that when the position of a label is 
58
	 * calculated the indent value of the current level is only considered. The indent values for 
59
	 * lower levels do not affect the label position.
60
	 * 
61
	 * @param length $indent 
62
	 */
63
	public function setIndent($indent) {
64
		$this->indent = $indent;
65
	}
66
 
67
	public function getMinLabelWidth() {
68
		return $this->minLabelWidth;
69
	}
70
 
71
	/**
72
	 * Specifies the minimum width of a number.
73
	 * 
74
	 * @param length $minLabelWidth 
75
	 */
76
	public function setMinLabelWidth($minLabelWidth) {
77
		if (isLengthValue($minLabelWidth, true)) {
78
			$this->minLabelWidth = $minLabelWidth;
79
		} else {
80
			throw new StyleException('Invalid min-label-width value');
81
		}
82
	}
83
 
84
	public function getMinLabelDistance() {
85
		return $this->minLabelDistance;
86
	}
87
 
88
	/**
89
	 * Specifies the minimum distance between the number and the text of the list item.
90
	 * 
91
	 * @param length $minLabelDistance 
92
	 */
93
	public function setMinLabelDistance($minLabelDistance) {
94
		if (isLengthValue($minLabelDistance, true)) {
95
			$this->minLabelDistance = $minLabelDistance;
96
		} else {
97
			throw new StyleException('Invalid min-label-distance value');
98
		}
99
	}
100
 
101
	public function getVAlign() {
102
		return $this->vAlign;
103
	}
104
 
105
	/**
106
	 * Specifies the vertical alignment of the image.
107
	 * 
108
	 * @param integer $vAlign Valid values are StyleConstants::(TOP|MIDDLE|BOTTOM)
109
	 */
110
	public function setVAlign($vAlign) {
111
		switch ($vAlign) {
112
			case StyleConstants::TOP:
113
				$vAlign = 'top';break;
114
			case StyleConstants::MIDDLE:
115
				$vAlign = 'middle';break;
116
			case StyleConstants::BOTTOM:
117
				$vAlign = 'bottom';break;						
118
			default:
119
				throw new StyleException('Invalid vertical align value');
120
		}
121
		$this->vAlign = $vAlign;
122
	}
123
 
124
	public function getImageWidth() {
125
		return $this->imageWidth;
126
	}
127
 
128
	/**
129
	 * Specifies the images's width
130
	 * 
131
	 * @param length $imageWidth 
132
	 */
133
	public function setImageWidth($imageWidth) {
134
		if (isLengthValue($imageWidth, true)) {
135
			$this->imageWidth = $imageWidth;
136
		} else {
137
			throw new StyleException('Invalid image width value');
138
		}		
139
	}
140
 
141
	public function getImageHeight() {
142
		return $this->imageHeight;
143
	}
144
 
145
	/**
146
	 * Specifies the images's heiht
147
	 * 
148
	 * @param length $imageHeight 
149
	 */
150
	public function setImageHeight($imageHeight) {
151
		if (isLengthValue($imageHeight, true)) {
152
			$this->imageHeight = $imageHeight;
153
		} else {
154
			throw new StyleException('Invalid image height value');
155
		}
156
	}
157
}
158
?>