1 /** @file
2 * @brief Text node implementation
3 */
4 /* Copyright 2004-2005 MenTaLguY <mental@rydia.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * See the file COPYING for details.
12 *
13 */
15 #ifndef SEEN_INKSCAPE_XML_TEXT_NODE_H
16 #define SEEN_INKSCAPE_XML_TEXT_NODE_H
18 #include <glib/gquark.h>
19 #include "xml/simple-node.h"
21 namespace Inkscape {
23 namespace XML {
25 /**
26 * @brief Text node, e.g. "Some text" in <group>Some text</group>
27 */
28 struct TextNode : public SimpleNode {
29 TextNode(Util::ptr_shared<char> content, Document *doc)
30 : SimpleNode(g_quark_from_static_string("string"), doc)
31 {
32 setContent(content);
33 }
34 TextNode(TextNode const &other, Document *doc)
35 : SimpleNode(other, doc) {}
37 Inkscape::XML::NodeType type() const { return Inkscape::XML::TEXT_NODE; }
39 protected:
40 SimpleNode *_duplicate(Document* doc) const { return new TextNode(*this, doc); }
41 };
43 }
45 }
47 #endif
48 /*
49 Local Variables:
50 mode:c++
51 c-file-style:"stroustrup"
52 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
53 indent-tabs-mode:nil
54 fill-column:99
55 End:
56 */
57 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :