filters

kspread/latex/export/document.cpp
1/* TODO : Manage File problems !
2 */
3/*
4** A program to convert the XML rendered by KWord into LATEX.
5**
6** Copyright (C) 2000, 2003 Robert JACOLIN
7**
8** This library is free software; you can redistribute it and/or
9** modify it under the terms of the GNU Library General Public
10** License as published by the Free Software Foundation; either
11** version 2 of the License, or (at your option) any later version.
12**
13** This library is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16** Library General Public License for more details.
17**
18** To receive a copy of the GNU Library General Public License, write to the
19** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21**
22*/
23
24#include <kdebug.h>
25
26#include "document.h"
27
28Document::Document(const KoStore* in, TQString fileOut):
29 XmlParser(in), _file(fileOut), _in( in )
30{
31 //kdDebug(30522) << fileIn.latin1() << endl;
32 kdDebug(30522) << fileOut.latin1() << endl;
33 _filename = fileOut;
34 //setFileHeader(_fileHeader);
35 //setRoot(&_document);
36 Config::instance()->setEmbeded(false);
37 //analyse_config(config);
38}
39
41{
42
43}
44
45void Document::analyse()
46{
47 TQDomNode balise;
48 balise = init();
49 kdDebug(30522) << "ANALYSE A DOC" << endl;
50 _document.analyse(balise);
51 kdDebug(30522) << "END ANALYSE" << endl;
52}
53
54void Document::generate()
55{
56 if(_file.open(IO_WriteOnly))
57 {
58 kdDebug(30522) << "GENERATION" << endl;
59 _out.setDevice(&_file);
60 _document.generate(_out, !isEmbeded());
61 //_out << getDocument();
62 _file.close();
63 }
64 else
65 kdDebug(30522) << "Can't use the file ..." << endl;
66}
virtual ~Document()
Destructor.