map.cpp
1/*
2** A program to convert the XML rendered by KWord into LATEX.
3**
4** Copyright (C) 2000, 2001, 2002 Robert JACOLIN
5**
6** This library is free software; you can redistribute it and/or
7** modify it under the terms of the GNU Library General Public
8** License as published by the Free Software Foundation; either
9** version 2 of the License, or (at your option) any later version.
10**
11** This library is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14** Library General Public License for more details.
15**
16** To receive a copy of the GNU Library General Public License, write to the
17** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19**
20*/
21
22#include <stdlib.h> /* for atoi function */
23#include <kdebug.h> /* for kdDebug() stream */
24#include "map.h"
25
26/*******************************************/
27/* Constructor */
28/*******************************************/
30{
31}
32
33/*******************************************/
34/* Destructor */
35/*******************************************/
36Map::~Map()
37{
38 kdDebug(30522) << "Destruction of a map." << endl;
39}
40
41/*******************************************/
42/* Analyse */
43/*******************************************/
44void Map::analyse(const TQDomNode balise)
45{
46 /* Analyse of the parameters */
47 kdDebug(30522) << "ANALYSE A MAP" << endl;
48
49 /* Analyse of the children markups */
50 for(int index = 0; index < getNbChild(balise); index++)
51 {
52 // Only tables
53 Table* table = new Table();
54 table->analyse(getChild(balise, index));
55 _tables.append(table);
56 }
57 kdDebug(30522) << "END OF MAP" << endl;
58}
59
60/*******************************************/
61/* Generate */
62/*******************************************/
63/* Generate each text zone with the parag. */
64/* markup. */
65/*******************************************/
66void Map::generate(TQTextStream &out)
67{
68 Table *table = NULL;
69 kdDebug(30522) << " MAP GENERATION" << endl;
70 TQPtrListIterator<Table> it(_tables);
71 while ( (table = it.current()) != 0 )
72 {
73 ++it;
74 table->generate(out);
75 }
76
77 kdDebug(30522) << "MAP GENERATED" << endl;
78}
79
Map()
Constructors.
Definition map.cpp:29
void analyse(const TQDomNode)
Accessors.
Definition map.cpp:44
void generate(TQTextStream &)
Write the paragraph in a file.
Definition map.cpp:66
This class hold a table.
void analyse(const TQDomNode)
Helpfull functions.