# 枚举类型

## 计算模式枚举

enum CalcTypeEnum

  workbook 计算模式

  enumerator CALCTYPE_AUTO

    当单元格的值变更时，自动进行计算

  enumerator CALCTYPE_MANUAL

    工作簿中的计算由用户手动触发。

  enumerator CALCTYPE_AUTONOTABLE

    自动计算，但不包括表的计算。

## 工作表类型枚举

enum SheetTypeEnum

  工作簿中的工作表类型

  enumerator SHEETTYPE_UNKNOWN
  enumerator SHEETTYPE_WORKSHEET
  enumerator SHEETTYPE_CHARTSHEET
  enumerator SHEETTYPE_DIALOGSHEET

enum SheetStateEnum

  工作表的可见性状态

  enumerator SHEETSTATE_VISIBLE

    工作表可见

  enumerator SHEETSTATE_HIDDEN

    工作表隐藏，用户可取消隐藏。

  enumerator SHEETSTATE_VERYHIDDEN

    工作表隐藏，用户不能取消隐藏。

## 工作表保护枚举

enum SheetProtectEnum

  工作表保护选项(位掩码)。

  enumerator PROTECT_SELECT_LOCKED_CELLS

    当工作表受到保护时不允许选择锁定单元格

  enumerator PROTECT_SELECT_UNLOCKED_CELLS

    当工作表受到保护时不允许选择未锁定的单元格

  enumerator PROTECT_OBJECTS

    当工作表受到保护时同时保护对象

  enumerator PROTECT_SCENARIOS

    当工作表受到保护时不允许编辑方案

  enumerator PROTECT_FORMAT_CELLS

    当工作表受到保护时不能设置单元格格式

  enumerator PROTECT_FORMAT_COLUMNS

    当工作表受到保护时不能设置列格式

  enumerator PROTECT_FORMAT_ROWS

    当工作表受到保护时不能设置行格式

  enumerator PROTECT_INSERT_COLUMNS

    当工作表受到保护时不能插入列

  enumerator PROTECT_INSERT_ROWS

    当工作表受到保护时不能插入行

  enumerator PROTECT_INSERT_HYPERLINKS

    当工作表受到保护时不能插入超链接

  enumerator PROTECT_DELETE_COLUMNS

    当工作表受到保护时不能删除列

  enumerator PROTECT_DELETE_ROWS

    当工作表受到保护时不能删除行

  enumerator PROTECT_SORT

    当工作表受到保护时不能排序

  enumerator PROTECT_AUTOFILTER

    当工作表受到保护时不能自动筛选

  enumerator PROTECT_PIVOTTABLES

    当工作表受到保护时不允许操作透视表

  enumerator PROTECT_ALL

    当工作表受到保护时所有操作都不允许

  enumerator PROTECT_DEFAULT

    当工作表受到保护时，除 PROTECT_SORT、PROTECT_AUTOFILTER 和 PROTECT_PIVOTTABLES 外，所有其他操作都不允许

## 单元格数据类型枚举

enum CellTypeEnum

  单元格数据类型

  enumerator CELLTYPE_NONE

    单元格不存在

  enumerator CELLTYPE_BLANK

    空单元格

  enumerator CELLTYPE_NUMBER

    数值

  enumerator CELLTYPE_STRING

    字符串值

  enumerator CELLTYPE_BOOLEAN

    布尔值

  enumerator CELLTYPE_DATETIME

    日期/时间值

  enumerator CELLTYPE_ERROR

    错误类型值

enum ErrorCodeEnum

  Excel 错误码

  enumerator ERRCODE_UNKNOWN

    未知错误

  enumerator ERRCODE_NONE

    无错误

  enumerator ERRCODE_NULL

    #NULL! 错误

  enumerator ERRCODE_DIV_0

    #DIV/0! 错误

  enumerator ERRCODE_VALUE

    #VALUE! 错误

  enumerator ERRCODE_REF

    #REF! 错误

  enumerator ERRCODE_NAME

    #NAME? 错误

  enumerator ERRCODE_NUM

    #NUM! 错误

  enumerator ERRCODE_NA

    #N/A 错误

  enumerator ERRCODE_GETTING_DATA

    #GETTING_DATA 错误

  enumerator ERRCODE_SPILL

    #SPILL! 错误

## 内置数字格式

