14 #include <QExplicitlySharedDataPointer>
16 #include <QSharedData>
19 #include "scribusapi.h"
21 #include "commonstrings.h"
22 #include "pageitem_textframe.h"
23 #include "styles/cellstyle.h"
118 bool isValid()
const {
return d->isValid && d->table; }
121 int row()
const {
return d->row; }
133 QRectF boundingRect()
const;
136 QRectF contentRect()
const;
139 void setFillColor(
const QString& color) { d->style.setFillColor(color); }
142 QString
fillColor()
const {
return d->style.fillColor(); }
145 void setFillShade(
const double& shade) { d->style.setFillShade(shade); }
148 double fillShade()
const {
return d->style.fillShade(); }
175 void setLeftPadding(
double padding);
181 void setRightPadding(
double padding);
187 void setTopPadding(
double padding);
193 void setBottomPadding(
double padding);
199 void setStyle(
const QString& style);
201 void unsetDirectFormatting();
204 QString
style()
const {
return d->style.parent(); }
207 void setText(
const QString& text);
213 QString asString()
const;
223 void setRow(
int row) { d->row = row; }
225 void setColumn(
int column) { d->column = column; }
227 void setRowSpan(
int rowSpan) { d->rowSpan = rowSpan; }
229 void setColumnSpan(
int columnSpan) { d->columnSpan = columnSpan; }
231 void setValid(
bool isValid) { d->isValid = isValid; }
233 void updateContent();
236 void moveDown(
int numRows) { d->row += numRows; }
238 void moveUp(
int numRows) { d->row -= numRows; }
240 void moveRight(
int numColumns) { d->column += numColumns; }
242 void moveLeft(
int numColumns) { d->column -= numColumns; }
245 double maxLeftBorderWidth()
const;
247 double maxRightBorderWidth()
const;
249 double maxTopBorderWidth()
const;
251 double maxBottomBorderWidth()
const;
255 QExplicitlySharedDataPointer<TableCellData> d;
257 Q_DECLARE_TYPEINFO(
TableCell, Q_MOVABLE_TYPE);
261 return (cell.
row() << 16) ^ cell.
column();
266 #endif // TABLECELL_H
double leftPadding() const
Returns the left padding of this cell.
Definition: tablecell.h:178
QString style() const
Returns the named cell style for this cell.
Definition: tablecell.h:204
TableCellData(const TableCellData &other)
Constructs data from data in other.
Definition: tablecell.h:44
int columnSpan() const
Returns the number of columns this cell spans.
Definition: tablecell.h:130
TableBorder topBorder() const
Returns the top border of this cell.
Definition: tablecell.h:166
bool operator==(const TableCell &other) const
Returns true if this cell is equal to other.
Definition: tablecell.h:112
PageItem_TextFrame * textFrame() const
Returns the text frame for this cell.
Definition: tablecell.h:210
bool operator!=(const TableCell &other) const
Returns true if this cell is not equal to other.
Definition: tablecell.h:115
void setFillColor(const QString &color)
Sets the fill color of this cell to color.
Definition: tablecell.h:139
CellStyle style
Style of the cell.
Definition: tablecell.h:74
TableCell()
Definition: tablecell.h:106
Definition: pageitem_textframe.h:45
Definition: tablecell.h:31
~TableCellData()
Destroys the cell data.
Definition: tablecell.h:54
bool isValid
Cell valid state.
Definition: tablecell.h:61
PageItem_Table * table
Table containing the cell.
Definition: tablecell.h:76
PageItem_TextFrame * textFrame
Text frame of the cell.
Definition: tablecell.h:72
double rightPadding() const
Returns the right padding of this cell.
Definition: tablecell.h:184
int rowSpan() const
Returns the number of rows this cell spans.
Definition: tablecell.h:127
double topPadding() const
Returns the top padding of this cell.
Definition: tablecell.h:190
int rowSpan
Number of rows the cell spans.
Definition: tablecell.h:67
int column
Column of the table the cell is in.
Definition: tablecell.h:65
Definition: tableborder.h:86
std::ostream & operator<<(std::ostream &out_file, const Geom::Matrix &m)
Definition: matrix.h:109
TableCell(const TableCell &other)
Construct a new table cell as a shallow copy of other.
Definition: tablecell.h:109
QString fillColor() const
Returns the fill color of this cell.
Definition: tablecell.h:142
int column() const
Returns the column in the table that contains this cell.
Definition: tablecell.h:124
Definition: cellstyle.h:32
int columnSpan
Number of columns the cell spans.
Definition: tablecell.h:69
Definition: scpainter.h:33
TableBorder rightBorder() const
Returns the right border of this cell.
Definition: tablecell.h:160
int row() const
Returns the row in the table that contains this cell.
Definition: tablecell.h:121
int row
Row of the table the cell is in.
Definition: tablecell.h:63
bool isValid() const
Returns true if this cell is valid.
Definition: tablecell.h:118
void setFillShade(const double &shade)
Sets the fill color of this cell to color.
Definition: tablecell.h:145
Definition: tablecell.h:97
TableBorder bottomBorder() const
Returns the bottom border of this cell.
Definition: tablecell.h:172
double fillShade() const
Returns the fill color of this cell.
Definition: tablecell.h:148
TableCellData()
Constructs data for an invalid cell.
Definition: tablecell.h:35
TableBorder leftBorder() const
Returns the left border of this cell.
Definition: tablecell.h:154
Definition: pageitem_table.h:49
double bottomPadding() const
Returns the bottom padding of this cell.
Definition: tablecell.h:196