CellStyle
概述
CellStyle 是 Aspose.Cells Rust 开源软件中的结构体。继承自:Debug、Clone、PartialEq,以及另外 3 个。
表示一个可变的单元格样式外观,可应用于一个或多个单元格。
此结构体为 Rust 程序中的 CellStyle 对象声明了 46 个方法。可用的方法包括:borders、clear_horizontal_alignment、clear_number_format、clear_vertical_alignment、copy、copy_from、default、fill、font、get_borders、get_borders_mut、get_custom,以及另外 34 个方法。安装 Aspose.Cells Rust 开源软件包后,公共成员对任何 Rust 应用程序均可访问。字段:background_color、borders、custom、fill_color、font、horizontal_alignment,以及另外 13 项。
字段
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
number | i32 | 读写 | 获取该数字。 |
custom | Option<String> | 读写 | 获取自定义。 |
number_format | Option<String> | 读写 | 获取数字格式。 |
horizontal_alignment | Option<HorizontalAlignment> | 读写 | 获取水平对齐方式。 |
vertical_alignment | Option<VerticalAlignment> | 读写 | 获取垂直对齐方式。 |
wrap_text | bool | 读写 | 获取换行文本。 |
indent_level | u8 | 读写 | 获取缩进级别。 |
text_rotation | u16 | 读写 | 获取文本旋转。 |
shrink_to_fit | bool | 读写 | 获取 shrink to fit。 |
reading_order | u8 | 读写 | 获取阅读顺序。 |
relative_indent | i32 | 读写 | 获取相对缩进。 |
pattern | FillPattern | 读写 | 获取模式。 |
background_color | Option<String> | 读写 | 获取背景颜色。 |
font | Font | 读写 | 获取字体。 |
fill_color | Option<String> | 读写 | 获取填充颜色。 |
borders | Borders | 读写 | 获取边框。 |
is_locked | bool | 读写 | 获取是否已锁定。 |
is_hidden | bool | 读写 | 获取是否隐藏。 |
quote_prefix | bool | 读写 | 获取引用前缀。 |
方法
| 签名 | 描述 |
|---|---|
default() → Self | 在此 CellStyle 实例上调用默认。 |
new() → Self | 初始化一个新实例。 |
copy(source: &CellStyle) | 从另一个样式对象复制数据。 |
copy_from(source: &CellStyle) | 从另一个样式实例复制所有样式值。 |
get_number_format() → Option<&str> | 获取已解析的数字格式字符串。 |
set_number_format(value: impl Into<String>) | 设置已解析的数字格式字符串。 |
clear_number_format() | 清除数字格式。 |
get_number() → i32 | 获取数值格式标识符。 |
set_number(value: i32) | 设置数字格式标识符。 |
get_custom() → Option<&str> | 获取自定义数字格式代码。 |
set_custom(value: impl Into<String>) | 设置自定义数字格式代码。 |
get_horizontal_alignment() → Option<HorizontalAlignment> | 获取水平对齐方式。 |
set_horizontal_alignment(value: HorizontalAlignment) | 设置水平对齐方式。 |
clear_horizontal_alignment() | 清除水平对齐。 |
get_vertical_alignment() → Option<VerticalAlignment> | 获取垂直对齐方式。 |
set_vertical_alignment(value: VerticalAlignment) | 设置垂直对齐方式。 |
clear_vertical_alignment() | 清除垂直对齐。 |
get_is_text_wrapped() → bool | 获取关联的值。 |
set_is_text_wrapped(value: bool) | 设置关联的值。 |
get_indent_level() → u8 | 获取缩进级别。 |
set_indent_level(value: u8) | 设置缩进级别。 |
get_text_rotation() → u16 | 获取文本旋转。 |
set_text_rotation(value: u16) → Result<(), CellsError> | 设置文本旋转。 |
get_shrink_to_fit() → bool | 获取单元格内容是否收缩以适应。 |
set_shrink_to_fit(value: bool) | 设置单元格内容是否收缩以适应。 |
get_reading_order() → u8 | 获取读取顺序。 |
set_reading_order(value: u8) → Result<(), CellsError> | 设置阅读顺序。 |
get_relative_indent() → i32 | 获取相对缩进。 |
set_relative_indent(value: i32) | 设置相对缩进。 |
get_is_locked() → bool | 获取在启用工作表保护时单元格是否被锁定。 |
set_is_locked(value: bool) | 设置在启用工作表保护时单元格是否被锁定。 |
get_is_hidden() → bool | 获取在启用工作表保护时单元格公式是否被隐藏。 |
set_is_hidden(value: bool) | 设置在启用工作表保护时单元格公式是否被隐藏。 |
get_quote_prefix() → bool | 获取单元格值是否以单引号开头。 |
set_quote_prefix(value: bool) | 设置单元格值是否以单引号开头。 |
font() → &Font | 获取字体设置。 |
get_font() → &Font | 获取字体设置。 |
get_font_mut() → &mut Font | 获取可变的字体设置,以便可以直接更改字体属性:style.get_font_mut().set_size(14.0)。 |
set_font(font: Font) | 设置字体设置。 |
fill() → Fill | 获取关联的值。 |
get_fill() → Fill | 获取关联的值。 |
set_fill(fill: Fill) | 设置关联的值。 |
borders() → &Borders | 获取边框设置。 |
get_borders() → &Borders | 获取边框设置。 |
get_borders_mut() → &mut Borders | 获取可变的边框设置,以便可以就地更改边框:style.get_borders_mut().top_mut().set_color("FFFF0000")。 |
set_borders(borders: Borders) | 设置边框设置。 |