// qquickpainteditem.sip generated by MetaSIP
//
// This file is part of the QtQuick Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt6.
// 
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file.  Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
// 
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license.  For more information contact
// info@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


class QQuickPaintedItem : public QQuickItem /ExportDerived/
{
%TypeHeaderCode
#include <qquickpainteditem.h>
%End

public:
    explicit QQuickPaintedItem(QQuickItem *parent /TransferThis/ = 0);
    virtual ~QQuickPaintedItem();

    enum RenderTarget
    {
        Image,
        FramebufferObject,
        InvertedYFramebufferObject,
    };

    enum PerformanceHint /BaseType=Flag/
    {
        FastFBOResizing,
    };

    typedef QFlags<QQuickPaintedItem::PerformanceHint> PerformanceHints;
    void update(const QRect &rect = QRect());
    bool opaquePainting() const;
    void setOpaquePainting(bool opaque);
    bool antialiasing() const;
    void setAntialiasing(bool enable);
    bool mipmap() const;
    void setMipmap(bool enable);
    QQuickPaintedItem::PerformanceHints performanceHints() const;
    void setPerformanceHint(QQuickPaintedItem::PerformanceHint hint, bool enabled = true);
    void setPerformanceHints(QQuickPaintedItem::PerformanceHints hints);
    QRectF contentsBoundingRect() const;
    QSize contentsSize() const;
    void setContentsSize(const QSize &);
    void resetContentsSize();
    qreal contentsScale() const;
    void setContentsScale(qreal);
    QColor fillColor() const;
    void setFillColor(const QColor &);
    QQuickPaintedItem::RenderTarget renderTarget() const;
    void setRenderTarget(QQuickPaintedItem::RenderTarget target);
    virtual void paint(QPainter *painter) = 0;

signals:
    void fillColorChanged();
    void contentsSizeChanged();
    void contentsScaleChanged();
    void renderTargetChanged();

protected:
    virtual QSGNode *updatePaintNode(QSGNode *, QQuickItem::UpdatePaintNodeData *);

public:
    virtual bool isTextureProvider() const;
    virtual QSGTextureProvider *textureProvider() const;

protected:
    virtual void releaseResources();
    virtual void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &);

public:
    QSize textureSize() const;
    void setTextureSize(const QSize &size);

signals:
    void textureSizeChanged();
};
