/* ============================================================================== This file is part of the JUCE 6 technical preview. Copyright (c) 2020 - Raw Material Software Limited You may use this code under the terms of the GPL v3 (see www.gnu.org/licenses). For this technical preview, this file is not subject to commercial licensing. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE DISCLAIMED. ============================================================================== */ #pragma once #include "../jucer_PaintRoutine.h" #include "../jucer_JucerDocument.h" #include "jucer_StrokeType.h" //============================================================================== /** Base class for paint elements that have a fill colour and stroke. */ class ColouredElement : public PaintElement { public: ColouredElement (PaintRoutine* owner, const String& name, const bool showOutline_, const bool showJointAndEnd_); ~ColouredElement() override; //============================================================================== void getEditableProperties (Array& props, bool multipleSelected) override; void getColourSpecificProperties (Array& props); //============================================================================== const JucerFillType& getFillType() noexcept; void setFillType (const JucerFillType& newType, const bool undoable); bool isStrokeEnabled() const noexcept; void enableStroke (bool enable, const bool undoable); const StrokeType& getStrokeType() noexcept; void setStrokeType (const PathStrokeType& newType, const bool undoable); void setStrokeFill (const JucerFillType& newType, const bool undoable); //============================================================================== Rectangle getCurrentBounds (const Rectangle& parentArea) const override; void setCurrentBounds (const Rectangle& newBounds, const Rectangle& parentArea, const bool undoable) override; void createSiblingComponents() override; //============================================================================== void addColourAttributes (XmlElement* const e) const; bool loadColourAttributes (const XmlElement& xml); protected: JucerFillType fillType; bool isStrokePresent; const bool showOutline, showJointAndEnd; StrokeType strokeType; void convertToNewPathElement (const Path& path); };