NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
novasvg::SVGForeignObjectElement Class Referencefinal

#include <svgelement.h>

Inheritance diagram for novasvg::SVGForeignObjectElement:
Collaboration diagram for novasvg::SVGForeignObjectElement:

Public Member Functions

 SVGForeignObjectElement (Document *document)
 
const SVGLength & x () const
 
const SVGLength & y () const
 
const SVGLength & width () const
 
const SVGLength & height () const
 
const Font & font () const
 
const SVGPaintServer & fill () const
 
unsigned char baseFontStyle () const
 Bold/italic bits (ForeignObjectFonts::Bold/Italic) the element itself inherits, i.e. the style of font().
 
ForeignObjectFonts fontsFor (unsigned usedStyles) const
 
const std::string & rawContent () const
 Raw markup captured between <foreignObject ...> and </foreignObject> (whatever HTML/XML the document embedded there), exactly as it appeared in the source – untouched, unparsed. What a ForeignObjectRenderer does with it is entirely up to that renderer.
 
void setRawContent (std::string content)
 
ForeignObjectRenderer * renderer () const
 
void setRenderer (ForeignObjectRenderer *renderer)
 
const std::optional< Color > & htmlTextColor () const
 
const std::optional< Color > & htmlBackgroundColor () const
 
void setHtmlStyle (std::optional< Color > text, std::optional< Color > background)
 
Rect fillBoundingBox () const final
 
Rect strokeBoundingBox () const final
 
void layoutElement (const SVGLayoutState &state) final
 
void render (SVGRenderState &state) const final
 
- Public Member Functions inherited from novasvg::SVGGraphicsElement
 SVGGraphicsElement (Document *document, ElementID id)
 
bool isGraphicsElement () const final
 
const SVGTransform & transform () const
 
Transform localTransform () const override
 
SVGPaintServer getPaintServer (const Paint &paint, float opacity) const
 
StrokeData getStrokeData (const SVGLayoutState &state) const
 
- Public Member Functions inherited from novasvg::SVGElement
 SVGElement (Document *document, ElementID id)
 
virtual ~SVGElement ()=default
 
bool hasAttribute (std::string_view name) const
 
const std::string & getAttribute (std::string_view name) const
 
bool setAttribute (std::string_view name, const std::string &value)
 
const Attribute * findAttribute (PropertyID id) const
 
bool hasAttribute (PropertyID id) const
 
const std::string & getAttribute (PropertyID id) const
 
bool setAttribute (int specificity, PropertyID id, const std::string &value)
 
void setAttributes (const AttributeList &attributes)
 
bool setAttribute (const Attribute &attribute)
 
virtual void parseAttribute (PropertyID id, const std::string &value)
 
SVGElement * previousElement () const
 
SVGElement * nextElement () const
 
SVGNode * addChild (std::unique_ptr< SVGNode > child)
 
SVGNode * firstChild () const
 
SVGNode * lastChild () const
 
ElementID id () const
 
const AttributeList & attributes () const
 
const SVGPropertyList & properties () const
 
const SVGNodeList & children () const
 
virtual Rect paintBoundingBox () const
 
SVGMarkerElement * getMarker (std::string_view id) const
 
SVGClipPathElement * getClipper (std::string_view id) const
 
SVGMaskElement * getMasker (std::string_view id) const
 
SVGFilterElement * getFilterElement (std::string_view id) const
 
SVGPaintElement * getPainter (std::string_view id) const
 
SVGElement * elementFromPoint (float x, float y)
 
template<typename T >
void transverse (T callback)
 
void addProperty (SVGProperty &value)
 
SVGProperty * getProperty (PropertyID id) const
 
Size currentViewportSize () const
 
float font_size () const
 
void cloneChildren (SVGElement *parentElement) const
 
std::unique_ptr< SVGNode > clone (bool deep) const final
 
virtual void build ()
 
void layoutChildren (SVGLayoutState &state)
 
virtual void layout (SVGLayoutState &state)
 
void renderChildren (SVGRenderState &state) const
 
virtual std::shared_ptr< Canvas > applyFilterPrimitive (SVGFilterContext &context) const
 
bool isDisplayNone () const
 
bool isOverflowHidden () const
 
bool isVisibilityHidden () const
 
bool isHiddenElement () const
 
bool isPointableElement () const
 
const SVGClipPathElement * clipper () const
 
const SVGMaskElement * masker () const
 
const SVGFilterElement * filterElement () const
 
float opacity () const
 
MixBlendMode mixBlendMode () const
 
bool isElement () const final
 
- Public Member Functions inherited from novasvg::SVGNode
 SVGNode (Document *document)
 
virtual ~SVGNode ()=default
 
virtual bool isTextNode () const
 
virtual bool isPaintElement () const
 
virtual bool isGeometryElement () const
 
virtual bool isTextPositioningElement () const
 
Document * document () const
 
SVGRootElement * rootElement () const
 
SVGElement * parentElement () const
 
void setParentElement (SVGElement *parent)
 
bool isRootElement () const
 

Additional Inherited Members

- Static Public Member Functions inherited from novasvg::SVGElement
static std::unique_ptr< SVGElement > create (Document *document, ElementID id)
 

