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

77 lines
2.1 KiB
C
Raw Normal View History

2025-06-25 15:06:42 +08:00
#ifndef CCSITEMINTERFACE_H
#define CCSITEMINTERFACE_H
#include "qglobal.h"
#include "QFont"
#include "QColor"
#include "ccsbaseiteminterface.h"
#include "ccsreport_global.h"
namespace CCS_Report {
class CCSBaseItemInterface;
class CCSBaseItemInterfacePrivate;
class CCSItemInterfacePrivate;
class ReportFunPara;
class CCS_COMPASSREPORT_EXPORT CCSItemInterface:public CCSBaseItemInterface
{
Q_OBJECT
Q_PROPERTY(QColor backcolor READ backcolor WRITE SetBackColor)
Q_PROPERTY(QColor textcolor READ textcolor WRITE SetTextColor)
Q_PROPERTY(QFont font READ font WRITE SetFont)
Q_PROPERTY(Qt::Alignment align READ align WRITE SetAlignment)
//QList<CCSParagraph*> items;
public:
CCSItemInterface(QObject *parent=0);
~CCSItemInterface();
virtual CCSBaseItemInterface * createInstance(QObject * parent) const = 0;
virtual CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const=0;
virtual void SetValue(const QString &text,int iPos=0) = 0;
virtual void exeFunction(ReportFunPara& arg) = 0;
QColor backcolor() ;
void SetBackColor(const QColor &c);
QColor textcolor() ;
void SetTextColor(const QColor &c);
QFont font () ;
void SetFont(const QFont &f);
Qt::Alignment align();
void SetAlignment(const Qt::Alignment a);
protected:
CCSItemInterface(CCSItemInterfacePrivate *dd, QObject * parent);
Q_DECLARE_PRIVATE(CCSItemInterface)
virtual CCSBaseItemInterface * itemClone() const = 0;
};
class CCSItemInterfacePrivate : public CCSBaseItemInterfacePrivate
{
public:
CCSItemInterfacePrivate()
:CCSBaseItemInterfacePrivate(),
m_Alingment(Qt::AlignCenter)
{
m_TextColor = QColor();
}
CCSItemInterfacePrivate(const CCSItemInterfacePrivate & p)
:CCSBaseItemInterfacePrivate(p),
m_BackColor(p.m_BackColor),
m_TextColor(p.m_TextColor),
m_Font(p.m_Font),
m_Alingment(p.m_Alingment)
{}
virtual ~CCSItemInterfacePrivate() {
}
QColor m_BackColor; //背景色
QColor m_TextColor; //字体颜色
QFont m_Font;
Qt::Alignment m_Alingment;
};
}
#endif // CCSITEMINTERFACE_H