filters

map.cc

00001 /*
00002 ** A program to convert the XML rendered by KWord into LATEX.
00003 **
00004 ** Copyright (C) 2000, 2001, 2002 Robert JACOLIN
00005 **
00006 ** This library is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU Library General Public
00008 ** License as published by the Free Software Foundation; either
00009 ** version 2 of the License, or (at your option) any later version.
00010 **
00011 ** This library is distributed in the hope that it will be useful,
00012 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 ** Library General Public License for more details.
00015 **
00016 ** To receive a copy of the GNU Library General Public License, write to the
00017 ** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 **
00020 */
00021 
00022 #include <stdlib.h>     /* for atoi function    */
00023 #include <kdebug.h>     /* for kdDebug() stream */
00024 #include "map.h"
00025 
00026 /*******************************************/
00027 /* Constructor                             */
00028 /*******************************************/
00029 Map::Map()
00030 {
00031 }
00032 
00033 /*******************************************/
00034 /* Destructor                              */
00035 /*******************************************/
00036 Map::~Map()
00037 {
00038     kdDebug(30522) << "Destruction of a map." << endl;
00039 }
00040 
00041 /*******************************************/
00042 /* Analyse                                 */
00043 /*******************************************/
00044 void Map::analyse(const QDomNode balise)
00045 {
00046     /* Analyse of the parameters */
00047     kdDebug(30522) << "ANALYSE A MAP" << endl;
00048 
00049     /* Analyse of the children markups */
00050     for(int index = 0; index < getNbChild(balise); index++)
00051     {
00052         // Only tables
00053         Table* table = new Table();
00054         table->analyse(getChild(balise, index));
00055         _tables.append(table);
00056     }
00057     kdDebug(30522) << "END OF MAP" << endl;
00058 }
00059 
00060 /*******************************************/
00061 /* Generate                                */
00062 /*******************************************/
00063 /* Generate each text zone with the parag. */
00064 /* markup.                                 */
00065 /*******************************************/
00066 void Map::generate(QTextStream &out)
00067 {
00068     Table *table = NULL;
00069     kdDebug(30522) << "  MAP GENERATION" << endl;
00070     QPtrListIterator<Table> it(_tables);
00071     while ( (table = it.current()) != 0 )
00072     {
00073         ++it;
00074         table->generate(out);
00075     }
00076 
00077     kdDebug(30522) << "MAP GENERATED" << endl;
00078 }
00079 
KDE Home | KDE Accessibility Home | Description of Access Keys