COMPASSi/trunk/code/3rd/CCSReport_2/include/items/ccsitem.h

76 lines
2.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef CCSITEM_H
#define CCSITEM_H
#include "ccsiteminterface.h"
#include "ccsreport_global.h"
namespace CCS_Report {
class CCSItemInterface;
class CCSItemPrivate;
class ReportFunPara;
class CCS_COMPASSREPORT_EXPORT CCSItem:public CCSItemInterface
{
Q_OBJECT
Q_PROPERTY(QString text READ text WRITE SetText)
Q_PROPERTY(bool group READ group WRITE SetGroup)
Q_PROPERTY(qreal opacity READ opacity WRITE SetOpacity)
Q_PROPERTY(qreal angle READ angle WRITE SetAngle)
public:
CCSItem(QObject * parent = 0);
~CCSItem();
QString text() const;
void SetText(const QString &text);
bool group() const;
void SetGroup(bool flag);
qreal opacity() const;
void SetOpacity(qreal value);
qreal angle() const;
void SetAngle(qreal value);
virtual void SetValue(const QString &text,int iPos=0)=0;
virtual void exeFunction(ReportFunPara& arg)=0;
virtual CCSBaseItemInterface * createInstance(QObject * parent) const=0;
virtual CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const=0;
QString GetFieldName();
protected:
Q_DECLARE_PRIVATE(CCSItem)
CCSItem(CCSItemPrivate *dd, QObject * parent);
virtual CCSBaseItemInterface * itemClone() const{return nullptr;}
private:
};
class CCSItemPrivate:public CCSItemInterfacePrivate
{
public:
CCSItemPrivate()
:CCSItemInterfacePrivate(),
m_iType(0),
m_strText(""),
m_bGroup(false),
m_qOpacity(0),
m_qAngle(0)
{}
CCSItemPrivate(const CCSItemPrivate& p)
:CCSItemInterfacePrivate(p),
m_iType(p.m_iType),
m_strText(p.m_strText),
m_bGroup(p.m_bGroup),
m_qOpacity(p.m_qOpacity),
m_qAngle(p.m_qAngle)
{}
virtual ~CCSItemPrivate(){}
int m_iType; // 类型
QString m_strText; // 文本内容
bool m_bGroup; //对于某个字段在绑定数据时是否在Grouptable的key中缺省false
qreal m_qOpacity;
qreal m_qAngle; //逆时针角度
};
}
#endif // CCSITEM_H