1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-19 12:07:13 +01:00
Sandu Liviu Catalin 4a6bfc086c Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
2021-01-30 08:51:39 +02:00

86 lines
1.3 KiB
C++

//
// Table.h
//
#ifndef PDF_Table_INCLUDED
#define PDF_Table_INCLUDED
#include "Poco/PDF/PDF.h"
#include "Poco/PDF/Page.h"
#include "Poco/PDF/Cell.h"
#include "Poco/SharedPtr.h"
#include <string>
namespace Poco {
namespace PDF {
class PDF_API Table
{
public:
typedef SharedPtr<Table> Ptr;
typedef std::vector<TableRow> Cells;
Table(int columnCount, int rowCount, const std::string& name, Cell::FontMapPtr pFontMap = 0);
~Table();
void setCell(int col, int row, const Cell& cell);
void setColumnWidth(int col, double width);
void setFonts(Cell::FontMapPtr pFontMap);
const std::string name() const;
const Cells& cells() const;
void addRow();
void addRow(const TableRow& row);
std::size_t rows() const;
std::size_t columns() const;
void draw(Page& page, float x, float y, float width, float height);
private:
Table();
std::string _name;
Cells _cells;
Cell::FontMapPtr _pFontMap;
};
//
// inlines
//
inline const std::string Table::name() const
{
return _name;
}
inline const Table::Cells& Table::cells() const
{
return _cells;
}
inline std::size_t Table::rows() const
{
return _cells.size();
}
inline std::size_t Table::columns() const
{
return _cells[0].size();
}
} } // namespace Poco::PDF
#endif // PDF_Table_INCLUDED