367 lines
10 KiB
C++
367 lines
10 KiB
C++
#ifndef CCSBAND_H
|
|
#define CCSBAND_H
|
|
#include "ccsreport_global.h"
|
|
#include "base/ccsbandinterface.h"
|
|
|
|
namespace CCS_Report {
|
|
class ReportFunPara;
|
|
|
|
//附录
|
|
class CCSBandAppendixPrivate;
|
|
class CCS_COMPASSREPORT_EXPORT CCSBandAppendix:public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
|
|
//QList<CCSParagraph*> items;
|
|
public:
|
|
CCSBandAppendix(QObject *parent=0);
|
|
~CCSBandAppendix();
|
|
|
|
CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|
CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString &text,int iPos=0){}
|
|
virtual void exeFunction(ReportFunPara& arg){}
|
|
|
|
protected:
|
|
Q_DECLARE_PRIVATE(CCSBandAppendix)
|
|
|
|
CCSBandAppendix(CCSBandAppendixPrivate *dd, QObject * parent);
|
|
|
|
virtual CCSBaseItemInterface * itemClone() const;
|
|
};
|
|
class CCSBandAppendixPrivate:public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSBandAppendixPrivate():
|
|
CCSBandInterfacePrivate(){}
|
|
virtual ~CCSBandAppendixPrivate(){}
|
|
};
|
|
|
|
//封面
|
|
class CCSBandCoverPrivate;
|
|
class CCS_COMPASSREPORT_EXPORT CCSBandCover:public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(int pageNum READ pageNum WRITE SetPageNum)
|
|
public:
|
|
CCSBandCover(QObject *parent=0);
|
|
~CCSBandCover();
|
|
|
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|
CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString &text,int iPos=0){}
|
|
virtual void exeFunction(ReportFunPara& arg){}
|
|
|
|
int pageNum() const;
|
|
void SetPageNum(const int& page );
|
|
|
|
protected:
|
|
|
|
Q_DECLARE_PRIVATE(CCSBandCover)
|
|
|
|
CCSBandCover(CCSBandCoverPrivate *dd, QObject * parent);
|
|
|
|
virtual CCSBaseItemInterface * itemClone() const;
|
|
|
|
};
|
|
class CCSBandCoverPrivate:public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSBandCoverPrivate():
|
|
CCSBandInterfacePrivate(),
|
|
m_iPageNum(1){}
|
|
virtual ~CCSBandCoverPrivate(){}
|
|
int m_iPageNum;
|
|
|
|
};
|
|
//页眉
|
|
class CCSBandHeaderPrivate;
|
|
class CCS_COMPASSREPORT_EXPORT CCSBandHeader:public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
// Q_PROPERTY(bool startNewPage READ startNewPage WRITE setStartNewPage)
|
|
|
|
public:
|
|
CCSBandHeader(QObject *parent=0);
|
|
~CCSBandHeader();
|
|
|
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|
CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString &text,int iPos=0){}
|
|
virtual void exeFunction(ReportFunPara& arg){}
|
|
|
|
protected:
|
|
Q_DECLARE_PRIVATE(CCSBandHeader)
|
|
CCSBandHeader(CCSBandHeaderPrivate *dd, QObject * parent);
|
|
|
|
virtual CCSBaseItemInterface * itemClone() const;
|
|
};
|
|
class CCSBandHeaderPrivate : public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSBandHeaderPrivate():CCSBandInterfacePrivate(),m_bStartNewPage(false)
|
|
{}
|
|
|
|
virtual ~CCSBandHeaderPrivate(){}
|
|
|
|
bool m_bStartNewPage;
|
|
};
|
|
|
|
//页脚
|
|
class CCSBandFooterPrivate;
|
|
class CCS_COMPASSREPORT_EXPORT CCSBandFooter:public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
CCSBandFooter(QObject *parent=0);
|
|
~CCSBandFooter();
|
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|
CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString &text,int iPos=0) {}
|
|
virtual void exeFunction(ReportFunPara& arg){}
|
|
|
|
private:
|
|
Q_DECLARE_PRIVATE(CCSBandFooter)
|
|
|
|
CCSBandFooter(CCSBandFooterPrivate *dd, QObject * parent);
|
|
virtual CCSBaseItemInterface * itemClone() const;
|
|
};
|
|
class CCSBandFooterPrivate : public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSBandFooterPrivate():
|
|
CCSBandInterfacePrivate(),
|
|
m_bStartNewPage(false)
|
|
{}
|
|
|
|
virtual ~CCSBandFooterPrivate(){}
|
|
|
|
bool m_bStartNewPage;
|
|
|
|
};
|
|
|
|
//正文
|
|
class CCSBandContentPrivate;
|
|
class CCS_COMPASSREPORT_EXPORT CCSBandContent:public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(int height READ height WRITE SetHeight)
|
|
Q_PROPERTY(int width READ width WRITE SetWidth)
|
|
Q_PROPERTY(int left READ left WRITE SetLeft)
|
|
Q_PROPERTY(int right READ right WRITE SetRight)
|
|
//QList<CCSParagraph*> items;
|
|
public:
|
|
CCSBandContent(QObject *parent=0);
|
|
~CCSBandContent();
|
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|
CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString &text,int iPos=0) {}
|
|
virtual void exeFunction(ReportFunPara& arg){}
|
|
|
|
int height() const;
|
|
int width() const;
|
|
int left() const;
|
|
int right() const;
|
|
void SetHeight(int &h);
|
|
void SetWidth(int &w);
|
|
void SetLeft(int &l);
|
|
void SetRight(int &r);
|
|
|
|
CCS_Report::CCSBandHeader* itemheader();
|
|
CCS_Report::CCSBandFooter* itemfooter();
|
|
protected:
|
|
Q_DECLARE_PRIVATE(CCSBandContent)
|
|
CCSBandContent(CCSBandContentPrivate *dd, QObject * parent);
|
|
|
|
virtual CCSBaseItemInterface * itemClone() const;
|
|
};
|
|
|
|
class CCSBandContentPrivate:public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSBandContentPrivate():
|
|
CCSBandInterfacePrivate(),
|
|
m_iHeight(0),
|
|
m_iWidth(0),
|
|
m_iLeft(0),
|
|
m_iRight(0)
|
|
{}
|
|
CCSBandContentPrivate(const CCSBandContentPrivate &p):
|
|
CCSBandInterfacePrivate(),
|
|
m_iHeight(p.m_iHeight),
|
|
m_iWidth(p.m_iWidth),
|
|
m_iLeft(p.m_iLeft),
|
|
m_iRight(p.m_iRight)
|
|
{}
|
|
virtual ~CCSBandContentPrivate(){}
|
|
|
|
int m_iHeight;
|
|
int m_iWidth;
|
|
int m_iLeft; //
|
|
int m_iRight; //
|
|
};
|
|
//目录 目录有可能有单独的页眉页脚; 目录页不算在总页里
|
|
class CCSBandDirectoryPrivate;
|
|
class CCS_COMPASSREPORT_EXPORT CCSBandDirectory:public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
// Q_FLAGS(DirectoryTypes)
|
|
// Q_ENUMS(DirectoryType)
|
|
Q_PROPERTY(int pagenum READ pagenum WRITE SetPageNum)
|
|
Q_PROPERTY(int dirtype READ dirtype WRITE SetDirType)
|
|
Q_PROPERTY(bool manual READ manual WRITE SetManual)
|
|
Q_PROPERTY(int dirgrade READ dirgrade WRITE SetDirGrade)
|
|
Q_PROPERTY(QString name READ name WRITE SetName)
|
|
Q_PROPERTY(QFont namefont READ namefont WRITE SetNameFont)
|
|
Q_PROPERTY(int namealgin READ namealgin WRITE SetNameAlign)
|
|
public:
|
|
CCSBandDirectory(QObject *parent=0);
|
|
|
|
~CCSBandDirectory();
|
|
|
|
// enum class DirectoryType {Body = 0,
|
|
// Picture = 1,
|
|
// Appendix = 2
|
|
// };
|
|
// Q_DECLARE_FLAGS(DirectoryTypes, DirectoryType)
|
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|
CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString &text,int iPos=0){}
|
|
virtual void exeFunction(ReportFunPara& arg){}
|
|
|
|
int pagenum() const;
|
|
void SetPageNum(const int& num);
|
|
int dirtype() const;
|
|
void SetDirType(int dType);
|
|
bool manual() const;
|
|
void SetManual(bool & m);
|
|
int dirgrade() const;
|
|
void SetDirGrade(int &grade);
|
|
|
|
|
|
QString name() const;
|
|
void SetName(QString& name);
|
|
QFont namefont() const;
|
|
void SetNameFont(QFont& font);
|
|
int namealgin() const;
|
|
void SetNameAlign(int &algin);
|
|
|
|
CCS_Report::CCSBandHeader* itemheader();
|
|
CCS_Report::CCSBandFooter* itemfooter();
|
|
|
|
// inline void Paint(QPainter* paint,Tree* dirTree);
|
|
protected:
|
|
Q_DECLARE_PRIVATE(CCSBandDirectory)
|
|
CCSBandDirectory(CCSBandDirectoryPrivate *dd, QObject * parent);
|
|
virtual CCSBaseItemInterface * itemClone() const;
|
|
};
|
|
|
|
class CCSBandDirectoryPrivate:public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSBandDirectoryPrivate():
|
|
CCSBandInterfacePrivate(),
|
|
m_iPageNum(0),
|
|
m_bManual(false),
|
|
m_iDirGrade(4),
|
|
m_eDirType(0),
|
|
m_strName(QString::fromLocal8Bit("目录")),
|
|
m_NameAlign(0),
|
|
m_NameFont(QFont())
|
|
{}
|
|
CCSBandDirectoryPrivate(const CCSBandDirectoryPrivate &p):
|
|
CCSBandInterfacePrivate(),
|
|
m_iPageNum(p.m_iPageNum),
|
|
m_bManual(p.m_bManual),
|
|
m_iDirGrade(p.m_iDirGrade),
|
|
m_eDirType(p.m_eDirType),
|
|
m_strName(p.m_strName),
|
|
m_NameAlign(p.m_NameAlign),
|
|
m_NameFont(p.m_NameFont)
|
|
{}
|
|
virtual ~CCSBandDirectoryPrivate(){}
|
|
|
|
int m_iPageNum;
|
|
int m_eDirType;
|
|
bool m_bManual; //目录生成标识 自动、手动
|
|
int m_iDirGrade; //目录收录级别 此属性针对正文目录;收录到目录的级别 max = 4
|
|
QString m_strName; //目录名称;缺省是 “目录”
|
|
QFont m_NameFont; //目录字体属性
|
|
int m_NameAlign; //目录的位置
|
|
};
|
|
//水印
|
|
class CCSBandWaterPrivate;
|
|
class CCS_COMPASSREPORT_EXPORT CCSBandWater :public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(int pageNum READ pageNum WRITE SetPageNum)
|
|
public:
|
|
CCSBandWater(QObject* parent = 0);
|
|
~CCSBandWater();
|
|
|
|
virtual CCSBaseItemInterface* createInstance(QObject* parent) const;
|
|
CCSBaseItemInterface* clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString& text, int iPos = 0) {}
|
|
virtual void exeFunction(ReportFunPara& arg) {}
|
|
|
|
int pageNum() const;
|
|
void SetPageNum(const int& page);
|
|
|
|
protected:
|
|
|
|
Q_DECLARE_PRIVATE(CCSBandWater)
|
|
|
|
CCSBandWater(CCSBandWaterPrivate* dd, QObject* parent);
|
|
|
|
virtual CCSBaseItemInterface* itemClone() const;
|
|
|
|
};
|
|
class CCSBandWaterPrivate :public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSBandWaterPrivate() :
|
|
CCSBandInterfacePrivate(),
|
|
m_iPageNum(1) {}
|
|
virtual ~CCSBandWaterPrivate() {}
|
|
int m_iPageNum;
|
|
|
|
};
|
|
//模板
|
|
class CCSTemplatePrivate;
|
|
class CCSTemplate:public CCSBandInterface
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
CCSTemplate(QObject *parent=0);
|
|
~CCSTemplate();
|
|
|
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|
CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|
virtual void SetValue(const QString &text,int iPos=0){}
|
|
virtual void exeFunction(ReportFunPara& arg){}
|
|
|
|
int pageNum() const;
|
|
void SetPageNum(const int& page );
|
|
|
|
protected:
|
|
|
|
Q_DECLARE_PRIVATE(CCSTemplate)
|
|
|
|
CCSTemplate(CCSTemplatePrivate *dd, QObject * parent);
|
|
|
|
virtual CCSBaseItemInterface * itemClone() const;
|
|
|
|
};
|
|
class CCSTemplatePrivate:public CCSBandInterfacePrivate
|
|
{
|
|
public:
|
|
CCSTemplatePrivate():
|
|
CCSBandInterfacePrivate(){}
|
|
virtual ~CCSTemplatePrivate(){}
|
|
};
|
|
}
|
|
#endif // CCSBAND_H
|