// qcursor.sip generated by MetaSIP
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt4.
// 
// 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.


%ModuleCode
#include <qcursor.h>
%End

class QCursor
{
%TypeHeaderCode
#include <qcursor.h>
%End

%ConvertToTypeCode
// SIP doesn't support automatic type convertors so we explicitly allow a
// Qt::CursorShape to be used whenever a QCursor is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_CursorShape)) ||
            sipCanConvertToType(sipPy, sipType_QCursor, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_CursorShape)))
{
    *sipCppPtr = new QCursor((Qt::CursorShape)SIPLong_AsLong(sipPy));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QCursor *>(sipConvertToType(sipPy, sipType_QCursor, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
%End

public:
    QCursor();
    QCursor(Qt::CursorShape shape);
    QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX = -1, int hotY = -1);
    QCursor(const QPixmap &pixmap, int hotX = -1, int hotY = -1);
    QCursor(const QCursor &cursor);
    QCursor(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
        #if QT_VERSION >= 0x050000
        if (a0->canConvert<QCursor>())
            sipCpp = new QCursor(a0->value<QCursor>());
        #else
        if (qVariantCanConvert<QCursor>(*a0))
            sipCpp = new QCursor(qVariantValue<QCursor>(*a0));
        #endif
        else
            sipError = sipBadCallableArg(0, a0Wrapper);
%End

    ~QCursor();
    Qt::CursorShape shape() const;
    void setShape(Qt::CursorShape newShape);
    const QBitmap *bitmap() const;
    const QBitmap *mask() const;
    QPixmap pixmap() const;
    QPoint hotSpot() const;
    static QPoint pos();
    static void setPos(int x, int y);
    static void setPos(const QPoint &p);
};

QDataStream &operator<<(QDataStream &outS, const QCursor &cursor /Constrained/);
QDataStream &operator>>(QDataStream &inS, QCursor &cursor /Constrained/);
