17#include <wx/wfstream.h>
45 void AddHeight(
double height) { m_height += height; }
84 unsigned int GetLineCount() {
return (
unsigned int) m_linewidth.GetCount(); }
91 void AddLastLineValues(
double width,
int spaces);
97 double GetLastLineWidth();
106 bool IsCurrentLineMarked();
112 void AddCurrentLineWidth(
double width);
118 void AddCurrentLineSpaces(
int spaces);
124 double GetCurrentLineWidth();
130 int GetCurrentLineSpaces();
139 void IncrementCurrentLine();
145 double GetLineDelta();
175 void IncrementCurrentContext();
229 void SetHRef(
const wxString& href) { m_href = href; }
256 unsigned int m_currentContext;
257 wxArrayPtrVoid m_contexts;
258 unsigned int m_currentLine;
261 wxPdfArrayDouble m_linewidth;
263 wxUniChar m_lastChar;
265 double m_charSpacing;
283 wxPdfTableCell(wxXmlNode* cell,
unsigned int row,
unsigned int col,
unsigned int rows,
unsigned int cols);
292 unsigned int GetRow()
const {
return m_row; }
298 unsigned int GetCol()
const {
return m_col; }
411 unsigned int m_rowSpan;
412 unsigned int m_colSpan;
422 bool m_hasCellColour;
462 void SetColumnWidth(
int col,
double width);
468 void SetCellDimensions(
double maxWidth);
483 double WriteOnPage(
bool writeHeader,
double x,
double y);
494 double WriteRowsOnPage(
unsigned firstRow,
unsigned lastRow,
double x,
double y,
bool writeHeader);
502 unsigned int AddPage(wxArrayInt::const_iterator iter, wxArrayInt::const_iterator endIter);
512 double WriteTable(
bool writeHeader,
const wxArrayInt& lastRowsOnPage,
double x,
double y);
519 double GetRowHeight(
int row) {
const double height = m_rowHeights[row];
return height; };
533 double WriteRows(
unsigned int firstRow,
unsigned int lastRow,
double x,
double y,
bool isHeaderRow);
621 void WriteFillingOfCell(
unsigned int row,
unsigned int col,
double x,
double y)
const;
623 void WriteFillingOfRow(
unsigned int row,
double x,
double y)
const;
625 void WriteFillingOfRows(
unsigned int firstRow,
unsigned int lastRow,
double x,
double y)
const;
628 void WriteBordersOfCell(
unsigned row,
unsigned int col,
double x,
double y);
630 void WriteBordersOfRow(
unsigned int row,
double x,
double y);
632 void WriteBordersOfRows(
unsigned int firstRow,
unsigned int lastRow,
double x,
double y);
635 void WriteContentOfCell(
unsigned int row,
unsigned int col,
double x,
double y,
bool isHeaderRow);
637 void WriteContentOfRow(
unsigned int row,
double x,
double y,
bool isHeaderRow);
639 double WriteContentOfRows(
unsigned int firstRow,
unsigned int lastRow,
double x,
double y,
bool isHeaderRow);
644 wxArrayInt GetLastRowsOnPage()
const;
646 void DrawCellBorders(
double x,
double y,
double w,
double h,
wxPdfTableCell* cell)
const;
648 void DrawCellFilling(
double x,
double y,
double w,
double h,
wxPdfTableCell* cell)
const;
650 void DrawCellContent(
double x,
double y,
bool isHeaderRow,
double w,
double h,
wxPdfTableCell* cell);
652 void CalculateCellDimension(
unsigned row,
unsigned col,
double& w,
double& h,
656 wxPdfDoubleHashMap m_minHeights;
657 wxPdfDoubleHashMap m_rowHeights;
658 wxPdfDoubleHashMap m_colWidths;
659 wxPdfDoubleHashMap m_maxHeights;
665 unsigned int m_headRowFirst;
666 unsigned int m_headRowLast;
667 unsigned int m_bodyRowFirst;
668 unsigned int m_bodyRowLast;
670 unsigned int m_nRows;
671 unsigned int m_nCols;
672 wxPdfCellHashMap m_table;
675 double m_borderWidth;
Class representing cell context objects. (For internal use only)
Definition: pdfxml.h:28
void SetAligned()
Set flag that alignment has been taken care of.
Definition: pdfxml.h:154
void SetTable(wxPdfTable *table)
Set reference to an embedded markup table.
Definition: pdfxml.h:241
wxUniChar GetLastChar()
Get last character of previous chunk.
Definition: pdfxml.h:199
void SetCharacterSpacing(double charSpacing)
Remember the character spacing.
Definition: pdfxml.h:217
void SetVAlign(wxPdfAlignment vAlign)
Set vertical alignment.
Definition: pdfxml.h:69
double GetLastSpaceWidth()
Get width of last space character.
Definition: pdfxml.h:211
double GetCharacterSpacing()
Get character spacing.
Definition: pdfxml.h:223
unsigned int GetContextCount()
Get the number of contexts.
Definition: pdfxml.h:172
wxPdfAlignment GetVAlign()
Get vertical alignment.
Definition: pdfxml.h:75
int GetFillStyle()
Get cell fill style.
Definition: pdfxml.h:160
bool GetAligned()
Check whether alignment has been taken care of.
Definition: pdfxml.h:151
double GetMaxWidth()
Get maximum width of cell.
Definition: pdfxml.h:57
unsigned int GetLineCount()
Get number of lines in cell.
Definition: pdfxml.h:84
double GetHeight()
Get total height of cell.
Definition: pdfxml.h:51
void SetLastSpaceWidth(double w)
Remember the width of the last space character.
Definition: pdfxml.h:205
void SetHRef(const wxString &href)
Set hyper link reference.
Definition: pdfxml.h:229
void SetFillStyle(int fillStyle)
Set cell fill style.
Definition: pdfxml.h:166
void SetLastChar(wxUniChar c)
Remember the last character of the last chunk.
Definition: pdfxml.h:193
void AddHeight(double height)
Increase total height of cell.
Definition: pdfxml.h:45
wxPdfAlignment GetHAlign()
Get horizontal alignment.
Definition: pdfxml.h:63
unsigned int GetCurrentLine()
Get number of current line.
Definition: pdfxml.h:136
wxPdfTable * GetTable()
Get reference to an embedded markup table.
Definition: pdfxml.h:247
wxString & GetHRef()
Get hyper link reference.
Definition: pdfxml.h:235
Class representing wxPdfDocument colours.
Definition: pdfcolour.h:40
Class representing a PDF document.
Definition: pdfdocument.h:176
Class representing table cells. (For internal use only)
Definition: pdfxml.h:273
void SetHAlign(wxPdfAlignment hAlign)
Set horizontal alignment.
Definition: pdfxml.h:352
void SetCellColour(wxPdfColour colour)
Set background colour of cell.
Definition: pdfxml.h:394
int GetBorder()
Get border.
Definition: pdfxml.h:382
void SetContext(wxPdfCellContext *context)
Set cell context.
Definition: pdfxml.h:340
unsigned int GetRowSpan() const
Get row span of cell.
Definition: pdfxml.h:304
wxXmlNode * GetXmlNode()
Get root node of cell.
Definition: pdfxml.h:406
bool HasCellColour() const
Check whether cell has a coloured or transparent background.
Definition: pdfxml.h:388
wxPdfCellContext * GetContext()
Get cell context.
Definition: pdfxml.h:346
wxPdfColour GetCellColour() const
Get background colour of cell.
Definition: pdfxml.h:400
double GetHeight() const
Get height of cell.
Definition: pdfxml.h:328
unsigned int GetColSpan() const
Get column span of cell.
Definition: pdfxml.h:310
void SetBorder(int border)
Set border.
Definition: pdfxml.h:376
double GetWidth() const
Get width of cell.
Definition: pdfxml.h:334
unsigned int GetRow() const
Get row of cell.
Definition: pdfxml.h:292
unsigned int GetCol() const
Get column of cell.
Definition: pdfxml.h:298
void SetVAlign(wxPdfAlignment vAlign)
Set vertical alignment.
Definition: pdfxml.h:364
void SetWidth(double w)
Set width of cell.
Definition: pdfxml.h:316
wxPdfAlignment GetHAlign()
Get horizontal alignment.
Definition: pdfxml.h:358
wxPdfAlignment GetVAlign()
Get vertical alignment.
Definition: pdfxml.h:370
void SetHeight(double h)
Set height of cell.
Definition: pdfxml.h:322
Class representing tables within a cell. (For internal use only)
Definition: pdfxml.h:432
double GetTotalWidth()
Get total width of table.
Definition: pdfxml.h:575
bool HasBorder()
Check whether border should be drawn.
Definition: pdfxml.h:569
double GetHeadHeight()
Get height of table head.
Definition: pdfxml.h:581
void SetBorderWidth(double borderWidth)
Set border size.
Definition: pdfxml.h:557
void SetHeadRowFirst(unsigned int row)
Set index of first header row.
Definition: pdfxml.h:599
double GetBodyHeight()
Get height of table body.
Definition: pdfxml.h:587
double GetRowHeight(int row)
Get height of row.
Definition: pdfxml.h:519
double GetPad()
Get cell padding.
Definition: pdfxml.h:545
double GetTotalHeight()
Get total height of table.
Definition: pdfxml.h:593
void SetHeadRowLast(unsigned int row)
Set index of last header row.
Definition: pdfxml.h:605
void SetBodyRowLast(unsigned int row)
Set index of last body row.
Definition: pdfxml.h:617
void SetBodyRowFirst(unsigned int row)
Set index of first body row.
Definition: pdfxml.h:611
void SetBorder(bool border)
Set border flag.
Definition: pdfxml.h:551
void SetMaxRowHeight(int row, double height)
Set maximum allowed row height.
Definition: pdfxml.h:455
void SetBorderColour(wxPdfColour borderColour)
Set border colour.
Definition: pdfxml.h:563
void SetMinRowHeight(int row, double height)
Set minimum required row height.
Definition: pdfxml.h:448
void SetPad(double pad)
Set cell padding.
Definition: pdfxml.h:539
Compile time switches for the wxPdfDocument component.
Interface of the wxPdfDocument class.
wxPdfAlignment
Alignment options.
Definition: pdfproperties.h:164
@ wxPDF_ALIGN_JUSTIFY
Justified alignment.
Definition: pdfproperties.h:168
@ wxPDF_ALIGN_TOP
Top alignment (alias for left)
Definition: pdfproperties.h:169
WX_DECLARE_HASH_MAP_WITH_DECL(long, wxPdfTableCell *, wxIntegerHash, wxIntegerEqual, wxPdfCellHashMap, class WXDLLIMPEXP_PDFDOC)
Hashmap class for document links.