2 * This file is part of jSpeed.
4 * jSpeed is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * jSpeed is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with jSpeed. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRAPHICSELEMENT_H
20 #define GRAPHICSELEMENT_H
22 #include <QtCore/QMap>
30 class QGraphicsEffect;
38 struct AttributeDetails
44 GraphicsElement(Reader* reader);
45 static GraphicsElement* getElement(QString const& name, Reader* reader);
46 virtual bool setAttribute(QString const& name, QString const& value) = 0;
47 virtual void addToScene(GraphicsScene* scene) = 0;
48 virtual void update() = 0;
49 virtual QGraphicsItem* getElement() const = 0;
50 QString const& getError() const;
51 bool setEffect(QString const& effect);
52 bool setEffectAttribute(QString const& name, QString const& value);
56 int getAttribute(QString const& name, QString const& value, const AttributeDetails details[], int count, int& intValue);
57 void setError(QString const& error);
58 bool readFile(QString const& name, QByteArray& data);
59 bool getFont(QString const& name, QFont& font);
65 QMap<QString, QString> loadedFonts_;