106 lines
3.4 KiB
C
106 lines
3.4 KiB
C
|
#ifndef CCSPARAGRAPH_H
|
|||
|
#define CCSPARAGRAPH_H
|
|||
|
|
|||
|
#include "ccsiteminterface.h"
|
|||
|
#include "ccsreport_global.h"
|
|||
|
#include "qglobal.h"
|
|||
|
#include "common_treenode.h"
|
|||
|
|
|||
|
namespace CCS_Report {
|
|||
|
class CCSItemInterface;
|
|||
|
class CCSItem;
|
|||
|
class CCSParagraphPrivate;
|
|||
|
class ReportFunPara;
|
|||
|
|
|||
|
class CCS_COMPASSREPORT_EXPORT CCSParagraph:public CCSItemInterface
|
|||
|
{
|
|||
|
Q_OBJECT
|
|||
|
Q_PROPERTY(QString identification READ identification WRITE SetIdentification) //标识符类型
|
|||
|
Q_PROPERTY(int firstident READ firstident WRITE SetFirstIdent) //标识符类型
|
|||
|
Q_PROPERTY(int grade READ grade WRITE SetGrade) //标识符
|
|||
|
Q_PROPERTY(bool showgrade READ showgrade WRITE SetShowGrade) //标识符
|
|||
|
Q_PROPERTY(int fontpixelsize READ fontpixelsize WRITE SetFontPixelSize)
|
|||
|
Q_PROPERTY(qreal linespace READ linespace WRITE SetLineSpace)
|
|||
|
Q_PROPERTY(qreal distancebefore READ distancebefore WRITE SetDistanceBefore)
|
|||
|
Q_PROPERTY(qreal distanceafter READ distanceafter WRITE SetDistanceAfter)
|
|||
|
|
|||
|
public:
|
|||
|
CCSParagraph(QObject * parent = 0);
|
|||
|
~CCSParagraph();
|
|||
|
|
|||
|
QString identification() const;
|
|||
|
void SetIdentification(const QString &text);
|
|||
|
|
|||
|
int grade() const;
|
|||
|
void SetGrade(const int &grade);
|
|||
|
|
|||
|
int firstident() const;
|
|||
|
void SetFirstIdent(const int &ident);
|
|||
|
|
|||
|
bool showgrade() const;
|
|||
|
void SetShowGrade(const bool &flag);
|
|||
|
|
|||
|
int fontpixelsize() const;
|
|||
|
void SetFontPixelSize(const int &size);
|
|||
|
|
|||
|
qreal linespace() const;
|
|||
|
void SetLineSpace(const qreal& value);
|
|||
|
|
|||
|
qreal distancebefore() const;
|
|||
|
void SetDistanceBefore(const qreal& value);
|
|||
|
|
|||
|
qreal distanceafter() const;
|
|||
|
void SetDistanceAfter(const qreal& value);
|
|||
|
|
|||
|
|
|||
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|||
|
virtual CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|||
|
void SetValue(const QString& text,int iPos=0);
|
|||
|
virtual void exeFunction(ReportFunPara& arg);
|
|||
|
TreeNode* CalGrade();
|
|||
|
protected:
|
|||
|
Q_DECLARE_PRIVATE(CCSParagraph)
|
|||
|
CCSParagraph(CCSParagraphPrivate *dd, QObject * parent);
|
|||
|
virtual CCSBaseItemInterface * itemClone() const;
|
|||
|
private:
|
|||
|
|
|||
|
};
|
|||
|
class CCSParagraphPrivate:public CCSItemInterfacePrivate
|
|||
|
{
|
|||
|
public:
|
|||
|
CCSParagraphPrivate()
|
|||
|
:CCSItemInterfacePrivate(),
|
|||
|
m_iGrade(0),
|
|||
|
m_strIdentification(""),
|
|||
|
m_iIndent(0),
|
|||
|
m_bShowGrade(false),
|
|||
|
m_iFontPixelSize(30),
|
|||
|
m_qLineSpace(0),
|
|||
|
m_qDistanceBefore(0),
|
|||
|
m_qDistanceAfter(0)
|
|||
|
{}
|
|||
|
CCSParagraphPrivate(const CCSParagraphPrivate& p)
|
|||
|
:CCSItemInterfacePrivate(p),
|
|||
|
m_iGrade(p.m_iGrade),
|
|||
|
m_strIdentification(p.m_strIdentification),
|
|||
|
m_iIndent(p.m_iIndent),
|
|||
|
m_bShowGrade(p.m_bShowGrade),
|
|||
|
m_iFontPixelSize(p.m_iFontPixelSize),
|
|||
|
m_qLineSpace(p.m_qLineSpace),
|
|||
|
m_qDistanceBefore(p.m_qDistanceBefore),
|
|||
|
m_qDistanceAfter(p.m_qDistanceAfter)
|
|||
|
{}
|
|||
|
virtual ~CCSParagraphPrivate(){}
|
|||
|
|
|||
|
int m_iGrade; // //多级标题标识 1~4
|
|||
|
int m_iIndent; //首行缩进
|
|||
|
bool m_bShowGrade; //是否显示多级标题
|
|||
|
QString m_strIdentification; //在填充时根据整个报告模板定义的级别动态生成
|
|||
|
int m_iFontPixelSize; //段落标题的像素大小
|
|||
|
qreal m_qLineSpace; //行间距 ; 以像素计
|
|||
|
qreal m_qDistanceBefore; //段前间距; 以像素计
|
|||
|
qreal m_qDistanceAfter; //段后间距; 以像素计
|
|||
|
};
|
|||
|
}
|
|||
|
#endif // CCSPARAGRAPH_H
|