Detailed Description

Definition at line 1179 of file svgelement.h.

Constructor & Destructor Documentation

◆ SVGForeignObjectElement()

NOVASVG_INLINE novasvg::SVGForeignObjectElement::SVGForeignObjectElement ( Document *  document)

Definition at line 6042 of file svgelement.h.

References novasvg::SVGElement::addProperty().

Member Function Documentation

◆ baseFontStyle()

unsigned char novasvg::SVGForeignObjectElement::baseFontStyle ( ) const
inline

Bold/italic bits (ForeignObjectFonts::Bold/Italic) the element itself inherits, i.e. the style of font().

Definition at line 1191 of file svgelement.h.

Referenced by novasvg::ForeignObjectSimple::render().

◆ fill()

const SVGPaintServer & novasvg::SVGForeignObjectElement::fill ( ) const
inline

Definition at line 1188 of file svgelement.h.

◆ fillBoundingBox()

NOVASVG_INLINE Rect novasvg::SVGForeignObjectElement::fillBoundingBox ( ) const
finalvirtual

Reimplemented from novasvg::SVGElement.

Definition at line 6055 of file svgelement.h.

References width().

Referenced by novasvg::ForeignObjectSimple::render(), and strokeBoundingBox().

◆ font()

const Font & novasvg::SVGForeignObjectElement::font ( ) const
inline

Definition at line 1187 of file svgelement.h.

Referenced by novasvg::ForeignObjectSimple::render().

◆ fontsFor()

NOVASVG_INLINE ForeignObjectFonts novasvg::SVGForeignObjectElement::fontsFor ( unsigned  usedStyles) const

font() plus the variants named by usedStyles (a bit mask: bit n set = style n is needed). Nothing is looked up for styles that are not in the mask, so unstyled text costs nothing extra.

Definition at line 6071 of file svgelement.h.

References novasvg::ForeignObjectFonts::Bold, novasvg::ForeignObjectFonts::Italic, novasvg::makeFont(), novasvg::Font::size(), style, and width().

Referenced by novasvg::ForeignObjectSimple::render().

◆ height()

const SVGLength & novasvg::SVGForeignObjectElement::height ( ) const
inline

Definition at line 1186 of file svgelement.h.

◆ htmlBackgroundColor()

const std::optional< Color > & novasvg::SVGForeignObjectElement::htmlBackgroundColor ( ) const
inline

Definition at line 1214 of file svgelement.h.

Referenced by novasvg::ForeignObjectSimple::render().

◆ htmlTextColor()

const std::optional< Color > & novasvg::SVGForeignObjectElement::htmlTextColor ( ) const
inline

The text colour and the box colour the document's CSS gives this element's HTML, worked out when a stylesheet is applied (see resolveForeignObjectStyle()). Unset = nothing in the CSS asked for one (text is then black, and no box is painted).

Definition at line 1213 of file svgelement.h.

Referenced by novasvg::ForeignObjectSimple::render().

◆ layoutElement()

◆ rawContent()

const std::string & novasvg::SVGForeignObjectElement::rawContent ( ) const
inline

Raw markup captured between <foreignObject ...> and </foreignObject> (whatever HTML/XML the document embedded there), exactly as it appeared in the source – untouched, unparsed. What a ForeignObjectRenderer does with it is entirely up to that renderer.

Definition at line 1202 of file svgelement.h.

Referenced by novasvg::ForeignObjectSimple::render().

◆ render()

◆ renderer()

ForeignObjectRenderer * novasvg::SVGForeignObjectElement::renderer ( ) const
inline

Definition at line 1205 of file svgelement.h.

Referenced by render().

◆ setHtmlStyle()

void novasvg::SVGForeignObjectElement::setHtmlStyle ( std::optional< Color >  text,
std::optional< Color >  background 
)
inline

Definition at line 1215 of file svgelement.h.

References text.

◆ setRawContent()

void novasvg::SVGForeignObjectElement::setRawContent ( std::string  content)
inline

Definition at line 1203 of file svgelement.h.

◆ setRenderer()

void novasvg::SVGForeignObjectElement::setRenderer ( ForeignObjectRenderer *  renderer)
inline

Definition at line 1206 of file svgelement.h.

◆ strokeBoundingBox()

NOVASVG_INLINE Rect novasvg::SVGForeignObjectElement::strokeBoundingBox ( ) const
finalvirtual

Reimplemented from novasvg::SVGElement.

Definition at line 6066 of file svgelement.h.

References fillBoundingBox().

◆ width()

const SVGLength & novasvg::SVGForeignObjectElement::width ( ) const
inline

Definition at line 1185 of file svgelement.h.

Referenced by fillBoundingBox(), fontsFor(), layoutElement(), and render().

◆ x()

const SVGLength & novasvg::SVGForeignObjectElement::x ( ) const
inline

Definition at line 1183 of file svgelement.h.

◆ y()

const SVGLength & novasvg::SVGForeignObjectElement::y ( ) const
inline

Definition at line 1184 of file svgelement.h.


The documentation for this class was generated from the following file: