File indexing completed on 2025-02-16 13:49:56

0001 /*
0002 **
0003 ** Copyright (C) 2002 Robert JACOLIN
0004 **
0005 ** This library is free software; you can redistribute it and/or
0006 ** modify it under the terms of the GNU Library General Public
0007 ** License as published by the Free Software Foundation; either
0008 ** version 2 of the License, or (at your option) any later version.
0009 **
0010 ** This library is distributed in the hope that it will be useful,
0011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013 ** Library General Public License for more details.
0014 **
0015 ** To receive a copy of the GNU Library General Public License, write to the
0016 ** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 **
0019 */
0020 
0021 #ifndef __CALLIGRA_SHEETS_LATEX_CELL_H__
0022 #define __CALLIGRA_SHEETS_LATEX_CELL_H__
0023 
0024 #include <QString>
0025 #include <QTextStream>
0026 
0027 #include "config.h"
0028 #include "format.h"
0029 #include "xmlparser.h"
0030 
0031 /***********************************************************************/
0032 /* Class: Cell                                                        */
0033 /***********************************************************************/
0034 
0035 class Table;
0036 
0037 /**
0038  * This class hold a cell.
0039  */
0040 class Cell: public Format
0041 {
0042 
0043     /* USEFUL DATA */
0044     long _row;
0045     long _col;
0046     QString _text;
0047     QString _textDataType;
0048     QString _result;
0049     QString _resultDataType;
0050 
0051 
0052 public:
0053     /**
0054      * Constructors
0055      *
0056      */
0057 
0058     /**
0059      * Creates a new instance of Cell.
0060      */
0061     Cell();
0062 
0063     Cell(long row, long col) {
0064         _row = row;
0065         _col = col;
0066     }
0067 
0068     /*
0069      * Destructor
0070      *
0071      * The destructor must remove the list of frames.
0072      */
0073 
0074     ~Cell() override;
0075 
0076     /* ==== getters ==== */
0077 
0078     long     getRow() const {
0079         return _row;
0080     }
0081     long     getCol() const {
0082         return _col;
0083     }
0084     QString  getText() const {
0085         return _text;
0086     }
0087     QString  getTextDataType() const {
0088         return _textDataType;
0089     }
0090     QString  getResult() const {
0091         return _result;
0092     }
0093     QString  getResultDataType() const {
0094         return _resultDataType;
0095     }
0096 
0097     /* ==== setters ==== */
0098     void setRow(int r) {
0099         _row = r;
0100     }
0101     void setCol(int c) {
0102         _col = c;
0103     }
0104     void setText(QString text) {
0105         _text = text;
0106     }
0107     void setTextDataType(QString dt) {
0108         _textDataType = dt;
0109     }
0110     void setResult(QString result) {
0111         _result = result;
0112     }
0113     void setResultDataType(QString dt) {
0114         _resultDataType = dt;
0115     }
0116 
0117     /**
0118      * Helpful functions
0119      */
0120     void     analyze(const QDomNode) override;
0121     void     analyzeText(const QDomNode);
0122     void     analyzeResult(const QDomNode);
0123     void     generate(QTextStream&, Table*);
0124 
0125 private:
0126 
0127 };
0128 
0129 #endif /* __CALLIGRA_SHEETS_LATEX_CELL_H__ */
0130