141 lines
4.7 KiB
C
141 lines
4.7 KiB
C
|
#ifndef CCSCELL_H
|
|||
|
#define CCSCELL_H
|
|||
|
#include "ccsiteminterface.h"
|
|||
|
#include "QColor"
|
|||
|
#include "QFont"
|
|||
|
#include "qglobal.h"
|
|||
|
#include "common_types.h"
|
|||
|
#include "ccsreport_global.h"
|
|||
|
|
|||
|
namespace CCS_Report {
|
|||
|
class CCSItemInterface;
|
|||
|
class CCSBaseItemInterface;
|
|||
|
class CCSCellPrivate;
|
|||
|
class ReportFunPara;
|
|||
|
class CCS_COMPASSREPORT_EXPORT CCSCell:public CCSItemInterface
|
|||
|
{
|
|||
|
Q_OBJECT
|
|||
|
public:
|
|||
|
|
|||
|
|
|||
|
Q_PROPERTY(int rowspan READ rowspan WRITE SetRowspan)
|
|||
|
Q_PROPERTY(int colspan READ colspan WRITE SetColspan)
|
|||
|
Q_PROPERTY(int rowindex READ rowindex WRITE SetRowindex)
|
|||
|
Q_PROPERTY(int colindex READ colindex WRITE SetColindex)
|
|||
|
Q_PROPERTY(bool dynamic READ dynamic WRITE SetDynamic)
|
|||
|
Q_PROPERTY(bool tranrow READ tranrow WRITE SetTranrow)
|
|||
|
Q_PROPERTY(bool group READ group WRITE SetGroup)
|
|||
|
Q_PROPERTY(int cellframe READ cellframe WRITE SetCellFrame)
|
|||
|
Q_PROPERTY(qreal padding READ padding WRITE SetPadding)
|
|||
|
|
|||
|
public:
|
|||
|
CCSCell(int rownum,int colnum, QObject * parent = 0);
|
|||
|
CCSCell(QObject * parent = 0);
|
|||
|
~CCSCell();
|
|||
|
virtual CCSBaseItemInterface * createInstance(QObject * parent) const;
|
|||
|
virtual CCSBaseItemInterface * clone(bool withChildren = true, bool init = true) const;
|
|||
|
virtual void exeFunction(ReportFunPara& arg);
|
|||
|
void SetPostion(int row,int col);
|
|||
|
int rowindex() const;
|
|||
|
void SetRowindex(const int &index);
|
|||
|
int colindex() const;
|
|||
|
void SetColindex(const int &index);
|
|||
|
int rowspan() const;
|
|||
|
void SetRowspan(const int &span);
|
|||
|
int colspan() const;
|
|||
|
void SetColspan(const int &span);
|
|||
|
|
|||
|
bool dynamic() const;
|
|||
|
void SetDynamic(const bool& dyn);
|
|||
|
|
|||
|
bool tranrow() const;
|
|||
|
void SetTranrow(const bool& bFlag);
|
|||
|
|
|||
|
bool group() const;
|
|||
|
void SetGroup(const bool& bFlag);
|
|||
|
|
|||
|
int cellframe() const;
|
|||
|
void SetCellFrame(const int& bFlag);
|
|||
|
|
|||
|
qreal padding() const;
|
|||
|
void SetPadding(const qreal& value);
|
|||
|
|
|||
|
// bool GetRowMerge() const {return m_bMerge;}
|
|||
|
// void SetRowMerge(const bool &m) {m_bMerge = m;}
|
|||
|
CCS_Report::CCSBaseItemInterface* paragraph();
|
|||
|
QList<CCS_Report::CCSBaseItemInterface*> paragraphs();
|
|||
|
void SetValue(const QString &text,int iPos=0);
|
|||
|
QString GetFieldNameByTable(QString tablename= "");
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
/// <param name="table"></param>
|
|||
|
/// <param name="mapColumnMerge"></param>
|
|||
|
/// <returns>返回单元格 合并相关信息</returns>
|
|||
|
void FillDynamicCell(QList<QObject*> table, QMap<int, QMap<int, QPair<int, QString>>>& mapBindDataMergeInfo, QMap<int, bool> mapColumnMerge = QMap<int, bool>());
|
|||
|
void FillDynamicCell(QList<QString> listValue, QMap<int, QMap<int, QPair<int, QString>>>& mapBindDataMergeInfo, QMap<int, bool> mapColumnMerge = QMap<int, bool>());
|
|||
|
void FillCell(QString strField,QList<QString> listBindData, QMap<int, QMap<int, QPair<int, QString>>>& mapBindDataMergeInfo, QMap<int, bool> mapColumnMerge = QMap<int, bool>());
|
|||
|
void AddCellColumnIndex(int iAdd);
|
|||
|
protected:
|
|||
|
Q_DECLARE_PRIVATE(CCSCell)
|
|||
|
CCSCell(CCSCellPrivate *dd, QObject * parent);
|
|||
|
virtual CCSBaseItemInterface * itemClone() const;
|
|||
|
private:
|
|||
|
|
|||
|
};
|
|||
|
class CCSCellPrivate:public CCSItemInterfacePrivate
|
|||
|
{
|
|||
|
public:
|
|||
|
|
|||
|
|
|||
|
CCSCellPrivate()
|
|||
|
:CCSItemInterfacePrivate(),
|
|||
|
m_iRowspan(1),
|
|||
|
m_iColspan(1),
|
|||
|
m_iRowindex(0),
|
|||
|
m_iColindex(0),
|
|||
|
m_bDynamic(false),
|
|||
|
m_bTranRow(false),
|
|||
|
m_bGroup(false),
|
|||
|
m_cellframe(CCSFrame::FrameAll),
|
|||
|
m_qPadding(0)
|
|||
|
{}
|
|||
|
CCSCellPrivate(int row,int col)
|
|||
|
:CCSItemInterfacePrivate(),
|
|||
|
m_iRowspan(1),
|
|||
|
m_iColspan(1),
|
|||
|
m_iRowindex(row),
|
|||
|
m_iColindex(col),
|
|||
|
m_bDynamic(false),
|
|||
|
m_bTranRow(false),
|
|||
|
m_bGroup(false),
|
|||
|
m_cellframe(CCSFrame::FrameAll),
|
|||
|
m_qPadding(0)
|
|||
|
{}
|
|||
|
CCSCellPrivate(const CCSCellPrivate& p)
|
|||
|
:CCSItemInterfacePrivate(p),
|
|||
|
m_iRowspan(p.m_iRowspan),
|
|||
|
m_iColspan(p.m_iColspan),
|
|||
|
m_iRowindex(p.m_iRowindex),
|
|||
|
m_iColindex(p.m_iColindex),
|
|||
|
m_bDynamic(p.m_bDynamic),
|
|||
|
m_bTranRow(p.m_bTranRow),
|
|||
|
m_bGroup(p.m_bGroup),
|
|||
|
m_cellframe(p.m_cellframe),
|
|||
|
m_qPadding(p.m_qPadding)
|
|||
|
{}
|
|||
|
virtual ~CCSCellPrivate(){}
|
|||
|
|
|||
|
int m_iRowspan; // 跨行
|
|||
|
int m_iColspan; // 跨列
|
|||
|
int m_iRowindex; //行索引
|
|||
|
int m_iColindex; //列索引
|
|||
|
bool m_bDynamic; //动态单元格
|
|||
|
bool m_bTranRow; //当表为转置表时使用;说明转置时,此单元格是否占一行,还是按正常方式进行转置;缺省false
|
|||
|
bool m_bGroup; //是否为group中的变量,考虑在分组情况下,此Cell的字段不是针对分组,常出现在表头;缺省false
|
|||
|
int m_cellframe;
|
|||
|
qreal m_qPadding; //单元格边距
|
|||
|
};
|
|||
|
}
|
|||
|
#endif // CCSCELL_H
|