class EE::UI::CSS::StyleSheetProperty¶
Overview¶
#include <stylesheetproperty.hpp> class StyleSheetProperty { public: // construction StyleSheetProperty(); StyleSheetProperty(const PropertyDefinition* definition, const std::string& value, const Uint32& index = 0, bool trimValue = true, bool cachedProperty = false); StyleSheetProperty(const std::string& name, const std::string& value, bool trimValue = true, const Int64& specificity = 0, const Uint32& index = 0); StyleSheetProperty(const std::string& name, const std::string& value, const Int64& specificity, bool isVolatile = false, const Uint32& index = 0); // methods Uint32 getId() const; PropertyId getPropertyId() const; ShorthandId getShorthandId() const; const std::string& getName() const; const String::HashType& getNameHash() const; const std::string& getValue() const; const std::string& value() const; const Int64& getSpecificity() const; void setSpecificity(const Int64& specificity); bool isEmpty() const; void setName(const std::string& name); void setValue(const std::string& value, bool updateHash = false); bool isVolatile() const; void setVolatile(bool isVolatile); bool operator==(const StyleSheetProperty& property) const; bool operator!=(const StyleSheetProperty& property) const; std::string asString(const std::string& defaultValue = "") const; template <typename Type> Type asType(Type defaultValue) const; int asInt(int defaultValue = 0) const; unsigned int asUint(unsigned int defaultValue = 0) const; double asDouble(double defaultValue = 0) const; float asFloat(float defaultValue = 0) const; long long asLlong(long long defaultValue = 0) const; unsigned long long asUllong(unsigned long long defaultValue = 0) const; bool asBool(bool defaultValue = false) const; Color asColor() const; Float asDpDimension(const std::string& defaultValue = "") const; int asDpDimensionI(const std::string& defaultValue = "") const; Uint32 asDpDimensionUint(const std::string& defaultValue = "") const; OriginPoint asOriginPoint() const; BlendMode asBlendMode() const; Vector2f asDpDimensionVector2f(const Vector2f& defaultValue = Vector2f::Zero) const; Vector2i asDpDimensionVector2i(const Vector2i& defaultValue = Vector2i::Zero) const; Vector2f asDpDimensionSizef(const Sizef& defaultValue = Sizef::Zero) const; Vector2i asDpDimensionSizei(const Sizei& defaultValue = Sizei::Zero) const; Vector2f asVector2f(const Vector2f& defaultValue = Vector2f::Zero) const; Vector2i asVector2i(const Vector2i& defaultValue = Vector2i::Zero) const; Sizef asSizef(const Sizef& defaultValue = Sizef::Zero) const; Sizei asSizei(const Sizei& defaultValue = Sizei::Zero) const; Rect asRect(const Rect& defaultValue = Rect()) const; Rectf asRectf(const Rectf& defaultValue = Rectf::Zero) const; Uint32 asTextDecoration() const; Uint32 asFontStyle() const; Time asTime(const Time& defaultTime = Seconds(0)); Ease::Interpolation asInterpolation(const Ease::Interpolation& defaultInterpolation = Ease::Linear); const PropertyDefinition* getPropertyDefinition() const; const ShorthandDefinition* getShorthandDefinition() const; bool isVarValue() const; bool isLightDarkValue() const; bool needsValueSubstitution() const; size_t getPropertyIndexCount() const; const StyleSheetProperty& getPropertyIndex(const Uint32& index) const; StyleSheetProperty* getPropertyIndexRef(const Uint32& index); const Uint32& getIndex() const; Float asDpDimension(UINode* node, const std::string& defaultValue = "") const; int asDpDimensionI(UINode* node, const std::string& defaultValue = "") const; Uint32 asDpDimensionUint(UINode* node, const std::string& defaultValue = "") const; Vector2f asDpDimensionVector2f(UINode* node, const Vector2f& defaultValue = Vector2f::Zero) const; Vector2i asDpDimensionVector2i(UINode* node, const Vector2i& defaultValue = Vector2i::Zero) const; Vector2f asDpDimensionSizef(UINode* node, const Sizef& defaultValue = Sizef::Zero) const; Vector2i asDpDimensionSizei(UINode* node, const Sizei& defaultValue = Sizei::Zero) const; Vector2f asVector2f(UINode* node, const Vector2f& defaultValue = Vector2f::Zero) const; Vector2i asVector2i(UINode* node, const Vector2i& defaultValue = Vector2i::Zero) const; Sizef asSizef(UINode* node, const Sizef& defaultValue = Sizef::Zero) const; Sizei asSizei(UINode* node, const Sizei& defaultValue = Sizei::Zero) const; StyleSheetLength asStyleSheetLength() const; const String::HashType& getValueHash() const; std::span<const VariableFunctionCache> getVarCache() const; StyleSheetProperty& setCachedProperty(bool cached); bool isCachedProperty() const; void setImportant(bool important); };
Detailed Documentation¶
Methods¶
Uint32 getId() const
Returns the stable name hash used as the key in StyleSheetProperties maps.
This is not a dense PropertyId or ShorthandId. Unknown and data-* properties also return their own name hash here.
PropertyId getPropertyId() const
Returns the dense longhand identity, or PropertyId::Invalid.
ShorthandId getShorthandId() const
Returns the dense shorthand identity, or ShorthandId::Invalid.
const String::HashType& getNameHash() const
Returns the stable hash of getName(); this is not a dense ID.