#include <qfont.h>

static PyQt_Enum pyqt_qfont_CharSet[] = {
    { (int)QFont::ISO_8859_1, "ISO_8859_1" },
    { (int)QFont::Latin1, "Latin1" },
    { (int)QFont::AnyCharSet, "AnyCharSet" },
    { (int)QFont::ISO_8859_2, "ISO_8859_2" },
    { (int)QFont::Latin2, "Latin2" },
    { (int)QFont::ISO_8859_3, "ISO_8859_3" },
    { (int)QFont::Latin3, "Latin3" },
    { (int)QFont::ISO_8859_4, "ISO_8859_4" },
    { (int)QFont::Latin4, "Latin4" },
    { (int)QFont::ISO_8859_5, "ISO_8859_5" },
    { (int)QFont::ISO_8859_6, "ISO_8859_6" },
    { (int)QFont::ISO_8859_7, "ISO_8859_7" },
    { (int)QFont::ISO_8859_8, "ISO_8859_8" },
    { (int)QFont::ISO_8859_9, "ISO_8859_9" },
    { (int)QFont::Latin5, "Latin5" },
    { (int)QFont::ISO_8859_10, "ISO_8859_10" },
    { (int)QFont::Latin6, "Latin6" },
    { (int)QFont::ISO_8859_11, "ISO_8859_11" },
    { (int)QFont::ISO_8859_12, "ISO_8859_12" },
    { (int)QFont::ISO_8859_13, "ISO_8859_13" },
    { (int)QFont::Latin7, "Latin7" },
    { (int)QFont::ISO_8859_14, "ISO_8859_14" },
    { (int)QFont::Latin8, "Latin8" },
    { (int)QFont::ISO_8859_15, "ISO_8859_15" },
    { (int)QFont::Latin9, "Latin9" },
    { (int)QFont::KOI8R, "KOI8R" },
    { (int)QFont::Set_Ja, "Set_Ja" },
    { (int)QFont::Set_1, "Set_1" },
    { (int)QFont::Set_Ko, "Set_Ko" },
    { (int)QFont::Set_Th_TH, "Set_Th_TH" },
    { (int)QFont::Set_Zh, "Set_Zh" },
    { (int)QFont::Set_Zh_TW, "Set_Zh_TW" },
    { (int)QFont::Set_N, "Set_N" },
    { (int)QFont::Unicode, "Unicode" },
    { (int)QFont::Set_GBK, "Set_GBK" },
    { (int)QFont::Set_Big5, "Set_Big5" },
    { 0, 0 }
};

static PyQt_Enum pyqt_qfont_Weight[] = {
    { (int)QFont::Light, "Light" },
    { (int)QFont::Normal, "Normal" },
    { (int)QFont::DemiBold, "DemiBold" },
    { (int)QFont::Bold, "Bold" },
    { (int)QFont::Black, "Black" },
    { 0, 0 }
};

static PyQt_Enum pyqt_qfont_StyleHint[] = {
    { (int)QFont::Helvetica, "Helvetica" },
    { (int)QFont::Times, "Times" },
    { (int)QFont::Courier, "Courier" },
    { (int)QFont::OldEnglish, "OldEnglish" },
    { (int)QFont::System, "System" },
    { (int)QFont::AnyStyle, "AnyStyle" },
    { (int)QFont::SansSerif, "SansSerif" },
    { (int)QFont::Serif, "Serif" },
    { (int)QFont::TypeWriter, "TypeWriter" },
    { (int)QFont::Decorative, "Decorative" },
    { 0, 0 }
};


static void pyqt_qfont_free( void* ptr )
{
    delete (QFont*)ptr;
}

static QFont* pyqt_qfont_toCpp( PyObject* obj )
{
    return (QFont*)getPointer( obj, Font );
}

static PyObject* pyqt_qfont_toPython( const QFont& ptr )
{
    return qobjectToPython( new QFont( ptr ), Font );
}

