filters

anchor.cc

00001 
00002 /*
00003 ** A program to convert the XML rendered by KWord into LATEX.
00004 **
00005 ** Copyright (C) 2000 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 #include <stdlib.h>     /* for atoi function */
00024 #include <kdebug.h>     /* for kdDebug() stream */
00025 #include "anchor.h"
00026 #include "element.h"
00027 #include "document.h"
00028 
00029 Anchor::Anchor(Para* para): Format(para)
00030 {
00031 }
00032 
00033 Anchor::~Anchor()
00034 {
00035     kdDebug(30522) << "Destruction of an anchor." << endl;
00036 }
00037 
00038 void Anchor::analyse(const QDomNode balise)
00039 {
00040     /* MARKUPS FORMAT id="1" pos="0" len="17">...</FORMAT> */
00041     Format::analyse(balise);
00042 
00043     /* Parameters Analyse */
00044     kdDebug(30522) << "ANALYSE AN ANCHOR" << endl;
00045     
00046     /* Children Markups Analyse */
00047     _type = getAttr(getChild(balise, "ANCHOR"), "type");
00048     _instance = getAttr(getChild(balise, "ANCHOR"), "instance");
00049     kdDebug(30522) << "type = " << _type << " instance = " << _instance << endl;
00050     
00051     kdDebug(30522) << "END OF AN ANCHOR" << endl;
00052 }
00053 
00054 void Anchor::generate(QTextStream &out)
00055 {
00056     Element *elt = 0;
00057 
00058     kdDebug(30522) << "  GENERATION ANCHOR" << endl;
00059     /* research the element in all the special elements list
00060      * and display it
00061      */
00062     kdDebug(30522) << "anchor : " << _instance << endl;
00063     if((elt = getRoot()->searchAnchor(_instance)) != 0)
00064         elt->generate(out);
00065     kdDebug(30522) << "ANCHOR GENERATED" << endl;
00066 }
00067 
00068 
KDE Home | KDE Accessibility Home | Description of Access Keys