Code

still WIP. added tree-descending code
[inkscape.git] / src / extension / internal / odf.h
1 /**
2  * OpenDocument <drawing> input and output
3  *
4  * This is an an entry in the extensions mechanism to begin to enable
5  * the inputting and outputting of OpenDocument Format (ODF) files from
6  * within Inkscape.  Although the initial implementations will be very lossy
7  * do to the differences in the models of SVG and ODF, they will hopefully
8  * improve greatly with time.
9  *
10  * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
11  *
12  * Authors:
13  *   Bob Jamison
14  *
15  * Copyright (C) 2006 Bob Jamison
16  *
17  *  This library is free software; you can redistribute it and/or
18  *  modify it under the terms of the GNU Lesser General Public
19  *  License as published by the Free Software Foundation; either
20  *  version 2.1 of the License, or (at your option) any later version.
21  *
22  *  This library is distributed in the hope that it will be useful,
23  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25  *  Lesser General Public License for more details.
26  *
27  *  You should have received a copy of the GNU Lesser General Public
28  *  License along with this library; if not, write to the Free Software
29  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
30  */
32 #ifndef EXTENSION_INTERNAL_ODG_OUT_H
33 #define EXTENSION_INTERNAL_ODG_OUT_H
35 #include <dom/dom.h>
36 #include <dom/io/stringstream.h>
38 #include <glib.h>
39 #include "extension/implementation/implementation.h"
42 #include <xml/repr.h>
44 #include <string>
45 #include <map>
48 namespace Inkscape
49 {
50 namespace Extension
51 {
52 namespace Internal
53 {
56 class OdfOutput : public Inkscape::Extension::Implementation::Implementation
57 {
59 public:
61     bool check (Inkscape::Extension::Extension * module);
63     void save  (Inkscape::Extension::Output *mod,
64                 SPDocument *doc,
65                 const gchar *uri);
67     static void   init  (void);
69 private:
71     int styleIndex;
72     std::map<std::string, std::string> styleTable;
74     void preprocess(SPDocument *doc);
75     void preprocess(Inkscape::XML::Node *node);
76     bool writeTree(Inkscape::XML::Node *node);
78     void po(char *str);
79     org::w3c::dom::io::StringOutputStream outs;
81 };
86 }  //namespace Internal
87 }  //namespace Extension
88 }  //namespace Inkscape
92 #endif /* EXTENSION_INTERNAL_ODG_OUT_H */