#ifndef PQBRUSH_H
#define PQBRUSH_H

#include <QBrush>
#include <pqobject.h>
#include "pqpixmap.h"
#include "pqimage.h"

class PQBrush;
class PQBrush : public PQObject, public QBrush
{
    Q_OBJECT
    PQ_OBJECT_EX(QBrush)

    Q_PROPERTY(QString color READ color WRITE setColor)
    Q_PROPERTY(int style READ style WRITE setStyle)
    Q_PROPERTY(PQObject* texture READ texture WRITE setTexture)
    Q_PROPERTY(PQObject* textureImage READ textureImage WRITE setTextureImage)

public:
    Q_INVOKABLE explicit PQBrush();

    Q_INVOKABLE explicit PQBrush(int style);
    Q_INVOKABLE explicit PQBrush(const QString &color, int style = Qt::SolidPattern);
    Q_INVOKABLE explicit PQBrush(int color, int style);
    Q_INVOKABLE explicit PQBrush(PQObject *pqobject);
    explicit PQBrush(const QBrush &brush);
    ~PQBrush();

    Q_INVOKABLE QString color() const;
    Q_INVOKABLE int style() const;
    Q_INVOKABLE PQPixmap *texture();
    Q_INVOKABLE PQImage *textureImage();

public slots:
    Q_INVOKABLE void setColor(const QString &color);
    Q_INVOKABLE void setStyle(int style);
    Q_INVOKABLE void setTexture(PQObject* texture);
    Q_INVOKABLE void setTextureImage(PQObject* textureImage);
};

Q_DECLARE_METATYPE(QBrush*)
Q_DECLARE_METATYPE(PQBrush*)

#endif // PQBRUSH_H
