Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
SPIString Class Reference

String type internal to SPStyle. More...

#include <style-internal.h>

Inheritance diagram for SPIString:
SPIBase TypedSPI< SPAttr::D, SPIString > TypedSPI< SPAttr::FONT_FAMILY, SPIString > TypedSPI< SPAttr::INKSCAPE_FONT_SPEC, SPIString > TypedSPI< SPAttr::FONT_FEATURE_SETTINGS, SPIString > TypedSPI< SPAttr::MARKER, SPIString > TypedSPI< SPAttr::MARKER_START, SPIString > TypedSPI< SPAttr::MARKER_MID, SPIString > TypedSPI< SPAttr::MARKER_END, SPIString > SPIShapes

Public Member Functions

 SPIString (bool inherits=true)
 
 SPIString (const SPIString &rhs)
 
 ~SPIString () override
 
void read (gchar const *str) override
 
const Glib::ustring get_value () const override
 Value as it should be written to CSS representation, including quotes if needed.
 
void clear () override
 
void cascade (const SPIBase *const parent) override
 
void merge (const SPIBase *const parent) override
 
SPIStringoperator= (const SPIString &rhs)
 
bool equals (const SPIBase &rhs) const override
 
char const * value () const
 Get value if set, or inherited value, or default value (may be NULL)
 
- Public Member Functions inherited from SPIBase
 SPIBase (bool inherits_=true)
 
virtual ~SPIBase ()=default
 
void readIfUnset (gchar const *str, SPStyleSrc source=SPStyleSrc::STYLE_PROP)
 
void readAttribute (Inkscape::XML::Node *repr)
 
bool shall_write (guint const flags=SP_STYLE_FLAG_IFSET, SPStyleSrc const &style_src_req=SPStyleSrc::STYLE_PROP, SPIBase const *const base=nullptr) const
 Check if this property should be written.
 
virtual const Glib::ustring write (guint const flags=SP_STYLE_FLAG_IFSET, SPStyleSrc const &style_src_req=SPStyleSrc::STYLE_PROP, SPIBase const *const base=nullptr) const
 Compile this style conditionally into a 'name: value' string suitable for css attrs.
 
void overwrite (const SPIBase *const other)
 
void setStylePointer (SPStyle *style_in)
 
SPIBaseoperator= (const SPIBase &rhs)=default
 
bool operator== (const SPIBase &rhs) const
 
virtual SPAttr id () const
 
Glib::ustring const & name () const
 

Private Member Functions

char const * get_default_value () const
 

Private Attributes

gchar * _value = nullptr
 

Additional Inherited Members

- Public Attributes inherited from SPIBase
bool inherits: 1
 
bool set: 1
 
bool inherit: 1
 
bool important: 1
 
SPStyleSrc style_src
 
- Protected Member Functions inherited from SPIBase
char const * important_str () const
 
- Protected Attributes inherited from SPIBase
SPStylestyle
 

Detailed Description

String type internal to SPStyle.

Definition at line 614 of file style-internal.h.

Constructor & Destructor Documentation

◆ SPIString() [1/2]

SPIString::SPIString ( bool  inherits = true)
inline

Definition at line 618 of file style-internal.h.

◆ SPIString() [2/2]

SPIString::SPIString ( const SPIString rhs)
inline

Definition at line 622 of file style-internal.h.

◆ ~SPIString()

SPIString::~SPIString ( )
inlineoverride

Definition at line 624 of file style-internal.h.

References _value.

Member Function Documentation

◆ cascade()

void SPIString::cascade ( const SPIBase *const  parent)
overridevirtual

Implements SPIBase.

Definition at line 1324 of file style-internal.cpp.

References _value, SPIBase::inherit, SPIBase::inherits, parent, and SPIBase::set.

◆ clear()

void SPIString::clear ( )
overridevirtual

Reimplemented from SPIBase.

Definition at line 1317 of file style-internal.cpp.

References _value, and SPIBase::clear().

Referenced by read().

◆ equals()

bool SPIString::equals ( const SPIBase rhs) const
overridevirtual

Reimplemented from SPIBase.

Definition at line 1350 of file style-internal.cpp.

References _value, and SPIBase::equals().

◆ get_default_value()

char const * SPIString::get_default_value ( ) const
private

Definition at line 1303 of file style-internal.cpp.

References FONT_FAMILY, and FONT_FEATURE_SETTINGS.

Referenced by read(), and value().

◆ get_value()

const Glib::ustring SPIString::get_value ( ) const
overridevirtual

Value as it should be written to CSS representation, including quotes if needed.

Implements SPIBase.

Definition at line 1279 of file style-internal.cpp.

References css_font_family_quote(), css_quote(), FONT_FAMILY, SPIBase::inherit, INKSCAPE_FONT_SPEC, SPIBase::set, and value().

◆ merge()

void SPIString::merge ( const SPIBase *const  parent)
overridevirtual

Implements SPIBase.

Definition at line 1336 of file style-internal.cpp.

References _value, SPIBase::inherit, SPIBase::inherits, parent, and SPIBase::set.

◆ operator=()

SPIString & SPIString::operator= ( const SPIString rhs)
inline

Definition at line 634 of file style-internal.h.

References _value, and SPIBase::operator=().

◆ read()

void SPIString::read ( gchar const *  str)
overridevirtual

◆ value()

char const * SPIString::value ( ) const

Get value if set, or inherited value, or default value (may be NULL)

Definition at line 1298 of file style-internal.cpp.

References _value, and get_default_value().

Referenced by SPShape::build(), find_references(), get_value(), SPShape::show(), sp_get_same_style(), SPShape::update(), and Inkscape::UI::Widget::StrokeStyle::updateAllMarkers().

Member Data Documentation

◆ _value

gchar* SPIString::_value = nullptr
private

Definition at line 652 of file style-internal.h.

Referenced by cascade(), clear(), equals(), merge(), operator=(), read(), value(), and ~SPIString().


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