static PyObject* pyqt_qfont_rawName( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("s", ((QFont*)ptr)->rawName().latin1() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_styleHint( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return enumToPython( pyqt_qfont_StyleHint, (int)((QFont*)ptr)->styleHint() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_removeSubstitution( void* /* ptr */, PyObject* /* obj */, PyObject* arg_tuple )
{
    char* _0param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0param )  )
    {
        QFont::removeSubstitution(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_pixelSize( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("i", ((QFont*)ptr)->pixelSize() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setUnderline( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    bool _0param;
    if ( PyArg_ParseTuple( arg_tuple, "b", &_0param )  )
    {
        ((QFont*)ptr)->setUnderline(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_encodingName( void* /* ptr */, PyObject* /* obj */, PyObject* arg_tuple )
{
    char* _0enum = 0;
    int   _0param;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0enum )  && ( !_0enum || enumToCpp( pyqt_qfont_CharSet, _0enum, &_0param ) ) )
    {
        return Py_BuildValue("s", QFont::encodingName((QFont::CharSet)_0param).latin1() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_italic( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->italic() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setFamily( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    char* _0param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0param )  )
    {
        ((QFont*)ptr)->setFamily(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_defaultFont( void* /* ptr */, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return pyqt_qfont_toPython( QFont::defaultFont() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_fixedPitch( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->fixedPitch() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setPointSizeFloat( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    double _0param;
    if ( PyArg_ParseTuple( arg_tuple, "d", &_0param )  )
    {
        ((QFont*)ptr)->setPointSizeFloat(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_substitutions( void* /* ptr */, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return pyqt_qstringlist_toPython( QFont::substitutions() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setRawName( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    char* _0param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0param )  )
    {
        ((QFont*)ptr)->setRawName(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setStrikeOut( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    bool _0param;
    if ( PyArg_ParseTuple( arg_tuple, "b", &_0param )  )
    {
        ((QFont*)ptr)->setStrikeOut(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setWeight( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    char* _0enum = 0;
    int   _0param;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0enum )  && ( !_0enum || enumToCpp( pyqt_qfont_Weight, _0enum, &_0param ) ) )
    {
        ((QFont*)ptr)->setWeight((QFont::Weight)_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setStyleHint( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    char* _0enum = 0;
    int   _0param;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0enum )  && ( !_0enum || enumToCpp( pyqt_qfont_StyleHint, _0enum, &_0param ) ) )
    {
        ((QFont*)ptr)->setStyleHint((QFont::StyleHint)_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setBold( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    bool _0param;
    if ( PyArg_ParseTuple( arg_tuple, "b", &_0param )  )
    {
        ((QFont*)ptr)->setBold(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_charSet( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return enumToPython( pyqt_qfont_CharSet, (int)((QFont*)ptr)->charSet() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setRawMode( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    bool _0param;
    if ( PyArg_ParseTuple( arg_tuple, "b", &_0param )  )
    {
        ((QFont*)ptr)->setRawMode(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setPointSize( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    int _0param;
    if ( PyArg_ParseTuple( arg_tuple, "i", &_0param )  )
    {
        ((QFont*)ptr)->setPointSize(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_family( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("s", ((QFont*)ptr)->family().latin1() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setPixelSize( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    int _0param;
    if ( PyArg_ParseTuple( arg_tuple, "i", &_0param )  )
    {
        ((QFont*)ptr)->setPixelSize(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_substitute( void* /* ptr */, PyObject* /* obj */, PyObject* arg_tuple )
{
    char* _0param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0param )  )
    {
        return Py_BuildValue("s", QFont::substitute(_0param).latin1() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_underline( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->underline() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setCharSet( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    char* _0enum = 0;
    int   _0param;
    if ( PyArg_ParseTuple( arg_tuple, "s", &_0enum )  && ( !_0enum || enumToCpp( pyqt_qfont_CharSet, _0enum, &_0param ) ) )
    {
        ((QFont*)ptr)->setCharSet((QFont::CharSet)_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setItalic( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    bool _0param;
    if ( PyArg_ParseTuple( arg_tuple, "b", &_0param )  )
    {
        ((QFont*)ptr)->setItalic(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_rawMode( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->rawMode() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_key( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("s", ((QFont*)ptr)->key().latin1() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_setFixedPitch( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    bool _0param;
    if ( PyArg_ParseTuple( arg_tuple, "b", &_0param )  )
    {
        ((QFont*)ptr)->setFixedPitch(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setDefaultFont( void* /* ptr */, PyObject* /* obj */, PyObject* arg_tuple )
{
    PyObject* _0param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "O", &_0param )  && inherits( _0param, Font ) )
    {
        QFont::setDefaultFont(*pyqt_qfont_toCpp( _0param ));
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_setPixelSizeFloat( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    double _0param;
    if ( PyArg_ParseTuple( arg_tuple, "d", &_0param )  )
    {
        ((QFont*)ptr)->setPixelSizeFloat(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_pointSizeFloat( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("d", (float)((QFont*)ptr)->pointSizeFloat() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_exactMatch( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->exactMatch() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_constructor( void* /* ptr */, PyObject* obj, PyObject* arg_tuple )
{
    if ( !obj )
        return NULL;

    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        void* ptr = new QFont;
        mapObject( obj, ptr, pyqt_qfont_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }

    char* _0param = 0;
    int _1param= 12;
    int _2param= QFont::Normal;
    bool _3param= FALSE;
    if ( PyArg_ParseTuple( arg_tuple, "s|iib", &_0param, &_1param, &_2param, &_3param )  )
    {
        PyErr_Clear();
        void* ptr = new QFont( _0param, _1param, _2param, _3param );
        mapObject( obj, ptr, pyqt_qfont_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }
    char* _4param = 0;
    int _5param;
    int _6param;
    bool _7param;
    char* _8enum = 0;
    int   _8param;
    if ( PyArg_ParseTuple( arg_tuple, "siibs", &_4param, &_5param, &_6param, &_7param, &_8enum )  && ( !_8enum || enumToCpp( pyqt_qfont_CharSet, _8enum, &_8param ) ) )
    {
        PyErr_Clear();
        void* ptr = new QFont( _4param, _5param, _6param, _7param, (QFont::CharSet)_8param );
        mapObject( obj, ptr, pyqt_qfont_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }
    PyObject* _9param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "O", &_9param )  && inherits( _9param, Font ) )
    {
        PyErr_Clear();
        void* ptr = new QFont( *pyqt_qfont_toCpp( _9param ) );
        mapObject( obj, ptr, pyqt_qfont_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        PyErr_Clear();
        void* ptr = new QFont;
        mapObject( obj, ptr, pyqt_qfont_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_weight( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return enumToPython( pyqt_qfont_Weight, (int)((QFont*)ptr)->weight() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_bold( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->bold() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_pointSize( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("i", ((QFont*)ptr)->pointSize() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_strikeOut( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->strikeOut() );
    }
    return NULL;
}

static PyObject* pyqt_qfont_insertSubstitution( void* /* ptr */, PyObject* /* obj */, PyObject* arg_tuple )
{
    char* _0param = 0;
    char* _1param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "ss", &_0param, &_1param )  )
    {
        QFont::insertSubstitution(_0param, _1param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qfont_isCopyOf( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    PyObject* _0param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "O", &_0param )  && inherits( _0param, Font ) )
    {
        return Py_BuildValue("b", (char)((QFont*)ptr)->isCopyOf(*pyqt_qfont_toCpp( _0param )) );
    }
    return NULL;
}

static PyQt_Method pyqt_qfont_methods[] = {
    pyqt_qfont_rawName,
    pyqt_qfont_styleHint,
    pyqt_qfont_removeSubstitution,
    pyqt_qfont_pixelSize,
    pyqt_qfont_setUnderline,
    pyqt_qfont_encodingName,
    pyqt_qfont_italic,
    pyqt_qfont_setFamily,
    pyqt_qfont_defaultFont,
    pyqt_qfont_fixedPitch,
    pyqt_qfont_setPointSizeFloat,
    pyqt_qfont_substitutions,
    pyqt_qfont_setRawName,
    pyqt_qfont_setStrikeOut,
    pyqt_qfont_setWeight,
    pyqt_qfont_setStyleHint,
    pyqt_qfont_setBold,
    pyqt_qfont_charSet,
    pyqt_qfont_setRawMode,
    pyqt_qfont_setPointSize,
    pyqt_qfont_family,
    pyqt_qfont_setPixelSize,
    pyqt_qfont_substitute,
    pyqt_qfont_underline,
    pyqt_qfont_setCharSet,
    pyqt_qfont_setItalic,
    pyqt_qfont_rawMode,
    pyqt_qfont_key,
    pyqt_qfont_setFixedPitch,
    pyqt_qfont_setDefaultFont,
    pyqt_qfont_setPixelSizeFloat,
    pyqt_qfont_pointSizeFloat,
    pyqt_qfont_exactMatch,
    pyqt_qfont_constructor,
    pyqt_qfont_weight,
    pyqt_qfont_bold,
    pyqt_qfont_pointSize,
    pyqt_qfont_strikeOut,
    pyqt_qfont_insertSubstitution,
    pyqt_qfont_isCopyOf,
    0
};

static void pyqt_qfont_init()
{
    if ( pyqt_qfont_class )
        return;

    pyqt_qfont_class = new PyQt_ClassInfo;
    pyqt_qfont_class->freeQt = pyqt_qfont_free;
    pyqt_qfont_class->methods = pyqt_qfont_methods;
    pyqt_qfont_class->methodCount = methodCount( pyqt_qfont_methods );
    pyqt_qfont_class->next = 0;
    pyqt_qfont_class->classid = Font;
    pyqt_qfont_class->classObject = PyDict_GetItemString( pyqt_qt_dict, "QFont" );
    pyqt_qfont_class->className = "QFont";
    ASSERT( pyqt_qfont_class->classObject );
}

