You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Include/iBase/iPlugin/ExcelEngineFuzzy.h

65 lines
2.4 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "ExcelEngine.h"
// 前置声明私有类,主要是为了不引入相关的声明
class ExcelEngineFuzzyPrivate;
// 跨平台+不考虑ActiveX的Excel相关功能实现
class I_PLUGIN_EXPORT ExcelEngineFuzzy : public ExcelEngine
{
Q_OBJECT
public:
ExcelEngineFuzzy();
~ExcelEngineFuzzy();
public:
/// @brief 获取excel的数据信息
/// @note bAutoLoad是否自动加载首页信息
virtual bool loadExcel(const QString& sFilePath, bool bAutoLoad = true);
/// @brief 新建一个工作簿,方便后续另存
virtual bool addWorkBook(QString sDefaultSheet = "");
/// @brief 获取excel的Sheet页
virtual bool getSheetNames(QStringList &listNames);
/// @brief 设定操作的Sheet
/// @param nSheetIndex Sheet索引从1开始
/// @param sSheetName Sheet名称
/// @note 以nSheetIndex为主如果考虑sSheetName此时需要把nSheetIndex=-1
/// setDefaultSheet(-1, “sheet1”
virtual bool setDefaultSheet(int nSheetIndex = 1, QString sSheetName = "");
/// @brief 获取excel的数据(组成的矩形网格)Excel的索引均是从1开始
/// @param vvecData 获取到的数据
/// @param nRowFrom Excel开始行从1开始
/// @param nColFrom Excel开始列从1开始
/// @param nRowTo Excel结束行从1开始默认为-1nRowTo=最大行数
/// @param nColTo Excel结束列从1开始默认为-1nColTo=最大列数
virtual bool getCellValues(VVecVariant& vvecData, \
int nRowFrom = 1, int nColFrom = 1, \
int nRowTo = -1, int nColTo = -1);
/// @brief 设置excel的数据(组成的矩形网格)Excel的索引均是从1开始
/// @param vvecData 需要填充设置的数据
/// @param nRowFrom Excel开始行从1开始
/// @param nColFrom Excel开始列从1开始
/// @param bFormat 设置数据之后,是否重置表格样式
virtual bool setCellValues(const VVecVariant& vvecData, \
int nRowFrom = 1, int nColFrom = 1, \
bool bFormat = false);
/// @brief 执行最后的excel保存动作
virtual bool saveExcel(bool bAdjustLayout = true);
virtual bool saveAsExcel(QString sFile, bool bAdjustLayout = true);
private:
ExcelEngineFuzzyPrivate* d_ptr;
};