anchor.cpp
1
2/*
3** A program to convert the XML rendered by KWord into LATEX.
4**
5** Copyright (C) 2000 Robert JACOLIN
6**
7** This library is free software; you can redistribute it and/or
8** modify it under the terms of the GNU Library General Public
9** License as published by the Free Software Foundation; either
10** version 2 of the License, or (at your option) any later version.
11**
12** This library is distributed in the hope that it will be useful,
13** but WITHOUT ANY WARRANTY; without even the implied warranty of
14** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15** Library General Public License for more details.
16**
17** To receive a copy of the GNU Library General Public License, write to the
18** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20**
21*/
22
23#include <stdlib.h> /* for atoi function */
24#include <kdebug.h> /* for kdDebug() stream */
25#include "anchor.h"
26#include "element.h"
27#include "document.h"
28
30{
31}
32
34{
35 kdDebug(30522) << "Destruction of an anchor." << endl;
36}
37
38void Anchor::analyse(const TQDomNode balise)
39{
40 /* MARKUPS FORMAT id="1" pos="0" len="17">...</FORMAT> */
41 Format::analyse(balise);
42
43 /* Parameters Analyse */
44 kdDebug(30522) << "ANALYSE AN ANCHOR" << endl;
45
46 /* Children Markups Analyse */
47 _type = getAttr(getChild(balise, "ANCHOR"), "type");
48 _instance = getAttr(getChild(balise, "ANCHOR"), "instance");
49 kdDebug(30522) << "type = " << _type << " instance = " << _instance << endl;
50
51 kdDebug(30522) << "END OF AN ANCHOR" << endl;
52}
53
54void Anchor::generate(TQTextStream &out)
55{
56 Element *elt = 0;
57
58 kdDebug(30522) << " GENERATION ANCHOR" << endl;
59 /* research the element in all the special elements list
60 * and display it
61 */
62 kdDebug(30522) << "anchor : " << _instance << endl;
63 if((elt = getRoot()->searchAnchor(_instance)) != 0)
64 elt->generate(out);
65 kdDebug(30522) << "ANCHOR GENERATED" << endl;
66}
67
68
void analyse(const TQDomNode)
Helpfull functions.
Definition anchor.cpp:38
Anchor(Para *para=0)
Constructors.
Definition anchor.cpp:29
virtual ~Anchor()
Destructor.
Definition anchor.cpp:33
This class is a element.
This class describe a cell, row or column format.
virtual void analyse(const TQDomNode)
Helpfull functions.
This class hold a real paragraph.
Definition para.h:59