ID | format code
--- | ---
0 | General
1 | 0
2 | 0.00
3 | #,##0
4 | #,##0.00
9 | 0%
10 | 0.00%
11 | 0.00E+00
12 | # ?/?
13 | # ??/??
14 | mm-dd-yy
15 | d-mmm-yy
16 | d-mmm
17 | mmm-yy
18 | h:mm AM/PM
19 | h:mm:ss AM/PM
20 | h:mm
21 | h:mm:ss
22 | m/d/yy h:mm
37 | #,##0 ;(#,##0)
38 | #,##0 ;[Red](#,##0)
39 | #,##0.00;(#,##0.00)
40 | #,##0.00;[Red](#,##0.00)
45 | mm:ss
46 | [h]:mm:ss
47 | mmss.0
48 | ##0.0E+0
49 | @

## 内置单元格样式:

样式名称 | 图示
--- | ---
normal |
comma |
currency |
percent |
comma0 |
currency0 |
note |
warningText |
title |
heading1 |
heading2 |
heading3 |
heading4 |
input |
output |
calculation |
checkCell |
linkedCell |
total |
good |
bad |
neutral |
accent1 |
accent1pct20 |
accent1pct40 |
accent1pct60 |
accent2 |
accent2pct20 |
accent2pct40 |
accent2pct60 |
accent3 |
accent3pct20 |
accent3pct40 |
accent3pct60 |
accent4 |
accent4pct20 |
accent4pct40 |
accent4pct60 |
accent5 |
accent5pct20 |
accent5pct40 |
accent5pct60 |
accent6 |
accent6pct20 |
accent6pct40 |
accent6pct60 |
explanatoryText |

## 对齐方式枚举

enum HAlignEnum

  水平对齐选项

  enumerator HALIGN_GENERAL

    常规对齐。即文本数据左对齐，数字、日期和时间是右对齐的，布尔类型居中

  enumerator HALIGN_LEFT

    左对齐，即使在从右向左模式下也是如此。对齐单元格左边缘的内容。如果指定了缩进量，则单元格的内容将从左侧缩进指定数量的字符空间。字符空间基于工作簿的默认字体和字体大小。

  enumerator HALIGN_CENTER

    水平方向居中对齐

  enumerator HALIGN_RIGHT

    水平方向右对齐

  enumerator HALIGN_FILL

    水平方向充满整个单元格宽度

  enumerator HALIGN_JUSTIFY

    水平方向分散对齐

  enumerator HALIGN_CENTERCONTINUOUS

    水平对齐在多个单元格之间居中

  enumerator HALIGN_DISTRIBUTED

    单元格内每行文本在单元格宽度上均匀分布，左右边距齐平

enum VAlignEnum

  垂直对其选项

  enumerator VALIGN_BOTTOM

    靠下对齐

  enumerator VALIGN_CENTER

    上下居中对齐

  enumerator VALIGN_TOP

    靠上对齐

  enumerator VALIGN_JUSTIFY

    上下两端对齐

  enumerator VALIGN_DISTRIBUTED

    垂直分散对齐

## 边框枚举

enum BorderStyleEnum

  边框线样式。

  enumerator BORDER_NONE

    无边框

  enumerator BORDER_THIN

    细线

  enumerator BORDER_MEDIUM

    中等线

  enumerator BORDER_THICK

    粗线

  enumerator BORDER_DOUBLE

    双线

  enumerator BORDER_DASHED

    虚线

  enumerator BORDER_MEDIUMDASHED

    中等虚线

  enumerator BORDER_DASHDOT

    点划线

  enumerator BORDER_MEDIUMDASHDOT

    中等点划线

  enumerator BORDER_DASHDOTDOT

    点点划线

  enumerator BORDER_MEDIUMDASHDOTDOT

    中等点点划线

  enumerator BORDER_SLANTDASHDOT

    倾斜点划线

  enumerator BORDER_DOTTED

    点线

  enumerator BORDER_HAIR

    极细线

enum BorderIndexEnum

  边框位置选项

  enumerator BORDERINDEX_LEFT

    左边框

  enumerator BORDERINDEX_RIGHT

    右边框

  enumerator BORDERINDEX_TOP

    上边框

  enumerator BORDERINDEX_BOTTOM

    下边框

  enumerator BORDERINDEX_HORIZONTAL

    水平边框

  enumerator BORDERINDEX_VERTICAL

    垂直边框

  enumerator BORDERINDEX_DIAGONAL_DOWN

    向下对角线边框

  enumerator BORDERINDEX_DIAGONAL_UP

    向上对角线边框

  enumerator BORDERINDEX_EDGE

    外边框

  enumerator BORDERINDEX_INSIDE

    内边框

## 单元格填充图案。

