logplus/Workflow/WFEngine/ObjectModel/ObjectModelBase/include/PaiHtmlProperties.h

165 lines
4.7 KiB
C
Raw Normal View History

2026-01-16 17:18:41 +08:00
/**
* @file PaiHtmlProperties.h
* @brief Html类的定义
* @date 2012-03-22
*/
#ifndef PAI_FRAME_IOBJECTMODEL_PAIHTMLPROPERTIES_H
#define PAI_FRAME_IOBJECTMODEL_PAIHTMLPROPERTIES_H
#include <QString>
#include <QMap>
#include <QColor>
#include "Property.h"
#include "Turtle.h"
namespace pai
{
namespace objectmodel
{
/**
* @class PaiHtmlProperties
* @brief Html
*/
class PAI_OBJECTMODEL_EXPORT PaiHtmlProperties
{
public:
/**
* @brief
* @param[in] tableWithPercent
*/
PaiHtmlProperties(const int tableWithPercent = 0);
/**
* @brief html来构造该类
* @param[in] html GetHtml()html
*/
PaiHtmlProperties(const QString & html);
/**
* @brief
* @param[in] icon
* @param[in] mainTitle
* @param[in] subTitle
* @param[in] tableWithPercent
*/
PaiHtmlProperties(const QString & icon,
const QString & mainTitle,
const QString & subTitle,
const int tableWithPercent = 0);
/**
* @brief
*/
virtual ~PaiHtmlProperties();
/**
* @brief ,
* @param[in] content
* @param[in] isHtml Html
*/
void AddItem(const QString & content, bool isHtml = false);
/**
* @brief
* @param[in] name
* @param[in] content
* @param[in] isHtml Html
* @note content QString类型char*AddItem函数产生混乱
*/
void AddItem(const QString & name, const QString & content, bool isHtml = false);
/**
* @brief 线
* @param[in] dashed 线
* @param[in] newTable
* false: 使
* true: 使
*/
void AddSeparator(bool dashed = false, bool newTable = false);
/**
* @brief html字符窗
* @return html字符窗
*/
QString GetHtml() const;
/**
* @brief html格式的属性窗
* @param[in] propertyGroup
* @return html字符窗
*/
QString GetHtml(const std::vector< std::vector< pai::ios::property::PropertyItem > > & propertyGroup);
/**
* @brief
* @param[in] color
*/
void SetNameBackgroundColor(const QColor & color);
/**
* @brief
* @param[in] fontSize
*/
void SetFontSize(const int fontSize);
/**
* @brief
* @param[in] nameColor
*/
void SetNameColor(const QColor & nameColor);
/**
* @brief
* @param[in] nameWidth
*/
void SetNameWidth(int nameWidth);
/**
* @brief
* @param[in] fontWeight
*
*/
void SetFontWeight(int fontWeight);
/**
* @brief
* @param[in] lineHeight
*/
void SetLineHeight(int lineHeight);
private:
/**
* @brief &nbsp替换字符转中的空格
* @param[in] replace
* @return
*/
QString ReplaceToNBSP(const QString & replace);
/*
* @brief item
* @param[in] item item
*/
void InsertItem(const QString & item);
/**
* @brief
*/
void Init();
private:
QString m_html; ///< 记录html字符串
QColor m_NameBackgroundColor; ///< 名字列的背景颜色
int m_FontSize; ///< 字体大小
QColor m_NameColor; ///< 名字颜色
int m_NameWidth; ///< 名字列宽度
int m_TableWidth; ///< 分隔线下的表格宽度
int m_FontWeight; ///< 字体加粗
int m_LineHeight; ///< 行高
QMap< pai::ios::property::ItemUnit, QString > m_PropertyUnitMap; ///< 属性单位Map
};
}
}
#endif ///< PAI_FRAME_IOBJECTMODEL_PAIHTMLPROPERTIES_H