Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::parser::PropertyParseFnParams Struct Reference

Parameters for a property parse function. More...

#include "donner/svg/properties/PropertyParsing.h"

Collaboration diagram for donner::svg::parser::PropertyParseFnParams:
[legend]

Public Member Functions

std::span< const css::ComponentValuecomponents () const
 Get the list of css::ComponentValue for the property value.
 
bool allowUserUnits () const
 Returns true if user units are allowed for the property.
 

Static Public Member Functions

static PropertyParseFnParams Create (const css::Declaration &declaration, css::Specificity specificity, PropertyParseBehavior parseBehavior=PropertyParseBehavior::Default)
 Create a new PropertyParseFnParams from a declaration and specificity.
 
static PropertyParseFnParams CreateForAttribute (std::string_view value)
 Create a new PropertyParseFnParams from a declaration and specificity.
 

Public Attributes

std::variant< std::string_view, std::span< const css::ComponentValue > > valueOrComponents
 Property value, which may either be a string or list of css::ComponentValue.
 
PropertyState explicitState = PropertyState::NotSet
 Explicit state of the property, such as "inherit", "initial" or "unset". If this is PropertyState::NotSet, ignore this field and parse valueOrComponents.
 
css::Specificity specificity
 Specificity of the property, used for inheritance.
 
PropertyParseBehavior parseBehavior = PropertyParseBehavior::Default
 For presentation attributes, values may be unitless, in which case they the spec says they are specified in "user units". See https://www.w3.org/TR/SVG2/types.html#syntax.
 

Detailed Description

Parameters for a property parse function.

Member Function Documentation

◆ Create()

PropertyParseFnParams donner::svg::parser::PropertyParseFnParams::Create ( const css::Declaration & declaration,
css::Specificity specificity,
PropertyParseBehavior parseBehavior = PropertyParseBehavior::Default )
static

Create a new PropertyParseFnParams from a declaration and specificity.

Parameters
declarationCSS declaration, e.g. "transform: translate(10px, 20px);".
specificitySpecificity of the declaration.
parseBehaviorBehavior for parsing numbers. See PropertyParseBehavior.

◆ CreateForAttribute()

PropertyParseFnParams donner::svg::parser::PropertyParseFnParams::CreateForAttribute ( std::string_view value)
static

Create a new PropertyParseFnParams from a declaration and specificity.

Parameters
valuePresentation attribute value, e.g. "translate(10px, 20px)".

The documentation for this struct was generated from the following files: