using NPOI.SS.UserModel;

namespace YBEE.EQM.Application;

/// <summary>
/// EXCEL导出服务
/// </summary>
public interface IExportExcelService
{
    /// <summary>
    /// 导出 Excel 文件
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="input"></param>
    /// <returns></returns>
    byte[] ExportExcel<T>(ExportExcelDto<T> input);

    /// <summary>
    /// 获取单元格表头和单元格样式
    /// </summary>
    /// <param name="wb"></param>
    /// <param name="fontSize"></param>
    /// <param name="titleFontSize"></param>
    /// <returns></returns>
    ExportExcelCellStyle GetCellStyle(IWorkbook wb, double fontSize = 10, double titleFontSize = 16);

    /// <summary>
    /// 添加单元格
    /// </summary>
    /// <param name="value"></param>
    /// <param name="row"></param>
    /// <param name="columnIndex"></param>
    /// <param name="cellStyle"></param>
    /// <param name="sheet"></param>
    /// <param name="width"></param>
    /// <param name="zeroToBlank">0转为空白</param>
    /// <param name="cellType"></param>
    ICell AddCell(object value, IRow row, int columnIndex, ICellStyle cellStyle, ISheet sheet = null, int? width = null, bool? zeroToBlank = false, CellType? cellType = null);

    #region 图表
    /// <summary>
    /// 导出柱状图
    /// </summary>
    /// <param name="sheet"></param>
    /// <param name="drawing"></param>
    /// <param name="anchor"></param>
    /// <param name="startDataRow"></param>
    /// <param name="endDataRow"></param>
    /// <param name="columnIndex"></param>
    /// <param name="title"></param>
    /// <param name="serieTitle"></param>
    /// <param name="catalogTitle"></param>
    /// <param name="valueTile"></param>
    void CreateBarChart(ISheet sheet, IDrawing drawing, IClientAnchor anchor, int startDataRow, int endDataRow, int columnIndex, string title = null, string serieTitle = null, string catalogTitle = null, string valueTile = null);
    #endregion
}

