ddn.odf.style
Style model for ODF documents.
Covers style containers, font-face declarations, text and paragraph styles, table and cell styles, page layouts, master pages, list styles, and number styles.
Preservation-first: unknown style families, properties, attributes, and child elements are retained for round-trip fidelity.
Types 21
ODF style-family identifiers used to categorise style definitions.
Maps the style:family attribute values found in ODF XML to a typed enumeration. An UNKNOWN sentinel captures families not yet covered by this model.
Represents a single <style:font-face> declaration from office:font-face-decls.
string namestring familystring familyGenericstring stylestring pitchstring charsetstring svgFontFamilyKey-value attribute map used for style property containers (text-properties, paragraph-properties, etc.).
string[string] attributesTyped view over common ODF text properties (font, colour, underline, etc.).
string fontFamilystring fontSizestring fontWeightstring fontStylestring textDecorationstring textColorstring textUnderlineStylestring textUnderlineColorstring textPositionTextStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `TextStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowWrites non-empty fields back into `props`.Typed view over common ODF paragraph properties (alignment, margins, indentation, spacing, breaks, etc.).
string textAlignstring textAlignSourcestring marginTopstring marginBottomstring marginLeftstring marginRightstring textIndentstring lineHeightstring lineSpacingstring breakBeforestring breakAfterstring keepTogetherstring keepWithNextstring widowOrphansParagraphStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `ParagraphStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowWrites non-empty fields back into `props`.Typed accessor for ODF <style:graphic-properties> elements.
Covers frame/image properties such as width, height, position, wrap mode, clipping, and border.
string widthstring heightstring minWidthstring minHeightstring relWidthstring relHeightstring horizontalPosstring horizontalRelstring verticalPosstring verticalRelstring anchorTypestring wrapstring wrapDynamicThresholdstring runThroughstring clipstring marginRightstring marginLeftstring marginTopstring marginBottomstring borderstring backgroundColorstring opacitystring protectGraphicStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `GraphicStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:drawing-page-properties> elements.
Covers drawing page / presentation master-page properties such as background fill, fill color, and page usage.
string fillColorstring fillstring fillGradientNamestring fillHatchNamestring fillImageNamestring backgroundSizestring backgroundRepeatstring backgroundNoFillstring opacitystring pageUsagestring displayNameDrawingPageStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `DrawingPageStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:chart-properties> elements.
Covers chart-specific style properties such as symbol type, symbol width/ height, interpolation, link-data-style, data-label-number, label-position, percentage, error-category, error-upper-indicator, error-lower-indicator, error-upper-limit, error-lower-limit, error-margin, series-source, dimension, rotation-angle, gap-width, overlap, deep, lines, solid-type, stacked, vertical, three-dimensional, right-angled-axes, japenese-candle-stick, interpolation, symbol-name, symbol-width, symbol-height.
string symbolTypestring symbolNamestring symbolWidthstring symbolHeightstring interpolationstring linkDataStylestring dataLabelNumberstring labelPositionstring labelPositionNegativestring percentagestring errorCategorystring errorUpperIndicatorstring errorLowerIndicatorstring errorUpperLimitstring errorLowerLimitstring errorMarginstring seriesSourcestring dimensionstring rotationAnglestring gapWidthstring overlapstring deepstring linesstring solidTypestring stackedstring verticalstring threeDimensionalstring rightAngledAxesstring japaneseCandleStickChartStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `ChartStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:presentation-properties> elements.
Covers presentation-specific style properties such as transitions, timing, and placeholder settings.
string transitionTypestring transitionStylestring transitionSpeedstring durationstring visibilitystring placeholderstring userTransformedstring fitToSizestring showUnitstring decimalPlacesPresentationStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `PresentationStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:section-properties> elements.
Covers section-level properties such as background, columns, protection, and writing mode.
string backgroundColorstring backgroundTransparentColorstring protectstring writingModestring textColumnsstring columnGapstring dontBalanceTextColumnsstring editableSectionStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `SectionStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:ruby-properties> elements.
Covers ruby text positioning and alignment.
string positionstring alignmentRubyStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `RubyStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:table-properties> elements.
Covers table-wide properties such as width, background, border model, writing mode, and display/visibility.
string widthstring relWidthstring backgroundColorstring borderModelstring writingModestring displaystring mayBreakBetweenRowsstring pageNumberTableStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `TableStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:table-cell-properties> elements.
Covers cell-specific properties such as padding, borders, vertical alignment, wrap option, rotation, and data style name.
string paddingTopstring paddingBottomstring paddingLeftstring paddingRightstring borderstring borderTopstring borderBottomstring borderLeftstring borderRightstring verticalAlignstring wrapOptionstring rotationAnglestring rotationAlignstring dataStyleNamestring backgroundColorstring repeatContentCellStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `CellStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:table-row-properties> elements.
Covers row height, minimum height, background, break controls, and keep-together.
string rowHeightstring minHeightstring backgroundColorstring breakBeforestring breakAfterstring keepTogetherstring windowHeightTableRowStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `TableRowStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.Typed accessor for ODF <style:table-column-properties> elements.
Covers column width, relative width, break controls, and visibility.
string columnWidthstring relColumnWidthstring breakBeforestring breakAfterstring visibilityTableColumnStyle fromProperties(ref const StyleProperties props) @safe pure nothrowConstructs a `TableColumnStyle` from the given property map.void applyTo(ref StyleProperties props) @safe pure nothrowApplies typed fields back to a property map.A single ODF <style:style> or <style:default-style> element, carrying its name, family, parent reference, and per-family property maps.
string nameOdfStyleFamily familystring parentStyleNamestring displayNamebool isDefaultbool isAutomaticStyleProperties textPropertiesStyleProperties paragraphPropertiesStyleProperties sectionPropertiesStyleProperties tablePropertiesStyleProperties tableColumnPropertiesStyleProperties tableRowPropertiesStyleProperties tableCellPropertiesStyleProperties graphicPropertiesStyleProperties drawingPagePropertiesStyleProperties chartPropertiesStyleProperties presentationPropertiesStyleProperties rubyPropertiesStyleProperties unknownPropertiesXmlElement[] unknownChildrenA <style:page-layout> with its page, header, and footer property maps.
string nameStyleProperties pagePropertiesStyleProperties headerPropertiesStyleProperties footerPropertiesA <style:master-page> element linking a page layout to a master page name.
string namestring pageLayoutNamestring displayNameA <text:list-style> element capturing list-level formatting.
string namebool isDefaultstring styleNameA data-style element (number:number-style, number:currency-style, etc.) with locale information.
string namestring numberLanguagestring numberCountryTop-level container for all style information parsed from an ODF document-styles.xml part.
Holds font-face declarations, named styles, automatic styles, default styles, page layouts, master pages, list styles, number styles, and any unrecognised elements.
FontFace[] fontFacesStyleDefinition[] stylesStyleDefinition[] automaticStylesStyleDefinition[] defaultStylesPageLayout[] pageLayoutsMasterPage[] masterPagesListStyle[] listStylesNumberStyle[] numberStylesXmlElement[] unknownElementsFunctions 26
OdfStyleFamily parseStyleFamily(string family) @safe pure nothrowConverts an ODF `style:family` attribute string to an `OdfStyleFamily` enum value.string styleFamilyString(OdfStyleFamily family) @safe pure nothrowConverts an `OdfStyleFamily` enum value back to the corresponding ODF attribute string.OdfStyles parseStyles(const(ubyte)[] xmlBytes)Parses raw `document-styles.xml` bytes into an `OdfStyles` container.OdfStyles parseStylesString(string xml)Parses a `document-styles.xml` string into an `OdfStyles` container.string serializeStyles(const ref OdfStyles styles)Serialises an `OdfStyles` container back to a well-formed `office:document-styles` XML string.const(StyleDefinition) * findStyle(const ref OdfStyles styles,
string name, bool automatic = false)Looks up a named style in `styles` or `automaticStyles`.const(StyleDefinition) * findDefaultStyle(const ref OdfStyles styles,
OdfStyleFamily family)Looks up a default style by family.OdfDiagnosticCollector validateStyleReferences(const ref OdfStyles styles)Validates internal consistency of an `OdfStyles` container.bool hasStyleName(const ref OdfStyles styles, string name)Returns `true` if any style container (styles, automatic, or default) contains a definition with the given `name`.void validateNoDuplicateNames(const ref OdfStyles styles,
ref OdfDiagnosticCollector collector)void validateParentReferences(const ref OdfStyles styles,
ref OdfDiagnosticCollector collector)void validateNoCycles(const ref OdfStyles styles,
ref OdfDiagnosticCollector collector)void validatePageLayoutReferences(const ref OdfStyles styles,
ref OdfDiagnosticCollector collector)void parseFontFaceDecls(XmlElement el, ref OdfStyles styles)void parseStyleContainer(XmlElement el, ref OdfStyles styles,
bool isAutomatic)void parseProperties(XmlElement el, ref StyleProperties props)void parseMasterStyles(XmlElement el, ref OdfStyles styles)void serializeFontFace(XmlElement parent, ref const FontFace ff)void serializeStyleDef(XmlElement parent, ref const StyleDefinition s)void serializeProps(XmlElement parent, string tagName,
ref const StyleProperties props)void serializePageLayout(XmlElement parent, ref const PageLayout pl)void serializeMasterPage(XmlElement parent, ref const MasterPage mp)void serializeListStyle(XmlElement parent, ref const ListStyle ls)void serializeNumberStyle(XmlElement parent, ref const NumberStyle ns)