mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 21:52:32 +00:00
craft-xls carried its own CellRef, Range, Value, CellError, Visibility, sheet-name quoting, built-in number format table and indexed palette. craft-xlsx and craft-ods need the same ones, so they move to a crate with no dependencies and craft-xls re-exports them: an application gets one Value and one CellRef whichever file it read. Added on the way: A1 parsing (CellRef::parse, Range::parse), Range::count and a1, CellError::parse and the newer error values SpreadsheetML stores as text, builtin_format_id for writers.
88 lines
1.5 KiB
Rust
88 lines
1.5 KiB
Rust
//! The cell formatting choices BIFF8 and SpreadsheetML share. Each format has its own spelling
|
|
//! for them (a number in an XF record, a name in `styles.xml`).
|
|
|
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
|
|
pub enum Underline {
|
|
#[default]
|
|
None,
|
|
Single,
|
|
Double,
|
|
SingleAccounting,
|
|
DoubleAccounting,
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
|
|
pub enum Script {
|
|
#[default]
|
|
Baseline,
|
|
Superscript,
|
|
Subscript,
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
|
|
pub enum HAlign {
|
|
#[default]
|
|
General,
|
|
Left,
|
|
Center,
|
|
Right,
|
|
Fill,
|
|
Justify,
|
|
CenterAcross,
|
|
Distributed,
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
|
|
pub enum VAlign {
|
|
Top,
|
|
Center,
|
|
#[default]
|
|
Bottom,
|
|
Justify,
|
|
Distributed,
|
|
}
|
|
|
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
|
|
pub enum BorderStyle {
|
|
#[default]
|
|
None,
|
|
Thin,
|
|
Medium,
|
|
Dashed,
|
|
Dotted,
|
|
Thick,
|
|
Double,
|
|
Hair,
|
|
MediumDashed,
|
|
DashDot,
|
|
MediumDashDot,
|
|
DashDotDot,
|
|
MediumDashDotDot,
|
|
SlantDashDot,
|
|
}
|
|
|
|
/// Fill patterns, named as SpreadsheetML names them.
|
|
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
|
|
pub enum Pattern {
|
|
#[default]
|
|
None,
|
|
Solid,
|
|
Gray50,
|
|
Gray75,
|
|
Gray25,
|
|
DarkHorizontal,
|
|
DarkVertical,
|
|
DarkDown,
|
|
DarkUp,
|
|
DarkGrid,
|
|
DarkTrellis,
|
|
LightHorizontal,
|
|
LightVertical,
|
|
LightDown,
|
|
LightUp,
|
|
LightGrid,
|
|
LightTrellis,
|
|
Gray125,
|
|
Gray0625,
|
|
}
|