1<?php
2
3require_once(HTML2PS_DIR.'value.generic.php');
4
5// Stack value is an array containing two values:
6// string value of text-indent proprty and
7// boolean flag indication of this value is relative (true) or absolute (false)
8
9class TextIndentValuePDF extends CSSValue {
10  var $raw_value;
11
12  function calculate(&$box) {
13    if ($this->raw_value[1]) {
14      // Is a percentage
15      return $box->get_width() * $this->raw_value[0] / 100;
16    } else {
17      return $this->raw_value[0];
18    };
19  }
20
21  function &copy() {
22    $value =& new TextIndentValuePDF($this->raw_value);
23    return $value;
24  }
25
26  function is_default() {
27    return $this->raw_value[0] == 0;
28  }
29
30  function TextIndentValuePDF($value) {
31    $this->raw_value = $value;
32  }
33
34  function units2pt($base) {
35    $this->raw_value[0] = units2pt($this->raw_value[0], $base);
36  }
37}
38
39?>