filters

kspread/latex/export/table.h
1
2/*
3** Header file for inclusion with kword_xml2latex.c
4**
5** Copyright (C) 2002, 2003 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#ifndef __KSPREAD_LATEX_TABLE_H__
24#define __KSPREAD_LATEX_TABLE_H__
25
26#include <tqstring.h>
27#include <tqptrlist.h>
28
29#include "xmlparser.h"
30#include "config.h"
31//#include "cell.h"
32
33class Cell;
34class Column;
35class Row;
36
37/***********************************************************************/
38/* Class: Table */
39/***********************************************************************/
40
46class Table: public XmlParser, Config
47{
48 TQPtrList<Row> _rows;
49 TQPtrList<Column> _columns;
50 TQPtrList<Cell> _cells;
51
52 /* USEFULL DATA */
53 int _maxRow, _maxCol; /* Size of the table (nb of cell) */
54 bool _columnNumber;
55 bool _borders;
56 bool _hide;
57 bool _hideZero;
58 bool _firstletterupper;
59 bool _grid;
60 bool _printGrid;
61 bool _printCommentIndicator;
62 bool _printFormulaIndicator;
63 bool _showFormula;
64 bool _showFormulaIndicator;
65 bool _lcMode;
66 TQString _name;
67
69 TQString _format;
70 TQString _orientation;
71 long _borderRight;
72 long _borderLeft;
73 long _borderBottom;
74 long _borderTop;
75
76 public:
81
85 Table();
86
87 /*
88 * Destructor
89 *
90 * The destructor must remove the list of frames.
91 */
92
93 virtual ~Table();
94
98
99 int getMaxRow() const { return _maxRow; }
100 int getMaxColumn() const { return _maxCol; }
101 TQString getName() const { return _name; }
102 TQString getFormat() const { return _format; }
103 TQString getOrientation() const { return _orientation; }
104 long getBorderRight() const { return _borderRight; }
105 long getBorderLeft() const { return _borderLeft; }
106 long getBorderBottom() const { return _borderBottom; }
107 long getBorderTop() const { return _borderTop; }
108
109 bool isColumnNumber() const { return _columnNumber; }
110 bool isBorders() const { return _borders; }
111 bool isHide() const { return _hide; }
112 bool isHideZero() const { return _hideZero; }
113 bool isFirstletterupper() const { return _firstletterupper; }
114 bool isGrid() const { return _grid; }
115 bool isPrintGrid() const { return _printGrid; }
116 bool isPrintCommentIndicator() const { return _printCommentIndicator; }
117 bool isPrintFormulaIndicator() const { return _printFormulaIndicator; }
118 bool isShowFormula() const { return _showFormula; }
119 bool isShowFormulaIndicator() const { return _showFormulaIndicator; }
120 bool isLCMode() const { return _lcMode; }
121
125 void setMaxRow(int r);
126 void setMaxColumn(int c);
127 void setName(TQString name) { _name = name; }
128 void setFormat(TQString format) { _format = format; }
129 void setOrientation(TQString orient) { _orientation = orient; }
130 void setBorderRight(long br) { _borderRight = br; }
131 void setBorderLeft(long bl) { _borderLeft = bl; }
132 void setBorderBottom(long bb) { _borderBottom = bb; }
133 void setBorderTop(long bt) { _borderTop = bt; }
134
135 void setColumnNumber() { _columnNumber = true; }
136 void setBorders() { _borders = true; }
137 void setHide() { _hide = true; }
138 void setHideZero() { _hideZero = true; }
139 void setFirstletterupper() { _firstletterupper = true; }
140 void setGrid() { _grid = true; }
141 void setPrintGrid() { _printGrid = true; }
142 void setPrintCommentIndicator() { _printCommentIndicator = true; }
143 void setPrintFormulaIndicator() { _printFormulaIndicator = true; }
144 void setShowFormula() { _showFormula = true; }
145 void setShowFormulaIndicator() { _showFormulaIndicator = true; }
146 void setLCMode() { _lcMode = true; }
147
151
158 Cell* searchCell(int col,int row);
159
165 Column* searchColumn(int col);
166
172 Row* searchRow(int row);
173
174 void analyse (const TQDomNode);
175 void analysePaper (const TQDomNode);
176 void generate (TQTextStream&);
177
178 private:
179 void generateCell(TQTextStream&, int, int);
180 void generateTableHeader(TQTextStream&);
181 void generateTopLineBorder(TQTextStream&, int);
182 void generateBottomLineBorder(TQTextStream&, int);
183};
184
185#endif /* __KSPREAD_LATEX_TABLE_H__ */
186
This class hold a column.
Definition column.h:38
This class hold a row.
Definition row.h:38
Table()
Constructors.
Cell * searchCell(int col, int row)
Helpfull functions.
Column * searchColumn(int col)
Return one specific column which describe the format of the column.
int getMaxRow() const
getters
Row * searchRow(int row)
Return one specific row which describe the format of the row.
void analyse(const TQDomNode)
Helpfull functions.
void setMaxRow(int r)
setters