Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
SPIEnum< T > Class Template Reference

Enum type internal to SPStyle. More...

#include <style-internal.h>

Inheritance diagram for SPIEnum< T >:
SPIBase SPIEnumBits

Public Member Functions

 SPIEnum (T value=T(), bool inherits=true)
 
 ~SPIEnum () override=default
 
void read (gchar const *str) override
 
const Glib::ustring get_value () const override
 
void clear () override
 
void cascade (const SPIBase *const parent) override
 
void merge (const SPIBase *const parent) override
 
SPIEnumoperator= (const SPIEnum &rhs)
 
bool equals (const SPIBase &rhs) const override
 
- 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
 

Public Attributes

value {}
 
computed {}
 
- Public Attributes inherited from SPIBase
bool inherits: 1
 
bool set: 1
 
bool inherit: 1
 
bool important: 1
 
SPStyleSrc style_src
 

Private Member Functions

void update_computed ()
 Update computed from value.
 
void update_computed_cascade (T const &parent_computed)
 Update computed from parent computed.
 
void update_value_merge (SPIEnum< T > const &)
 Update value from parent.
 
void update_value_merge (SPIEnum< T > const &, T, T)
 

Private Attributes

value_default {}
 

Additional Inherited Members

- Protected Member Functions inherited from SPIBase
char const * important_str () const
 
- Protected Attributes inherited from SPIBase
SPStylestyle
 

Detailed Description

template<typename T>
class SPIEnum< T >

Enum type internal to SPStyle.

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

Constructor & Destructor Documentation

◆ SPIEnum()

template<typename T >
SPIEnum< T >::SPIEnum ( value = T(),
bool  inherits = true 
)
inline

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

References SPIEnum< T >::update_computed().

◆ ~SPIEnum()

template<typename T >
SPIEnum< T >::~SPIEnum ( )
overridedefault

Member Function Documentation

◆ cascade()

template<typename T >
void SPIEnum< T >::cascade ( const SPIBase *const  parent)
overridevirtual

Implements SPIBase.

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

References parent, and set.

◆ clear()

template<typename T >
void SPIEnum< T >::clear ( )
inlineoverridevirtual

◆ equals()

template<typename T >
bool SPIEnum< T >::equals ( const SPIBase rhs) const
overridevirtual

Reimplemented from SPIBase.

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

References SPIBase::equals().

◆ get_value()

template<typename T >
const Glib::ustring SPIEnum< T >::get_value ( ) const
overridevirtual

Implements SPIBase.

Reimplemented in SPIEnumBits, SPILigatures, and SPINumeric.

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

References key.

◆ merge()

template<typename T >
void SPIEnum< T >::merge ( const SPIBase *const  parent)
overridevirtual

Implements SPIBase.

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

References parent, and set.

◆ operator=()

template<typename T >
SPIEnum & SPIEnum< T >::operator= ( const SPIEnum< T > &  rhs)
inline

◆ read()

template<typename T >
void SPIEnum< T >::read ( gchar const *  str)
overridevirtual

Implements SPIBase.

Reimplemented in SPIEnumBits, SPILigatures, and SPINumeric.

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

References key, and set.

◆ update_computed()

template<typename T >
void SPIEnum< T >::update_computed ( )
private

Update computed from value.

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

Referenced by SPIEnum< T >::clear(), and SPIEnum< T >::SPIEnum().

◆ update_computed_cascade()

template<typename T >
void SPIEnum< T >::update_computed_cascade ( T const &  parent_computed)
inlineprivate

Update computed from parent computed.

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

◆ update_value_merge() [1/2]

template<typename T >
void SPIEnum< T >::update_value_merge ( SPIEnum< T > const &  )
inlineprivate

Update value from parent.

Precondition
computed is up to date

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

◆ update_value_merge() [2/2]

template<typename T >
void SPIEnum< T >::update_value_merge ( SPIEnum< T > const &  p,
smaller,
larger 
)
private

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

References set, and SPIEnum< T >::value.

Member Data Documentation

◆ computed

template<typename T >
T SPIEnum< T >::computed {}

◆ value

◆ value_default

template<typename T >
T SPIEnum< T >::value_default {}
private

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

Referenced by SPIEnum< T >::clear(), and SPIEnum< T >::operator=().


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