filters
xml2latexparser.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <kdebug.h>
00025
00026 #include "xml2latexparser.h"
00027
00028 Xml2LatexParser::Xml2LatexParser(const KoStore* in, QString fileOut, Config* config):
00029 XmlParser(config, in), _file(fileOut), _in( in )
00030 {
00031
00032 kdDebug(30522) << fileOut.latin1() << endl;
00033 _filename = fileOut;
00034
00035 setRoot(&_document);
00036 }
00037
00038 void Xml2LatexParser::analyse()
00039 {
00040 QDomNode balise;
00041 balise = init();
00042
00043 kdDebug(30522) <<"HEADER -> PAPER" << endl;
00044 FileHeader::instance()->analysePaper(getChild(balise, "PAPER"));
00045 kdDebug(30522) <<"HEADER -> ATTRIBUTES" << endl;
00046 FileHeader::instance()->analyseAttributs(getChild(balise, "ATTRIBUTES"));
00047 kdDebug(30522) <<"HEADER -> FRAMESETS" << endl;
00048 _document.analyse(getChild(balise, "FRAMESETS"));
00049 kdDebug(30522) <<"HEADER -> END FRAMESETS" << endl;
00050
00051
00052 kdDebug(30522) <<"HEADER -> PICTURES" << endl;
00053 _document.analysePixmaps(getChild(balise, "PICTURES"));
00054
00055 kdDebug(30522) << "END ANALYSE" << endl;
00056 }
00057
00058 void Xml2LatexParser::generate()
00059 {
00060 if(_file.open(IO_WriteOnly))
00061 {
00062 kdDebug(30522) << "GENERATION" << endl;
00063 _out.setDevice(&_file);
00064 if(!Config::instance()->isEmbeded())
00065 FileHeader::instance()->generate(_out);
00066 _document.generate(_out, !Config::instance()->isEmbeded());
00067
00068 _file.close();
00069 }
00070 else
00071 kdDebug(30522) << "Can't use the file ..." << endl;
00072 }
|