113 lines
3.2 KiB
C++
113 lines
3.2 KiB
C++
#ifndef CCSREPORTADAPTER_H
|
|
#define CCSREPORTADAPTER_H
|
|
#include "qlist.h"
|
|
#include "qobject.h"
|
|
#include "ccsreport_global.h"
|
|
|
|
namespace CCS_Report {
|
|
class CCSBandCover;
|
|
class CCSBandDirectory;
|
|
class CCSBandContent;
|
|
class CCSBandHeader;
|
|
class CCSBandFooter;
|
|
class CCSBandAppendix;
|
|
class CCSBandWater;
|
|
class CoverWrapper;
|
|
class DirectoryWrapper;
|
|
class ContentWrapper;
|
|
class HeaderWrapper;
|
|
class FooterWrapper;
|
|
class AppendixWrapper;
|
|
class WaterWrapper;
|
|
class CCSBandInterface;
|
|
class TableGroup;
|
|
class CCSTableGroup;
|
|
class CCSTableDynamic;
|
|
class TableDynamic;
|
|
class CCSTableFix;
|
|
class Table;
|
|
class BaseItem;
|
|
class CCSCell;
|
|
class Cell;
|
|
class CCSParagraph;
|
|
class Paragraph;
|
|
class CCSText;
|
|
class CCSImage;
|
|
class Text;
|
|
class Image;
|
|
class BaseBand;
|
|
class Report;
|
|
|
|
class CCS_COMPASSREPORT_EXPORT BaseAdapter :public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
BaseAdapter(QObject* parent = 0) :QObject(parent) {}
|
|
virtual ~BaseAdapter()
|
|
{
|
|
//delete m_Report;
|
|
}
|
|
protected:
|
|
//CCSReport *m_Report;
|
|
|
|
};
|
|
|
|
/// <summary>
|
|
/// 模板定义映射;把定义的模板对象转换成生成报告所需的模板对象
|
|
/// </summary>
|
|
class CCS_COMPASSREPORT_EXPORT ReportAdapter:public BaseAdapter
|
|
{
|
|
public:
|
|
ReportAdapter(QObject* parent = 0);
|
|
~ReportAdapter();
|
|
|
|
|
|
|
|
|
|
int MapToCCSBand(BaseBand *band,const QString& filename);
|
|
/// <summary>
|
|
/// 映射Report对象,并保存
|
|
/// @report Report对象
|
|
/// @filename 要保存的文件名
|
|
/// </summary>
|
|
/// <param name="band"></param>
|
|
/// <param name="filename"></param>
|
|
/// <returns></returns>
|
|
int MapToCCSReport(Report* report,const QString& filename);
|
|
|
|
private:
|
|
/// <summary>
|
|
/// 保存模板
|
|
/// </summary>
|
|
/// @report 模板对象
|
|
/// @filename 文件名
|
|
/// <param name="report"></param>
|
|
/// <param name="filename"></param>
|
|
/// <returns></returns>
|
|
bool SaveReportTemplate(const QObject* report,const QString& filename); CCS_Report::CCSBandCover* MapCover(QObject *obj,CoverWrapper* cover);
|
|
CCS_Report::CCSBandWater* MapWater(QObject *obj,WaterWrapper* water);
|
|
CCS_Report::CCSBandDirectory* MapDirectory(QObject *obj,DirectoryWrapper* directory);
|
|
CCS_Report::CCSBandContent* MapContent(QObject *obj,ContentWrapper* content);
|
|
CCS_Report::CCSBandHeader* MapHeader(QObject *obj,HeaderWrapper* header);
|
|
CCS_Report::CCSBandFooter* MapFooter(QObject *obj,FooterWrapper* footer);
|
|
CCS_Report::CCSBandAppendix* MapAppendix(QObject *obj,AppendixWrapper* appendix);
|
|
CCS_Report::CCSBandHeader* HandleHeader(HeaderWrapper* header,QObject * band);
|
|
CCS_Report::CCSBandFooter* HandleFooter(FooterWrapper* footer,QObject * band);
|
|
void HandleBaseItem(QList<BaseItem*> items,CCSBandInterface *band);
|
|
CCS_Report::CCSTableGroup * MapToTableGroup(TableGroup* item);
|
|
CCS_Report::CCSTableDynamic* MapToDynamicTable(TableDynamic *item);
|
|
void MapToSubDynamicTable(TableDynamic* table, CCS_Report::CCSTableDynamic* ccstabledynamic);
|
|
/*
|
|
*从用户定义的表映射到CCSTable中
|
|
*/
|
|
CCS_Report::CCSTableFix* MapToTable(Table* item);
|
|
CCSCell* MapToCell(Cell * item);
|
|
CCSParagraph* MapToParagraph(Paragraph* item);
|
|
CCSText* MapToText(Text* item);
|
|
CCSImage* MapToImage(Image* item);
|
|
};
|
|
}
|
|
|
|
|
|
#endif // CCSREPORTADAPTER_H
|