enum PatternTypeEnum

  (以黄色背景、黑色前景为例)

  枚举值 | 图示
  --- | ---
  PATTERNTYPE_NONE |
  PATTERNTYPE_SOLID |
  PATTERNTYPE_DARKGRAY |
  PATTERNTYPE_MEDIUMGRAY |
  PATTERNTYPE_LIGHTGRAY |
  PATTERNTYPE_GRAY125 |
  PATTERNTYPE_GRAY0625 |
  PATTERNTYPE_DARKHORIZONTAL |
  PATTERNTYPE_DARKVERTICAL |
  PATTERNTYPE_DARKUP |
  PATTERNTYPE_DARKDOWN |
  PATTERNTYPE_DARKTRELLIS |
  PATTERNTYPE_DARKGRID |
  PATTERNTYPE_LIGHTHORIZONTAL |
  PATTERNTYPE_LIGHTVERTICAL |
  PATTERNTYPE_LIGHTUP |
  PATTERNTYPE_LIGHTDOWN |
  PATTERNTYPE_LIGHTTRELLIS |
  PATTERNTYPE_LIGHTGRID |

## 文本格式枚举

enum VertAlignRunEnum

  指定内容相对于文本默认外观的对齐方式的可能值。

  enumerator VALIGNRUN_BASELINE

    正常基线对齐

  enumerator VALIGNRUN_SUBSCRIPT

    下标文本

  enumerator VALIGNRUN_SUPERSCRIPT

    上标文本

enum UnderlineEnum

  文本下划线样式。

  enumerator UNDERLINE_NONE

    无下划线

  enumerator UNDERLINE_SINGLE

    单下划线

  enumerator UNDERLINE_SINGLEACCOUNTING

    会计用单下划线

  enumerator UNDERLINE_DOUBLE

    双下划线

  enumerator UNDERLINE_DOUBLEACCOUNTING

    会计用双下划线

## 表函数枚举

内置表格样式

> 参见: 内置表格样式

enum TotalsFuncEnum

  表汇总行函数。

  enumerator TOTALS_FUNC_NONE

    无函数

  enumerator TOTALS_FUNC_SUM

    值求和

  enumerator TOTALS_FUNC_AVERAGE

    值求平均

  enumerator TOTALS_FUNC_COUNT

    非空单元格计数

  enumerator TOTALS_FUNC_COUNT_NUMS

    数字单元格计数

  enumerator TOTALS_FUNC_CUSTOM

    自定义公式

  enumerator TOTALS_FUNC_MIN

    最小值

  enumerator TOTALS_FUNC_MAX

    最大值

  enumerator TOTALS_FUNC_STDDEV

    标准偏差

  enumerator TOTALS_FUNC_VAR

    方差

## 测量单位枚举

enum RowHeightUnitEnum

  行高测量单位。

  enumerator ROWHEIGHT_POINTS

    磅(1/72英寸)

  enumerator ROWHEIGHT_INCH

    英寸

  enumerator ROWHEIGHT_MM

    毫米

enum ColWidthUnitEnum

  列宽测量单位。

  enumerator COLWIDTH_CHARS

    字符单位(Excel默认)

  enumerator COLWIDTH_INCH

    英寸

  enumerator COLWIDTH_MM

    毫米

## 形状和对象枚举

enum ShapeAnchorEnum

  形状随单元格调整大小的锚定行为。

  enumerator SHAPE_ABSOLUTE

    不随单元格移动或调整大小

  enumerator SHAPE_ONLY_MOVE

    随单元格移动但不调整大小

  enumerator SHAPE_MOVE_AND_RESIZE

    随锚定单元格移动和调整大小

## 打印枚举

enum PageOrientEnum

  页面打印方向。

  enumerator PAGEORIENT_DEFAULT

    默认方向

  enumerator PAGEORIENT_LANDSCAPE

    横向

  enumerator PAGEORIENT_PORTRAIT

    纵向

enum PrintOrderEnum

  页面打印顺序。

  enumerator PRINTORDER_DOWNTHENOVER

    先向下后向右

  enumerator PRINTORDER_OVERTHENDOWN

    先向右后向下

enum PaperUnitEnum

  纸张测量单位。

  enumerator PAPERUNIT_mm

    毫米

  enumerator PAPERUNIT_cm

    厘米

  enumerator PAPERUNIT_in

    英寸

  enumerator PAPERUNIT_pt

    点数

  enumerator PAPERUNIT_pc

    派卡

  enumerator PAPERUNIT_pi

    打印机英寸

