1<?php
2/*
3    +-----------------------------------------------------------------------------+
4    | ILIAS open source                                                           |
5    +-----------------------------------------------------------------------------+
6    | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
7    |                                                                             |
8    | This program is free software; you can redistribute it and/or               |
9    | modify it under the terms of the GNU General Public License                 |
10    | as published by the Free Software Foundation; either version 2              |
11    | of the License, or (at your option) any later version.                      |
12    |                                                                             |
13    | This program is distributed in the hope that it will be useful,             |
14    | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
15    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
16    | GNU General Public License for more details.                                |
17    |                                                                             |
18    | You should have received a copy of the GNU General Public License           |
19    | along with this program; if not, write to the Free Software                 |
20    | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
21    +-----------------------------------------------------------------------------+
22*/
23
24/**
25* QTI matimage class
26*
27* @author Helmut Schottmüller <hschottm@gmx.de>
28* @version $Id$
29*
30* @package assessment
31*/
32class ilQTIMatimage
33{
34    const EMBEDDED_BASE64 = 'base64';
35
36    public $imagetype;
37    public $label;
38    public $height;
39    public $width;
40    public $uri;
41    public $embedded;
42    public $x0;
43    public $y0;
44    public $entityref;
45    public $content;
46
47    public function __construct()
48    {
49    }
50
51    public function setImagetype($a_imagetype)
52    {
53        $this->imagetype = $a_imagetype;
54    }
55
56    public function getImagetype()
57    {
58        return $this->imagetype;
59    }
60
61    public function setLabel($a_label)
62    {
63        $this->label = $a_label;
64    }
65
66    public function getLabel()
67    {
68        return $this->label;
69    }
70
71    public function setHeight($a_height)
72    {
73        $this->height = $a_height;
74    }
75
76    public function getHeight()
77    {
78        return $this->height;
79    }
80
81    public function setWidth($a_width)
82    {
83        $this->width = $a_width;
84    }
85
86    public function getWidth()
87    {
88        return $this->width;
89    }
90
91    public function setEmbedded($a_embedded)
92    {
93        $this->embedded = $a_embedded;
94    }
95
96    public function getEmbedded()
97    {
98        return $this->embedded;
99    }
100
101    public function setUri($a_uri)
102    {
103        $this->uri = $a_uri;
104    }
105
106    public function getUri()
107    {
108        return $this->uri;
109    }
110
111    public function setX0($a_x0)
112    {
113        $this->x0 = $a_x0;
114    }
115
116    public function getX0()
117    {
118        return $this->x0;
119    }
120
121    public function setY0($a_y0)
122    {
123        $this->y0 = $a_y0;
124    }
125
126    public function getY0()
127    {
128        return $this->y0;
129    }
130
131    public function setEntityref($a_entityref)
132    {
133        $this->entityref = $a_entityref;
134    }
135
136    public function getEntityref()
137    {
138        return $this->entityref;
139    }
140
141    public function setContent($a_content)
142    {
143        $this->content = $a_content;
144    }
145
146    public function getContent()
147    {
148        return $this->content;
149    }
150
151    public function getRawContent()
152    {
153        switch ($this->getEmbedded()) {
154            case self::EMBEDDED_BASE64:
155
156                return base64_decode($this->getContent());
157        }
158
159        return $this->getContent();
160    }
161}
162