18 #ifndef QGSCOMPOSERTABLEV2_H 19 #define QGSCOMPOSERTABLEV2_H 61 , cellBackgroundColor(
QColor( 255, 255, 255, 255 ) )
156 void setCellMargin(
const double margin );
184 void setEmptyTableMessage(
const QString& message );
199 void setShowEmptyRows(
const bool showEmpty );
212 void setHeaderFont(
const QFont& font );
227 void setHeaderFontColor(
const QColor& color );
268 void setContentFont(
const QFont& font );
283 void setContentFontColor(
const QColor& color );
299 void setShowGrid(
const bool showGrid );
315 void setGridStrokeWidth(
const double width );
331 void setGridColor(
const QColor& color );
346 void setBackgroundColor(
const QColor& color );
436 virtual void refreshAttributes();
503 virtual bool calculateMaxColumnWidths();
508 virtual bool calculateMaxRowHeights();
522 double totalHeight();
535 int rowsVisible(
double frameHeight,
int firstRow,
bool includeHeader,
bool includeEmptyRows )
const;
546 int rowsVisible(
int frameIndex,
int firstRow,
bool includeEmptyRows )
const;
564 void drawHorizontalGridLines(
QPainter* painter,
int firstRow,
int lastRow,
bool drawHeaderLines )
const;
581 void drawVerticalGridLines(
QPainter* painter,
const QMap<int, double>& maxWidthMap,
int firstRow,
int lastRow,
bool hasHeader,
bool mergeCells =
false )
const;
585 void recalculateTableSize();
601 Q_DECL_DEPRECATED
int rowsVisible(
const int frameIndex )
const;
610 Q_DECL_DEPRECATED
int rowsVisible(
const double frameHeight,
const bool includeHeader )
const;
628 Q_DECL_DEPRECATED
void drawHorizontalGridLines(
QPainter* painter,
const int rows,
const bool drawHeaderLines )
const;
643 Q_DECL_DEPRECATED
void drawVerticalGridLines(
QPainter* painter,
const QMap<int, double>& maxWidthMap,
const int numberRows,
const bool hasHeader,
const bool mergeCells =
false )
const;
652 bool textRequiresWrapping(
const QString& text,
double columnWidth ,
const QFont &font )
const;
661 QColor backgroundColor(
int row,
int column )
const;
663 friend class TestQgsComposerTableV2;
666 #endif // QGSCOMPOSERTABLEV2_H QColor mContentFontColor
Table contents font color.
QFont mContentFont
Table contents font.
virtual void recalculateFrameSizes()
Recalculates the portion of the multiframe item which is shown in each of it's component frames...
HeaderMode headerMode() const
Returns the display mode for headers in the table.
WrapBehaviour mWrapBehaviour
bool mShowGrid
True if grid should be shown.
bool showGrid() const
Returns whether grid lines are drawn in the table.
double mGridStrokeWidth
Width of grid lines.
HeaderMode
Controls where headers are shown in the table.
QMap< CellStyleGroup, QgsComposerTableStyle *> mCellStyles
QFont mHeaderFont
Header font.
EmptyTableMode emptyTableBehaviour() const
Returns the behaviour mode for empty tables.
virtual QSizeF totalSize() const =0
Returns the total size of the multiframe's content.
QString emptyTableMessage() const
Returns the message for empty tables with no content rows.
HeaderHAlignment headerHAlignment() const
Returns the horizontal alignment for table headers.
QFont contentFont() const
Returns the font used to draw text in table body cells.
EmptyTableMode mEmptyTableMode
Behaviour for empty tables.
QColor mHeaderFontColor
Header font color.
double mCellMargin
Margin between cell borders and cell text.
EmptyTableMode
Controls how empty tables are displayed.
QColor contentFontColor() const
Returns the color used to draw text in table body cells.
QList< QgsComposerTableRow > QgsComposerTableContents
List of QgsComposerTableRows, representing rows and column cell contents for a QgsComposerTable.
HeaderMode mHeaderMode
Header display mode.
bool enabled
Whether the styling option is enabled.
QList< QVariant > QgsComposerTableRow
List of QVariants, representing a the contents of a single row in a QgsComposerTable.
bool mShowEmptyRows
True if empty rows should be shown in the table.
Abstract base class for composer items with the ability to distribute the content to several frames (...
HeaderHAlignment mHeaderHAlignment
Alignment for table headers.
WrapBehaviour
Controls how long strings in the table are handled.
double cellMargin() const
Returns the margin distance between cell borders and their contents.
A class to display a table in the print composer, and allow the table to span over multiple frames...
QFont headerFont() const
Returns the font used to draw header text in the table.
WrapBehaviour wrapBehaviour() const
Returns the wrap behaviour for the table, which controls how text within cells is automatically wrapp...
QMap< int, double > mMaxColumnWidthMap
Map of maximum width for each column.
QList< QgsComposerTableColumn * > QgsComposerTableColumns
List of column definitions for a QgsComposerTable.
Stores properties of a column in a QgsComposerTable.
Graphics scene for map printing.
QColor mGridColor
Color for grid lines.
HeaderHAlignment
Controls how headers are horizontally aligned in a table.
QgsComposerTableContents mTableContents
Contents to show in table.
QString mEmptyTableMessage
String to show in empty tables.
double gridStrokeWidth() const
Returns the width of grid lines in the table.
QgsComposerTableColumns mColumns
Columns to show in table.
CellStyleGroup
Row or column groups for cell styling.
virtual QSizeF minFrameSize(const int frameIndex=-1) const
Returns the minimum size for a frames, if desired.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const =0
Stores state information about multiframe in DOM element.
QColor headerFontColor() const
Returns the color used to draw header text in the table.
virtual QSizeF fixedFrameSize(const int frameIndex=-1) const
Returns the fixed size for a frame, if desired.
virtual Q_DECL_DEPRECATED void render(QPainter *p, const QRectF &renderExtent)
Renders a portion of the multiframe's content into a painter.
QgsComposerTableColumns * columns()
Returns a pointer to the list of QgsComposerTableColumns shown in the table.
QColor backgroundColor() const
Returns the color used for the background of the table.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)=0
Reads multiframe state information from a DOM element.
Styling option for a composer table cell.
QColor mBackgroundColor
Color for table background.
QgsComposerTableContents * contents()
Returns the current contents of the table.
bool showEmptyRows() const
Returns whether empty rows are drawn in the table.
QColor gridColor() const
Returns the color used for grid lines in the table.
QMap< int, double > mMaxRowHeightMap
Map of maximum height for each row.
QColor cellBackgroundColor
Cell background color.