// qpen.sip generated by MetaSIP on Thu Sep 11 18:50:32 2014
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt.
// 
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file.  Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
// 
// If you are unsure which license is appropriate for your use, please
// contact the sales department at sales@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.


%ModuleCode
#include <qpen.h>
%End

class QPen
{
%TypeHeaderCode
#include <qpen.h>
%End

%ConvertToTypeCode
// SIP doesn't support automatic type convertors so we explicitly allow a
// QColor to be used whenever a QPen is expected.

if (sipIsErr == NULL)
    return (sipCanConvertToType(sipPy, sipType_QPen, SIP_NO_CONVERTORS) ||
            sipCanConvertToType(sipPy, sipType_QColor, 0));

if (sipCanConvertToType(sipPy, sipType_QPen, SIP_NO_CONVERTORS))
{
    *sipCppPtr = reinterpret_cast<QPen *>(sipConvertToType(sipPy, sipType_QPen, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

    return 0;
}

int state;
QColor *c = reinterpret_cast<QColor *>(sipConvertToType(sipPy, sipType_QColor, 0, 0, &state, sipIsErr));

if (*sipIsErr)
{
    sipReleaseType(c, sipType_QColor, state);
    return 0;
}

*sipCppPtr = new QPen(*c);

sipReleaseType(c, sipType_QColor, state);

return sipGetState(sipTransferObj);
%End

public:
    QPen();
    QPen(Qt::PenStyle);
    QPen(const QColor &color);
    QPen(const QBrush &brush, qreal width, Qt::PenStyle style = Qt::SolidLine, Qt::PenCapStyle cap = Qt::SquareCap, Qt::PenJoinStyle join = Qt::BevelJoin);
    QPen(const QPen &pen);
    QPen(const QVariant &variant) /NoDerived/;
%MethodCode
        #if QT_VERSION >= 0x050000
        sipCpp = new QPen(a0->value<QPen>());
        #else
        sipCpp = new QPen(qVariantValue<QPen>(*a0));
        #endif
%End

    ~QPen();
    Qt::PenStyle style() const;
    void setStyle(Qt::PenStyle);
    qreal widthF() const;
    void setWidthF(qreal width);
    int width() const;
    void setWidth(int width);
    QColor color() const;
    void setColor(const QColor &color);
    QBrush brush() const;
    void setBrush(const QBrush &brush);
    bool isSolid() const;
    Qt::PenCapStyle capStyle() const;
    void setCapStyle(Qt::PenCapStyle pcs);
    Qt::PenJoinStyle joinStyle() const;
    void setJoinStyle(Qt::PenJoinStyle pcs);
    QVector<qreal> dashPattern() const;
    void setDashPattern(const QVector<qreal> &pattern);
    qreal miterLimit() const;
    void setMiterLimit(qreal limit);
    bool operator==(const QPen &p) const;
    bool operator!=(const QPen &p) const;
%If (Qt_4_3_0 -)
    qreal dashOffset() const;
%End
%If (Qt_4_3_0 -)
    void setDashOffset(qreal doffset);
%End
%If (Qt_4_3_0 -)
    bool isCosmetic() const;
%End
%If (Qt_4_3_0 -)
    void setCosmetic(bool cosmetic);
%End
%If (Qt_4_8_0 -)
    void swap(QPen &other);
%End
};

QDataStream &operator<<(QDataStream &, const QPen & /Constrained/);
QDataStream &operator>>(QDataStream &, QPen & /Constrained/);
%If (Qt_4_3_0 -)
void qSwap(QPen &value1, QPen &value2);
%End
