1
/* GraphicsElement: The items we are collecting to be put into the Writer
2
* document: paragraph and spans of text, as well as section breaks.
4
* Copyright (C) 2002-2003 William Lachance (william.lachance@sympatico.ca)
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Library General Public License for more details.
16
* You should have received a copy of the GNU Library General Public
17
* License along with this library; if not, write to the
18
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02111-1301 USA
21
* For further information visit http://libwpd.sourceforge.net
25
/* "This product is not manufactured, approved, or supported by
26
* Corel Corporation or Corel Corporation Limited."
29
#ifndef _GRAPHICSELEMENT_H
30
#define _GRAPHICSELEMENT_H
35
#include "GraphicsHandler.hxx"
40
virtual ~GraphicsElement() {}
41
virtual void write(GraphicsHandler *pHandler) const = 0;
42
virtual void print() const {}
45
class TagGraphicsElement : public GraphicsElement
48
explicit TagGraphicsElement(const char *szTagName) : msTagName(szTagName) {}
49
const std::string &getTagName() const { return msTagName; }
50
virtual void print() const;
52
const std::string msTagName;
55
class OpenTagGraphicsElement : public TagGraphicsElement
58
explicit OpenTagGraphicsElement(const char *szTagName) : TagGraphicsElement(szTagName) {}
59
~OpenTagGraphicsElement() {}
60
void addAttribute(const std::string &szAttributeName, const std::string &sAttributeValue);
61
virtual void write(GraphicsHandler *pHandler) const;
62
virtual void print () const;
64
std::vector<std::pair<std::string, std::string> > maAttrList;
67
class CloseTagGraphicsElement : public TagGraphicsElement
70
explicit CloseTagGraphicsElement(const char *szTagName) : TagGraphicsElement(szTagName) {}
71
virtual void write(GraphicsHandler *pHandler) const;
74
class CharDataGraphicsElement : public GraphicsElement
77
CharDataGraphicsElement(const char *sData) : GraphicsElement(), msData(sData) {}
78
virtual void write(GraphicsHandler *pHandler) const;