enum PrintCMTEnum

  单元格注释打印选项。

  enumerator PRINTCMT_NONE

    不打印注释

  enumerator PRINTCMT_ASDISPLAYED

    按工作表中显示打印

  enumerator PRINTCMT_ATEND

    在工作表末尾打印

enum PrintErrorEnum

  错误值打印选项。

  enumerator PRINTERROR_BLANK

    将错误显示为空白

  enumerator PRINTERROR_DASH

    将错误显示为短划线

  enumerator PRINTERROR_DISPLAYED

    按屏幕显示显示错误

  enumerator PRINTERROR_NA

    将错误显示为#N/A

## 打印纸张尺寸常量

纸张尺寸标识

    /*
         ID              Paper
       ------------------------------------------------------
          1  =  Letter paper(8.5 in.by 11 in.)
          2  =  Letter small paper(8.5 in.by 11 in.)
          3  =  Tabloid paper(11 in.by 17 in.)
          4  =  Ledger paper(17 in.by 11 in.)
          5  =  Legal paper(8.5 in.by 14 in.)
          6  =  Statement paper(5.5 in.by 8.5 in.)
          7  =  Executive paper(7.25 in.by 10.5 in.)
          8  =  A3 paper(297 mm by 420 mm)
          9  =  A4 paper(210 mm by 297 mm)
         10  =  A4 small paper(210 mm by 297 mm)
         11  =  A5 paper(148 mm by 210 mm)
         12  =  B4 paper(250 mm by 353 mm)
         13  =  B5 paper(176 mm by 250 mm)
         14  =  Folio paper(8.5 in.by 13 in.)
         15  =  Quarto paper(215 mm by 275 mm)
         16  =  Standard paper(10 in.by 14 in.)
         17  =  Standard paper(11 in.by 17 in.)
         18  =  Note paper(8.5 in.by 11 in.)
         19  =  #9 envelope(3.875 in.by 8.875 in.)
         20  =  #10 envelope(4.125 in.by 9.5 in.)
         21  =  #11 envelope(4.5 in.by 10.375 in.)
         22  =  #12 envelope(4.75 in.by 11 in.)
         23  =  #14 envelope(5 in.by 11.5 in.)
         24  =  C paper(17 in.by 22 in.)
         25  =  D paper (22 in. by 34 in.)
         26  =  E paper (34 in. by 44 in.)
         27  =  DL envelope (110 mm by 220 mm)
         28  =  C5 envelope (162 mm by 229 mm)
         29  =  C3 envelope (324 mm by 458 mm)
         30  =  C4 envelope (229 mm by 324 mm)
         31  =  C6 envelope (114 mm by 162 mm)
         32  =  C65 envelope (114 mm by 229 mm)
         33  =  B4 envelope (250 mm by 353 mm)
         34  =  B5 envelope (176 mm by 250 mm)
         35  =  B6 envelope (176 mm by 125 mm)
         36  =  Italy envelope (110 mm by 230 mm)
         37  =  Monarch envelope (3.875 in. by 7.5 in.).
         38  =  6 3/4 envelope (3.625 in. by 6.5 in.)
         39  =  US standard fanfold (14.875 in. by 11 in.)
         40  =  German standard fanfold (8.5 in. by 12 in.)
         41  =  German legal fanfold (8.5 in. by 13 in.)
         42  =  ISO B4 (250 mm by 353 mm)
         43  =  Japanese double postcard (200 mm by 148 mm)
         44  =  Standard paper (9 in. by 11 in.)
         45  =  Standard paper (10 in. by 11 in.)
         46  =  Standard paper (15 in. by 11 in.)
         47  =  Invite envelope (220 mm by 220 mm)
         50  =  Letter extra paper (9.275 in. by 12 in.)
         51  =  Legal extra paper (9.275 in. by 15 in.)
         52  =  Tabloid extra paper (11.69 in. by 18 in.)
         53  =  A4 extra paper (236 mm by 322 mm)
         54  =  Letter transverse paper (8.275 in. by 11 in.)
         55  =  A4 transverse paper (210 mm by 297 mm)
         56  =  Letter extra transverse paper (9.275 in. by 12 in.)
         57  =  SuperA/SuperA/A4 paper (227 mm by 356 mm)
         58  =  SuperB/SuperB/A3 paper (305 mm by 487 mm)
         59  =  Letter plus paper (8.5 in. by 12.69 in.)
         60  =  A4 plus paper (210 mm by 330 mm)
         61  =  A5 transverse paper (148 mm by 210 mm)
         62  =  JIS B5 transverse paper (182 mm by 257 mm)
         63  =  A3 extra paper (322 mm by 445 mm)
         64  =  A5 extra paper (174 mm by 235 mm)
         65  =  ISO B5 extra paper (201 mm by 276 mm)
         66  =  A2 paper (420 mm by 594 mm)
         67  =  A3 transverse paper (297 mm by 420 mm)
         68  =  A3 extra transverse paper (322 mm by 445 mm)
         69  =  Japanese Double Postcard (200 mm x 148 mm)
         70  =  A6 (105 mm x 148 mm)
         71  =  Japanese Envelope Kaku #2
         72  =  Japanese Envelope Kaku #3
         73  =  Japanese Envelope Chou #3
         74  =  Japanese Envelope Chou #4
         75  =  Letter Rotated (11in x 8 1/2 11 in)
         76  =  A3 Rotated (420 mm x 297 mm)
         77  =  A4 Rotated (297 mm x 210 mm)
         78  =  A5 Rotated (210 mm x 148 mm)
         79  =  B4 (JIS) Rotated (364 mm x 257 mm)
         80  =  B5 (JIS) Rotated (257 mm x 182 mm)
         81  =  Japanese Postcard Rotated (148 mm x 100 mm)
         82  =  Double Japanese Postcard Rotated (148 mm x 200 mm)
         83  =  A6 Rotated (148 mm x 105 mm)
         84  =  Japanese Envelope Kaku #2 Rotated
         85  =  Japanese Envelope Kaku #3 Rotated
         86  =  Japanese Envelope Chou #3 Rotated
         87  =  Japanese Envelope Chou #4 Rotated
         88  =  B6 (JIS) (128 mm x 182 mm)
         89  =  B6 (JIS) Rotated (182 mm x 128 mm)
         90  =  (12 in x 11 in)
         91  =  Japanese Envelope You #4
         92  =  Japanese Envelope You #4 Rotated
         93  =  PRC 16K (146 mm x 215 mm)
         94  =  PRC 32K (97 mm x 151 mm)
         95  =  PRC 32K(Big) (97 mm x 151 mm)
         96  =  PRC Envelope #1 (102 mm x 165 mm)
         97  =  PRC Envelope #2 (102 mm x 176 mm)
         98  =  PRC Envelope #3 (125 mm x 176 mm)
         99  =  PRC Envelope #4 (110 mm x 208 mm)
        100  =  PRC Envelope #5 (110 mm x 220 mm)
        101  =  PRC Envelope #6 (120 mm x 230 mm)
        102  =  PRC Envelope #7 (160 mm x 230 mm)
        103  =  PRC Envelope #8 (120 mm x 309 mm)
        104  =  PRC Envelope #9 (229 mm x 324 mm)
        105  =  PRC Envelope #10 (324 mm x 458 mm)
        106  =  PRC 16K Rotated
        107  =  PRC 32K Rotated
        108  =  PRC 32K(Big) Rotated
        109  =  PRC Envelope #1 Rotated (165 mm x 102 mm)
        110  =  PRC Envelope #2 Rotated (176 mm x 102 mm)
        111  =  PRC Envelope #3 Rotated (176 mm x 125 mm)
        112  =  PRC Envelope #4 Rotated (208 mm x 110 mm)
        113  =  PRC Envelope #5 Rotated (220 mm x 110 mm)
        114  =  PRC Envelope #6 Rotated (230 mm x 120 mm)
        115  =  PRC Envelope #7 Rotated (230 mm x 160 mm)
        116  =  PRC Envelope #8 Rotated (309 mm x 120 mm)
        117  =  PRC Envelope #9 Rotated (324 mm x 229 mm)
        118  =  PRC Envelope #10 Rotated (458 mm x 324 mm)
    */

## 使用示例

    // Setting cell alignment
    style->set_align_h(HALIGN_CENTER);
    style->set_align_v(VALIGN_MIDDLE);

    // Applying borders
    style->set_border(BORDERINDEX_EDGE, BORDER_MEDIUM);
    style->set_border(BORDERINDEX_INSIDE, BORDER_THIN);

    // Setting fill pattern
    style->set_fill_pattern(PATTERNTYPE_SOLID);
    style->set_pattern_bg_color(RGB(255, 255, 0));

    // Configuring table totals
    table->set_totals_row_func(2, TOTALS_FUNC_SUM);
    table->set_totals_row_func(3, TOTALS_FUNC_AVERAGE);

Styled using the Piccolo Theme