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 #include "config.h"
00029 
00030 class FileHeader;
00031 class Document;
00032 class KoStore;
00033 
00040 class XmlParser
00041 {
00043     QDomDocument _document;
00045     static KoStore* _in;
00047     Config *_config;
00048 
00049     protected:
00050         /* All the inherit class must be have a link with
00051          * the header to specify to use special package
00052          */
00053         //static FileHeader *_fileHeader;
00054         static Document   *_root;
00056         static QString _filename;
00057 
00058     public:
00059         XmlParser(Config*, QString);
00060     XmlParser(Config*, QByteArray); /* deprecated */
00061         XmlParser(Config*, const KoStore*);
00062         XmlParser();
00063         virtual ~XmlParser();
00064 
00065         QString     getFilename     () const { return _filename;            }
00066         QString     getDocument     () const { return _document.toString(); }
00067         Document*   getRoot         () const { return _root;                }
00068         //FileHeader* getFileHeader   () const { return _fileHeader; }
00069         KoStore*    getStorage      () const { return _in; }
00070         QString     getChildName(QDomNode, int);
00071         QDomNode    getChild(QDomNode, QString);
00072         QDomNode    getChild(QDomNode, QString, int);
00073         QDomNode    getChild(QDomNode, int);
00074         QString     getData(QDomNode, int);
00075         int         getNbChild(QDomNode, QString);
00076         int         getNbChild(QDomNode);
00077         QString     getAttr(QDomNode, QString) const;
00078         bool        isChild(QDomNode, QString);
00079 
00080         //void setFileHeader(FileHeader* h) { _fileHeader = h; }
00081         void setRoot      (Document*   r) { _root       = r; }
00082 
00083         QDomNode init() { return _document.documentElement(); }
00084 
00085 };
00086 
00087 #endif /* __LATEX_XMLPARSER_H__ */
00088 
KDE Home | KDE Accessibility Home | Description of Access Keys