// ***** AUTOGENERATED CODE, DO NOT EDIT *****
            // ***** This class is not copyable.
        
        #include "REcmaCharacterWidget.h"
        #include "RMetaTypes.h"
        #include "../REcmaHelper.h"

        // forwards declarations mapped to includes
        
                #include <QMouseEvent>
            
                #include <QPaintEvent>
            
            
        // includes for base ecma wrapper classes
         void REcmaCharacterWidget::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RCharacterWidget*) 0)));
        protoCreated = true;
    }

    
        // primary base class QWidget:
        
            QScriptValue dpt = engine.defaultPrototype(
                qMetaTypeId<QWidget*>());

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class QWidget
        REcmaHelper::registerFunction(&engine, proto, getQWidget, "getQWidget");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, sizeHint, "sizeHint");
            
            REcmaHelper::registerFunction(&engine, proto, getDisplayFont, "getDisplayFont");
            
            REcmaHelper::registerFunction(&engine, proto, updateFont, "updateFont");
            
            REcmaHelper::registerFunction(&engine, proto, updateSize, "updateSize");
            
            REcmaHelper::registerFunction(&engine, proto, updateStyle, "updateStyle");
            
            REcmaHelper::registerFunction(&engine, proto, updateFontMerging, "updateFontMerging");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RCharacterWidget*>(), *proto);

        
                        qScriptRegisterMetaType<
                        RCharacterWidget*>(
                        &engine, toScriptValue, fromScriptValue, *proto);
                    
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RCharacterWidget",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
     QScriptValue REcmaCharacterWidget::createEcma(QScriptContext* context, QScriptEngine* engine) 
    
    {
    if (context->thisObject().strictlyEquals(
       engine->globalObject())) {
       return REcmaHelper::throwError(
       QString::fromLatin1("RCharacterWidget(): Did you forget to construct with 'new'?"),
           context);
    }

    QScriptValue result;
        
            // generate constructor variants:
            
    if( context->argumentCount() ==
        0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RCharacterWidget
                    * cppResult =
                    new
                    RCharacterWidget
                    ();
                
                    result = engine->newQObject(context->thisObject(), cppResult, QScriptEngine::QtOwnership);
                
    } else 

    if( context->argumentCount() ==
        1
                && (
                
                        context->argument(
                        0
                        ).isQObject()
                        ||
                    
                        context->argument(
                        0
                        ).isNull()
                ) /* type: QWidget * */
            
    ){
    // prepare arguments:
    
            // argument isQObject
            QWidget *
            a0 =
            qobject_cast<
            QWidget *>
            ( context->argument(
            0
            ).
            toQObject()
            );
        
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RCharacterWidget
                    * cppResult =
                    new
                    RCharacterWidget
                    (
                    a0
                    );
                
                    result = engine->newQObject(context->thisObject(), cppResult, QScriptEngine::QtOwnership);
                
    } else 

    {
       return REcmaHelper::throwError(
       QString::fromLatin1("RCharacterWidget(): no matching constructor found."),
           context);
    }
    
    return result;
    }
    

    // conversion functions for base classes:
     QScriptValue REcmaCharacterWidget::getQWidget(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                QWidget* cppResult =
                    qscriptvalue_cast<RCharacterWidget*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

    // returns class name:
     QScriptValue REcmaCharacterWidget::getClassName(QScriptContext *context, QScriptEngine *engine) 
        
    {
        return qScriptValueFromValue(engine, QString("RCharacterWidget"));
    }
    

    // returns all base classes (in case of multiple inheritance):
     QScriptValue REcmaCharacterWidget::getBaseClasses(QScriptContext *context, QScriptEngine *engine) 
        
    {
        QStringList list;
        
        list.append("QWidget");
    

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

    // public methods:
     QScriptValue
        REcmaCharacterWidget::sizeHint
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaCharacterWidget::sizeHint", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaCharacterWidget::sizeHint";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RCharacterWidget* self = 
                        getSelf("sizeHint", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'QSize'
    QSize cppResult =
        
               self->sizeHint();
        // return type: QSize
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RCharacterWidget.sizeHint().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaCharacterWidget::sizeHint", context, engine);
            return result;
        }
         QScriptValue
        REcmaCharacterWidget::getDisplayFont
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaCharacterWidget::getDisplayFont", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaCharacterWidget::getDisplayFont";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RCharacterWidget* self = 
                        getSelf("getDisplayFont", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'QFont'
    QFont cppResult =
        
               self->getDisplayFont();
        // return type: QFont
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RCharacterWidget.getDisplayFont().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaCharacterWidget::getDisplayFont", context, engine);
            return result;
        }
         QScriptValue
        REcmaCharacterWidget::updateFont
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaCharacterWidget::updateFont", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaCharacterWidget::updateFont";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RCharacterWidget* self = 
                        getSelf("updateFont", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: QFont */
    
    ){
    // prepare arguments:
    
                    // argument is reference
                    QFont*
                    ap0 =
                    qscriptvalue_cast<
                    QFont*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if( ap0 == NULL ){
                           return REcmaHelper::throwError("RCharacterWidget: Argument 0 is not of type QFont*.",
                               context);                    
                    }
                    QFont& a0 = *ap0;
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->updateFont(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RCharacterWidget.updateFont().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaCharacterWidget::updateFont", context, engine);
            return result;
        }
         QScriptValue
        REcmaCharacterWidget::updateSize
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaCharacterWidget::updateSize", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaCharacterWidget::updateSize";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RCharacterWidget* self = 
                        getSelf("updateSize", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isString()
        ) /* type: QString */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    QString
                    a0 =
                    (QString)
                    
                    context->argument( 0 ).
                    toString();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->updateSize(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RCharacterWidget.updateSize().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaCharacterWidget::updateSize", context, engine);
            return result;
        }
         QScriptValue
        REcmaCharacterWidget::updateStyle
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaCharacterWidget::updateStyle", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaCharacterWidget::updateStyle";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RCharacterWidget* self = 
                        getSelf("updateStyle", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isString()
        ) /* type: QString */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    QString
                    a0 =
                    (QString)
                    
                    context->argument( 0 ).
                    toString();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->updateStyle(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RCharacterWidget.updateStyle().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaCharacterWidget::updateStyle", context, engine);
            return result;
        }
         QScriptValue
        REcmaCharacterWidget::updateFontMerging
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaCharacterWidget::updateFontMerging", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaCharacterWidget::updateFontMerging";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RCharacterWidget* self = 
                        getSelf("updateFontMerging", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    bool
                    a0 =
                    (bool)
                    
                    context->argument( 0 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->updateFontMerging(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RCharacterWidget.updateFontMerging().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaCharacterWidget::updateFontMerging", context, engine);
            return result;
        }
         QScriptValue REcmaCharacterWidget::toString
    (QScriptContext *context, QScriptEngine *engine)
    
    {

    RCharacterWidget* self = getSelf("toString", context);
    
    QString result;
    
            result = QString("RCharacterWidget(0x%1)").arg((unsigned long int)self, 0, 16);
        
    return QScriptValue(result);
    }
     QScriptValue REcmaCharacterWidget::destroy(QScriptContext *context, QScriptEngine *engine)
    
    {

        RCharacterWidget* self = getSelf("RCharacterWidget", context);
        //Q_ASSERT(self!=NULL);
        if (self==NULL) {
            return REcmaHelper::throwError("self is NULL", context);
        }
        
    
        delete self;
        context->thisObject().setData(engine->nullValue());
        context->thisObject().prototype().setData(engine->nullValue());
        context->thisObject().setPrototype(engine->nullValue());
        context->thisObject().setScriptClass(NULL);
        return engine->undefinedValue();
    }
    RCharacterWidget* REcmaCharacterWidget::getSelf(const QString& fName, QScriptContext* context)
    
        {
            RCharacterWidget* self = NULL;

            
                // self could be a normal object (e.g. from an UI file) or
                // an ECMA shell object (made from an ECMA script):
                //self = getSelfShell(fName, context);
                

            //if (self==NULL) {
                self = REcmaHelper::scriptValueTo<RCharacterWidget >(context->thisObject())
                
                ;
            //}

            if (self == NULL){
                // avoid recursion (toString is used by the backtrace):
                if (fName!="toString") {
                    REcmaHelper::throwError(QString("RCharacterWidget.%1(): "
                        "This object is not a RCharacterWidget").arg(fName),
                        context);
                }
                return NULL;
            }

            return self;
        }
        RCharacterWidget* REcmaCharacterWidget::getSelfShell(const QString& fName, QScriptContext* context)
    
        {
          RCharacterWidget* selfBase = getSelf(fName, context);
                RCharacterWidget* self = dynamic_cast<RCharacterWidget*>(selfBase);
                //return REcmaHelper::scriptValueTo<RCharacterWidget >(context->thisObject());
            if(self == NULL){
                REcmaHelper::throwError(QString("RCharacterWidget.%1(): "
                    "This object is not a RCharacterWidget").arg(fName),
                    context);
            }

            return self;
            


        }
         void fromScriptValue(const QScriptValue& value,
        RCharacterWidget*
        &out) {
            QObject* o = value.toQObject();
            out = qobject_cast<
            RCharacterWidget*>(o);
        }
     QScriptValue toScriptValue(QScriptEngine *engine,
        RCharacterWidget*
        const &in){
            QScriptValue s = engine->newQObject(in, QScriptEngine::QtOwnership,
            QScriptEngine::PreferExistingWrapperObject);
            /*
            if(s.isNull()){
               REcmaHelper::throwError("This object is null.", engine->currentContext());
            }
            */
            return s;
        }
    