class EE::UI::UIStyle

Overview

#include <uistyle.hpp>

class UIStyle: public EE::UI::UIState {
public:
    // structs

    struct PropertyFallback;

    // classes

    class PropertyResolution;

    // construction

    UIStyle(const UIStyle&);
    UIStyle(UIStyle&&);
    virtual ~UIStyle();

    // methods

    static UIStyle* New(UIWidget* widget);
    UIStyle& operator=(const UIStyle&);
    UIStyle& operator=(UIStyle&&);
    virtual bool stateExists(const Uint32& state) const;
    void load();
    virtual void onStateChange();
    const StyleSheetProperty* getStatelessStyleSheetProperty(const PropertyId& propertyId) const;
    void setStyleSheetProperties(const StyleSheetProperties& properties);
    void setStyleSheetProperty(const StyleSheetProperty& property);
    void setStyleSheetVariable(const StyleSheetVariable& variable);
    bool hasTransition(const std::string& propertyName);
    StyleSheetPropertyAnimation* getAnimation(const PropertyDefinition* propertyDef);
    bool hasAnimation(const PropertyDefinition* propertyDef);
    TransitionDefinition getTransition(const std::string& propertyName);
    const bool& isChangingState() const;
    StyleSheetVariable getVariable(const std::string& variable);
    Color getColorVariable(const std::string& variable, Color fallback);
    bool getForceReapplyProperties() const;
    void setForceReapplyProperties(bool forceReapplyProperties);
    bool getDisableAnimations() const;
    void setDisableAnimations(bool disableAnimations);
    bool isStructurallyVolatile() const;
    void reloadFontFamily();
    void addStructurallyVolatileChild(UIWidget* widget);
    void removeStructurallyVolatileChild(UIWidget* widget);
    UnorderedSet<UIWidget*>& getStructurallyVolatileChildren();
    const StyleSheetProperty* getProperty(const PropertyId& id) const;
    bool hasProperty(const PropertyId& propertyId) const;
    bool hasLocalProperty(PropertyId propId) const;
    StyleSheetProperty* getInheritedProperty(PropertyId propId, UIStyle** ownerStyle = nullptr) const;
    void resetGlobalDefinition(bool force = false);
    void resetCachedProperties();
    void applyInheritedProperties();
    const std::shared_ptr<ElementDefinition> getDefinition() const;
    void applyVarValues(StyleSheetProperty* style);
    const StyleSheetProperty* getCascadedProperty(PropertyId propId);
    bool declarationWins(const StyleSheetProperty& candidate, const StyleSheetProperty& other);
    const UnorderedSet<UIWidget*>& getRelatedWidgets() const;
};

Inherited Members

public:
    // enums

    enum UIStates;
    enum UIStatesFlags;

    // methods

    static const char* getStateName(const Uint32& State);
    static int getStateNumber(const std::string& State);
    static const char* getStateNameFromStateFlag(const Uint32& stateFlag);
    static const Uint32& getStateFlag(const Uint32& stateIndex);
    static Uint32 getStateFlagFromName(const std::string& name);
    static bool isStateName(const std::string& State);
    const Uint32& getState() const;
    void setState(const Uint32& State);
    void pushState(const Uint32& State);
    void popState(const Uint32& State);
    virtual bool stateExists(const Uint32& State) const = 0;
    const Uint32& getCurrentState() const;
    const Uint32& getPreviousState() const;

Detailed Documentation

Methods

Color getColorVariable(const std::string& variable, Color fallback)

Resolve a color variable without copying its stored text.

const StyleSheetProperty* getCascadedProperty(PropertyId propId)

Returns:

The declaration that currently wins the cascade for propId in the widget’s current state (element style or matched rules), without var() substitution.

bool declarationWins(const StyleSheetProperty& candidate, const StyleSheetProperty& other)

Compares declarations of different IDs that map to the same computed edge. Rule order follows stylesheet attachment order; declaration order only breaks ties within a rule.

const UnorderedSet<UIWidget*>& getRelatedWidgets() const

Returns:

Widgets whose styles are refreshed when this widget changes state.