filters

xmlparser.h

00001 
00002 /*
00003 ** Header file for inclusion with kword_xml2latex.c
00004 **
00005 ** Copyright (C) 2000-2002 Robert JACOLIN
00006 **
00007 ** This library is free software; you can redistribute it and/or
00008 ** modify it under the terms of the GNU Library General Public
00009 ** License as published by the Free Software Foundation; either
00010 ** version 2 of the License, or (at your option) any later version.
00011 **
00012 ** This library is distributed in the hope that it will be useful,
00013 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 ** Library General Public License for more details.
00016 **
00017 ** To receive a copy of the GNU Library General Public License, write to the
00018 ** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 **
00021 */
00022 
00023 #ifndef __LATEX_XMLPARSER_H__
00024 #define __LATEX_XMLPARSER_H__
00025 
00026 #include "qstring.h"
00027 #include "qdom.h"
00028 
00029 class FileHeader;
00030 class Document;
00031 class KoStore;
00032 
00033 class XmlParser
00034 {
00036     QString _filename;
00038     QDomDocument _document;
00040     static KoStore* _in;
00041 
00042     protected:
00043         /* All the inherit class must be have a link with
00044          * the header to specify to use special package
00045          */
00046         static FileHeader *_fileHeader;
00047         static Document   *_root;
00048 
00049     public:
00050         XmlParser(QString);
00051     XmlParser(QByteArray);  /* deprecated */
00052         XmlParser(const KoStore*);
00053         XmlParser();
00054         virtual ~XmlParser();
00055 
00056         QString     getFilename     () const { return _filename;            }
00057         QString     getDocument     () const { return _document.toString(); }
00058         Document*   getRoot         () const { return _root;                }
00059         FileHeader* getFileHeader   () const { return _fileHeader; }
00060         QString     getChildName(QDomNode, int);
00061         QDomNode    getChild(QDomNode, QString);
00062         QDomNode    getChild(QDomNode, QString, int);
00063         QDomNode    getChild(QDomNode, int);
00064         QString     getData(QDomNode, int);
00065         QString     getData(QDomNode, QString);
00066         int         getNbChild(QDomNode, QString);
00067         int         getNbChild(QDomNode);
00068         QString     getAttr(QDomNode, QString) const;
00069         bool        isChild(QDomNode, QString);
00070 
00071         void setFileHeader(FileHeader* h) { _fileHeader = h; }
00072         void setRoot      (Document*   r) { _root       = r; }
00073 
00074         QDomNode init() { return _document.documentElement(); }
00075 
00076 };
00077 
00078 #endif /* __LATEX_XMLPARSER_H__ */
00079 
KDE Home | KDE Accessibility Home | Description of Access Keys