#ifndef LREXCELEXPORTER_H #define LREXCELEXPORTER_H #include #include #include "lrexporterintf.h" namespace LimeReport{ struct GridItem{ BaseDesignIntf* item; long endRow; long endColumn; public: GridItem(BaseDesignIntf* item, long endRow, long endColumn); }; class HTMLDocument{ public: HTMLDocument(); bool saveAs(const QString& fileName); QDomElement* header(){return &m_header;} QDomElement* body(){return &m_body;} QDomNode* table(){return &m_table;} QDomElement createElement(const QString& name); void initGrid(QSetcolumns, QSetrows); void write(int startRow, int startColumn, int endRow, int endColumn, BaseDesignIntf *item); private: void preapareHTML(); private: QDomDocument m_htmlDocument; QDomElement m_header; QDomElement m_body; QDomNode m_table; QList m_items; QVector> m_grid; }; struct Grid{ QSet x; QSet y; }; class HTMLExporter : public QObject, public ReportExporterInterface{ Q_OBJECT public: HTMLExporter(QObject *parent = 0); // IReportExporter interface QString exporterName(); QString exporterFileExt(); QString hint(); bool exportPages(ReportPages pages, const QString& fileName, const QMap& params = QMap()); private: void buildGrid(Grid* grid, BaseDesignIntf* item); void exportItem(BaseDesignIntf* item); void createItemCell(BaseDesignIntf* item); int cellStartColumnIndex(BaseDesignIntf* item); int cellEndColumnIndex(BaseDesignIntf* item); int cellStartRowIndex(BaseDesignIntf* item); int cellEndRowIndex(BaseDesignIntf* item); // QXlsx::Format createTextItemFormat(BaseDesignIntf *item); private: QVectorx; QVectory; QVector exportedTypes; int m_xOffset; int m_yOffset; HTMLDocument* m_document; }; } //namespace LimeReport #endif // LREXCELEXPORTER_H