1<?php
2
3require_once DOKU_PLUGIN.'odt/ODT/elements/ODTStateElement.php';
4
5/**
6 * ODTElementNote:
7 * Class for handling the text note element (e.g. for footnotes).
8 *
9 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
10 * @author  LarsDW223
11 */
12class ODTElementNote extends ODTStateElement
13{
14    protected $value_type = 'string';
15
16    /**
17     * Constructor.
18     */
19    public function __construct() {
20        parent::__construct();
21        $this->setClass ('text-note');
22    }
23
24    /**
25     * Return the elements name.
26     *
27     * @return string The ODT XML element name.
28     */
29    public function getElementName () {
30        return ('text:note');
31    }
32
33    /**
34     * Return string with encoded opening tag.
35     *
36     * @return string The ODT XML code to open this element.
37     */
38    public function getOpeningTag () {
39        // Intentionally return an empty string!
40        return '';
41    }
42
43    /**
44     * Return string with encoded closing tag.
45     *
46     * @return string The ODT XML code to close this element.
47     */
48    public function getClosingTag () {
49        // Intentionally return an empty string!
50        return '';
51    }
52
53    /**
54     * Are we in a paragraph or not?
55     * As a text note we are not.
56     *
57     * @return boolean
58     */
59    public function getInParagraph() {
60        return false;
61    }
62
63    /**
64     * Determine and set the parent for this element.
65     * As a table cell our parent is the table element.
66     *
67     * @param ODTStateElement $previous
68     */
69    public function determineParent(ODTStateElement $previous) {
70        $this->setParent($previous);
71    }
72
73    /**
74     * Return the table to which this column belongs.
75     *
76     * @return ODTStateElement
77     */
78    public function getTable () {
79        return $this->getParent();
80    }
81}
82