filters
table.h
00001 00002 /* 00003 ** Header file for inclusion with kword_xml2latex.c 00004 ** 00005 ** Copyright (C) 2002, 2003 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 #ifndef __KSPREAD_LATEX_TABLE_H__ 00024 #define __KSPREAD_LATEX_TABLE_H__ 00025 00026 #include <qstring.h> 00027 #include <qptrlist.h> 00028 00029 #include "xmlparser.h" 00030 #include "config.h" 00031 //#include "cell.h" 00032 00033 class Cell; 00034 class Column; 00035 class Row; 00036 00037 /***********************************************************************/ 00038 /* Class: Table */ 00039 /***********************************************************************/ 00040 00046 class Table: public XmlParser, Config 00047 { 00048 QPtrList<Row> _rows; 00049 QPtrList<Column> _columns; 00050 QPtrList<Cell> _cells; 00051 00052 /* USEFULL DATA */ 00053 int _maxRow, _maxCol; /* Size of the table (nb of cell) */ 00054 bool _columnNumber; 00055 bool _borders; 00056 bool _hide; 00057 bool _hideZero; 00058 bool _firstletterupper; 00059 bool _grid; 00060 bool _printGrid; 00061 bool _printCommentIndicator; 00062 bool _printFormulaIndicator; 00063 bool _showFormula; 00064 bool _showFormulaIndicator; 00065 bool _lcMode; 00066 QString _name; 00067 00069 QString _format; 00070 QString _orientation; 00071 long _borderRight; 00072 long _borderLeft; 00073 long _borderBottom; 00074 long _borderTop; 00075 00076 public: 00085 Table(); 00086 00087 /* 00088 * Destructor 00089 * 00090 * The destructor must remove the list of frames. 00091 */ 00092 00093 virtual ~Table(); 00094 00099 int getMaxRow() const { return _maxRow; } 00100 int getMaxColumn() const { return _maxCol; } 00101 QString getName() const { return _name; } 00102 QString getFormat() const { return _format; } 00103 QString getOrientation() const { return _orientation; } 00104 long getBorderRight() const { return _borderRight; } 00105 long getBorderLeft() const { return _borderLeft; } 00106 long getBorderBottom() const { return _borderBottom; } 00107 long getBorderTop() const { return _borderTop; } 00108 00109 bool isColumnNumber() const { return _columnNumber; } 00110 bool isBorders() const { return _borders; } 00111 bool isHide() const { return _hide; } 00112 bool isHideZero() const { return _hideZero; } 00113 bool isFirstletterupper() const { return _firstletterupper; } 00114 bool isGrid() const { return _grid; } 00115 bool isPrintGrid() const { return _printGrid; } 00116 bool isPrintCommentIndicator() const { return _printCommentIndicator; } 00117 bool isPrintFormulaIndicator() const { return _printFormulaIndicator; } 00118 bool isShowFormula() const { return _showFormula; } 00119 bool isShowFormulaIndicator() const { return _showFormulaIndicator; } 00120 bool isLCMode() const { return _lcMode; } 00121 00125 void setMaxRow(int r); 00126 void setMaxColumn(int c); 00127 void setName(QString name) { _name = name; } 00128 void setFormat(QString format) { _format = format; } 00129 void setOrientation(QString orient) { _orientation = orient; } 00130 void setBorderRight(long br) { _borderRight = br; } 00131 void setBorderLeft(long bl) { _borderLeft = bl; } 00132 void setBorderBottom(long bb) { _borderBottom = bb; } 00133 void setBorderTop(long bt) { _borderTop = bt; } 00134 00135 void setColumnNumber() { _columnNumber = true; } 00136 void setBorders() { _borders = true; } 00137 void setHide() { _hide = true; } 00138 void setHideZero() { _hideZero = true; } 00139 void setFirstletterupper() { _firstletterupper = true; } 00140 void setGrid() { _grid = true; } 00141 void setPrintGrid() { _printGrid = true; } 00142 void setPrintCommentIndicator() { _printCommentIndicator = true; } 00143 void setPrintFormulaIndicator() { _printFormulaIndicator = true; } 00144 void setShowFormula() { _showFormula = true; } 00145 void setShowFormulaIndicator() { _showFormulaIndicator = true; } 00146 void setLCMode() { _lcMode = true; } 00147 00158 Cell* searchCell(int col,int row); 00159 00165 Column* searchColumn(int col); 00166 00172 Row* searchRow(int row); 00173 00174 void analyse (const QDomNode); 00175 void analysePaper (const QDomNode); 00176 void generate (QTextStream&); 00177 00178 private: 00179 void generateCell(QTextStream&, int, int); 00180 void generateTableHeader(QTextStream&); 00181 void generateTopLineBorder(QTextStream&, int); 00182 void generateBottomLineBorder(QTextStream&, int); 00183 }; 00184 00185 #endif /* __KSPREAD_LATEX_TABLE_H__ */ 00186