struct CCL::IVisualStyleData

Overview

Visual style data holds colors, fonts, metrics, etc. More…

#include <ivisualstyle.h>

struct IVisualStyleData: public CCL::IUnknown
{
    // typedefs

    typedef VisualStyleMetric Metric;
    typedef VisualStyleOptions Options;

    // methods

    virtual StringID CCL_API getName () const = 0;
    virtual void CCL_API setName (StringID name) = 0;

    virtual ColorRef CCL_API getColor (
        StringID name,
        ColorRef defaultColor = Colors::kBlack
    ) const = 0;

    virtual tbool CCL_API getColor (Color& color, StringID name) const = 0;
    virtual void CCL_API setColor (StringID name, ColorRef color) = 0;

    virtual FontRef CCL_API getFont (
        StringID name,
        FontRef defaultFont = Font::getDefaultFont ()
    ) const = 0;

    virtual tbool CCL_API getFont (Font& font, StringID name) const = 0;
    virtual void CCL_API setFont (StringID name, FontRef font) = 0;
    virtual Metric CCL_API getMetric (StringID name, Metric defaultValue = 0) const = 0;
    virtual tbool CCL_API getMetric (Metric& value, StringID name) const = 0;
    virtual void CCL_API setMetric (StringID name, Metric value) = 0;

    virtual DesignCoord CCL_API getDesignMetric (
        StringID name,
        DesignCoordRef defaultValue = DesignCoord::kUndefined
    ) const = 0;

    virtual tbool CCL_API getDesignMetric (DesignCoord& value, StringID name) const = 0;
    virtual void CCL_API setDesignMetric (StringID name, DesignCoordRef value) = 0;

    virtual CString CCL_API getString (
        StringID name,
        StringID defaultValue = CString::kEmpty
    ) const = 0;

    virtual tbool CCL_API getString (MutableCString& string, StringID name) const = 0;
    virtual void CCL_API setString (StringID name, StringID value) = 0;
    virtual Options CCL_API getOptions (StringID name, Options defaultOptions = 0) const = 0;
    virtual tbool CCL_API getOptions (Options& options, StringID name) const = 0;
    virtual void CCL_API setOptions (StringID name, Options options) = 0;
    virtual IImage*CCL_API getImage (StringID name) const = 0;
    virtual void CCL_API setImage (StringID name, IImage* image) = 0;
    virtual IGradient*CCL_API getGradient (StringID name) const = 0;
    virtual void CCL_API setGradient (StringID name, IGradient* gradient) = 0;
    virtual tbool CCL_API hasReferences (IColorScheme& scheme) const = 0;
};

Inherited Members

public:
    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;

Detailed Documentation

Visual style data holds colors, fonts, metrics, etc.

Methods

virtual StringID CCL_API getName () const = 0

Get name of style data.

virtual void CCL_API setName (StringID name) = 0

Set name of style data.

virtual ColorRef CCL_API getColor (
    StringID name,
    ColorRef defaultColor = Colors::kBlack
) const = 0

Get color by name, returns default color if not found.

virtual tbool CCL_API getColor (Color& color, StringID name) const = 0

Get color by name, returns false if not found.

virtual void CCL_API setColor (StringID name, ColorRef color) = 0

Set color by name.

virtual FontRef CCL_API getFont (
    StringID name,
    FontRef defaultFont = Font::getDefaultFont ()
) const = 0

Get font by name, returns default font if not found.

virtual tbool CCL_API getFont (Font& font, StringID name) const = 0

Get font by name, returns false if not found.

virtual void CCL_API setFont (StringID name, FontRef font) = 0

Set font by name.

virtual Metric CCL_API getMetric (StringID name, Metric defaultValue = 0) const = 0

Get metric by name (float), returns default value if not found.

virtual tbool CCL_API getMetric (Metric& value, StringID name) const = 0

Get metric by name (float), returns false if not found.

virtual void CCL_API setMetric (StringID name, Metric value) = 0

Set metric by name (float).

virtual DesignCoord CCL_API getDesignMetric (
    StringID name,
    DesignCoordRef defaultValue = DesignCoord::kUndefined
) const = 0

Get metric by name (DesignCoord), returns default value if not found.

virtual tbool CCL_API getDesignMetric (DesignCoord& value, StringID name) const = 0

Get metric by name (DesignCoord), returns false if not found.

virtual void CCL_API setDesignMetric (StringID name, DesignCoordRef value) = 0

Set metric by name (DesignCoord).

virtual CString CCL_API getString (
    StringID name,
    StringID defaultValue = CString::kEmpty
) const = 0

Get string by name, returns default value if not found.

virtual tbool CCL_API getString (MutableCString& string, StringID name) const = 0

Get string by name, returns false if not found.

virtual void CCL_API setString (StringID name, StringID value) = 0

Set string by name.

virtual Options CCL_API getOptions (StringID name, Options defaultOptions = 0) const = 0

Get options by name, returns default value if not found.

virtual tbool CCL_API getOptions (Options& options, StringID name) const = 0

Get options by name, returns false if not found.

virtual void CCL_API setOptions (StringID name, Options options) = 0

Set options by name.

virtual IImage*CCL_API getImage (StringID name) const = 0

Get image by name.

virtual void CCL_API setImage (StringID name, IImage* image) = 0

Set image by name.

virtual IGradient*CCL_API getGradient (StringID name) const = 0

Get gradient by name.

virtual void CCL_API setGradient (StringID name, IGradient* gradient) = 0

Set gradient by name.

virtual tbool CCL_API hasReferences (IColorScheme& scheme) const = 0

Check if style data has references to given color scheme.