filters

kspread/latex/export/xmlparser.h
1
2/*
3** Header file for inclusion with kword_xml2latex.c
4**
5** Copyright (C) 2000-2002 Robert JACOLIN
6**
7** This library is free software; you can redistribute it and/or
8** modify it under the terms of the GNU Library General Public
9** License as published by the Free Software Foundation; either
10** version 2 of the License, or (at your option) any later version.
11**
12** This library is distributed in the hope that it will be useful,
13** but WITHOUT ANY WARRANTY; without even the implied warranty of
14** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15** Library General Public License for more details.
16**
17** To receive a copy of the GNU Library General Public License, write to the
18** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20**
21*/
22
23#ifndef __LATEX_XMLPARSER_H__
24#define __LATEX_XMLPARSER_H__
25
26#include "tqstring.h"
27#include "tqdom.h"
28
29class FileHeader;
30class Document;
31class KoStore;
32
33class XmlParser
34{
36 TQString _filename;
38 TQDomDocument _document;
40 static KoStore* _in;
41
42 protected:
43 /* All the inherit class must be have a link with
44 * the header to specify to use special package
45 */
46 static FileHeader *_fileHeader;
47 static Document *_root;
48
49 public:
50 XmlParser(TQString);
51 XmlParser(TQByteArray); /* deprecated */
52 XmlParser(const KoStore*);
53 XmlParser();
54 virtual ~XmlParser();
55
56 TQString getFilename () const { return _filename; }
57 TQString getDocument () const { return _document.toString(); }
58 Document* getRoot () const { return _root; }
59 FileHeader* getFileHeader () const { return _fileHeader; }
60 TQString getChildName(TQDomNode, int);
61 TQDomNode getChild(TQDomNode, TQString);
62 TQDomNode getChild(TQDomNode, TQString, int);
63 TQDomNode getChild(TQDomNode, int);
64 TQString getData(TQDomNode, int);
65 TQString getData(TQDomNode, TQString);
66 int getNbChild(TQDomNode, TQString);
67 int getNbChild(TQDomNode);
68 TQString getAttr(TQDomNode, TQString) const;
69 bool isChild(TQDomNode, TQString);
70
71 void setFileHeader(FileHeader* h) { _fileHeader = h; }
72 void setRoot (Document* r) { _root = r; }
73
74 TQDomNode init() { return _document.documentElement(); }
75
76};
77
78#endif /* __LATEX_XMLPARSER_H__ */
79
This class hold a whole document with its headers, footers, footnotes, endnotes, content,...
This class hold all general information about the doc : does it use a color markup,...