class CCL::ItemModelPainter

#include <itemviewmodel.h>

class ItemModelPainter
{
public:
    // typedefs

    typedef const IItemModel::DrawInfo& DrawInfoRef;

    // fields

    static constexpr const int kDefaultTextTrimMode = Font::kTrimModeRight;

    // methods

    void drawIcon (
        DrawInfoRef info,
        IImage* icon,
        bool enabled = true,
        bool fitImage = true,
        int margin = 0
    );

    void drawIconWithOverlay (
        DrawInfoRef info,
        IImage* icon,
        IImage* overlay = nullptr,
        bool enabled = true,
        bool fitImage = true,
        int margin = 0
    );

    void drawOverlay (DrawInfoRef info, RectRef iconRect, IImage* overlay);

    void drawButtonImage (
        DrawInfoRef info,
        IImage* image,
        bool pressed,
        bool enabled = true
    );

    void calcCheckBoxRect (
        Rect& checkRect,
        DrawInfoRef info,
        AlignmentRef alignment = Alignment::kHCenter
    );

    void drawCheckBox (
        DrawInfoRef info,
        bool checked,
        bool enabled = true,
        AlignmentRef alignment = Alignment::kHCenter
    );

    void calcButtonRect (
        Rect& buttonRect,
        DrawInfoRef info,
        StringRef title,
        Coord verticalMargin = 0
    );

    void drawButton (
        DrawInfoRef info,
        StringRef title,
        bool enabled = true,
        Coord verticalMargin = 0
    );

    void drawSelectBoxArrow (DrawInfoRef info, bool enabled = true, int margin = 0);
    SolidBrush getTextBrush (DrawInfoRef info, bool enabled);

    void drawTitle (
        DrawInfoRef info,
        StringRef title,
        bool enabled = true,
        int fontStyle = 0,
        AlignmentRef alignment = Alignment::kLeft|Alignment::kVCenter,
        int trimMode = kDefaultTextTrimMode
    );

    void drawText (
        DrawInfoRef info,
        StringRef text,
        AlignmentRef alignment = Alignment::kCenter,
        bool enabled = true,
        int fontStyle = 0,
        Coord margin = 0
    );

    void calcTitleRects (
        Rect& titleRect,
        Rect& subTitleRect,
        DrawInfoRef info,
        Coord spacing
    );

    void drawTitleWithSubtitle (
        DrawInfoRef info,
        StringRef title,
        StringRef subTitle,
        bool enabled = true,
        int fontStyle = 0,
        Coord lineSpacing = 4,
        int trimMode = kDefaultTextTrimMode
    );

    void drawVerticalBar (
        IGraphics& graphics,
        RectRef rect,
        float value,
        Color backColor,
        Color hiliteColor,
        Coord margin = 1
    );

    void drawHorizontalBar (
        IGraphics& graphics,
        RectRef rect,
        float value,
        Color backColor,
        Color hiliteColor,
        Coord margin = 1
    );
};