filters

export/element.cpp
1/*
2** A program to convert the XML rendered by KWord into LATEX.
3**
4** Copyright (C) 2000 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>
23#include <kdebug.h>
24#include "element.h"
25
26/*******************************************/
27/* Constructor */
28/*******************************************/
30{
31 _type = ST_NONE;
32 _hinfo = SI_NONE;
33 _section = SS_NONE;
34 _name = "";
35 _removable = false;
36 _visible = true;
37 _row = 0;
38 _col = 0;
39 _rows = 0;
40 _cols = 0;
41 setGrpMgr("");
42}
43
44/*******************************************/
45/* Destructor */
46/*******************************************/
47Element::~Element()
48{
49 kdDebug(30522) << "Element Destructor" << endl;
50}
51
52/*******************************************/
53/* Analyse */
54/*******************************************/
55void Element::analyse(const TQDomNode balise_initiale)
56{
57 /* ANALYSE A FRAMESET MARKUP */
58
59 /* Parameters Analyse */
60 kdDebug(30522) << "FRAMESET PARAMETERS ANALYSE (Element)" << endl;
61 analyseParam(balise_initiale);
62}
63
64/*******************************************/
65/* AnalyseParam */
66/*******************************************/
67void Element::analyseParam(const TQDomNode balise)
68{
69 /* <FRAMESET frameType="1" frameInfo="0" removable="0"
70 * visible="1" name="Supercadre 1">
71 */
72 _name = getAttr(balise, "name");
73 _type = (SType) getAttr(balise, "frameType").toInt();
74 switch(getAttr(balise, "frameInfo").toInt())
75 {
76 case 0: _section = SS_BODY;
77 break;
78 case 1: _section = SS_HEADERS;
79 _hinfo = SI_FIRST;
80 break;
81 case 2: _section = SS_HEADERS;
82 _hinfo = SI_ODD;
83 break;
84 case 3: _section = SS_HEADERS;
85 _hinfo = SI_EVEN;
86 break;
87 case 4: _section = SS_FOOTERS;
88 _hinfo = SI_FIRST;
89 break;
90 case 5: _section = SS_FOOTERS;
91 _hinfo = SI_ODD;
92 break;
93 case 6: _section = SS_FOOTERS;
94 _hinfo = SI_EVEN;
95 break;
96 case 7: _section = SS_FOOTNOTES;
97 break;
98 default:
99 _section = SS_NONE;
100 kdDebug(30522) << "error : frameinfo unknown!" << endl;
101 }
102 setRemovable(getAttr(balise, "removable").toInt());
103 setVisible(getAttr(balise, "visible").toInt());
104 if(getAttr(balise, "grpMgr")!= 0)
105 {
106 _section = SS_TABLE;
107 setGrpMgr(getAttr(balise, "grpMgr"));
108 }
109 setRow(getAttr(balise, "row").toInt());
110 setCol(getAttr(balise, "col").toInt());
111 setRows(getAttr(balise, "rows").toInt());
112 setCols(getAttr(balise, "cols").toInt());
113
114 kdDebug(30522) << "FIN PARAM" << endl;
115}
Element()
Constructors.
virtual void analyse(const TQDomNode)
Helpfull functions.