#ifndef PQPEN_H
#define PQPEN_H

#include <QPen>
#include <pqobject.h>
#include "pqpixmap.h"
#include "pqbrush.h"

class PQPen;
class PQPen : public PQObject, public QPen
{
    Q_OBJECT
    PQ_OBJECT_EX(QPen)

    Q_PROPERTY(int style READ style WRITE setStyle)
    Q_PROPERTY(double miterLimit READ miterLimit WRITE setMiterLimit)
    Q_PROPERTY(double widthF READ widthF WRITE setWidthF)
    Q_PROPERTY(int width READ width WRITE setWidth)
    Q_PROPERTY(QString color READ color WRITE setColor)
    Q_PROPERTY(PQObject* brush READ brush WRITE setBrush)
    Q_PROPERTY(int capStyle READ capStyle WRITE setCapStyle)
    Q_PROPERTY(int joinStyle READ joinStyle WRITE setJoinStyle)
    Q_PROPERTY(int cosmetic READ isCosmetic WRITE setCosmetic)

public:
    Q_INVOKABLE explicit PQPen();
    Q_INVOKABLE explicit PQPen(int style);
    Q_INVOKABLE explicit PQPen(const QString &color);
    Q_INVOKABLE explicit PQPen(PQObject *brush,
                               double width,
                               int s = Qt::SolidLine,
                               int c = Qt::SquareCap,
                               int j = Qt::BevelJoin);
    explicit PQPen(const QPen &pen);

    ~PQPen();

    Q_INVOKABLE int style() const;
    Q_INVOKABLE void setStyle(int style);

    Q_INVOKABLE double miterLimit() const;
    Q_INVOKABLE void setMiterLimit(double limit);

    Q_INVOKABLE double widthF() const;
    Q_INVOKABLE void setWidthF(double width);

    Q_INVOKABLE int width() const;
    Q_INVOKABLE void setWidth(int width);

    Q_INVOKABLE QString color() const;
    Q_INVOKABLE void setColor(const QString &color);

    Q_INVOKABLE PQBrush *brush() const;
    Q_INVOKABLE void setBrush(PQObject *brush);

    Q_INVOKABLE bool isSolid() const;

    Q_INVOKABLE int capStyle() const;
    Q_INVOKABLE void setCapStyle(int pcs);

    Q_INVOKABLE int joinStyle() const;
    Q_INVOKABLE void setJoinStyle(int pcs);

    Q_INVOKABLE bool isCosmetic() const;
    Q_INVOKABLE void setCosmetic(bool cosmetic);
};

Q_DECLARE_METATYPE(QPen*)
Q_DECLARE_METATYPE(PQPen*)

#endif // PQPEN_H
