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

        // forwards declarations mapped to includes
        
                #include "RGraphicsScene.h"
            
                #include "RGraphicsView.h"
            
            
        // includes for base ecma wrapper classes
         void REcmaInputEvent::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

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

    

    QScriptValue fun;

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

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

    // 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, getModelPosition, "getModelPosition");
            
            REcmaHelper::registerFunction(&engine, proto, setModelPosition, "setModelPosition");
            
            REcmaHelper::registerFunction(&engine, proto, getCursorPosition, "getCursorPosition");
            
            REcmaHelper::registerFunction(&engine, proto, setCursorPosition, "setCursorPosition");
            
            REcmaHelper::registerFunction(&engine, proto, getScreenPosition, "getScreenPosition");
            
            REcmaHelper::registerFunction(&engine, proto, setScreenPosition, "setScreenPosition");
            
            REcmaHelper::registerFunction(&engine, proto, getGraphicsView, "getGraphicsView");
            
            REcmaHelper::registerFunction(&engine, proto, getGraphicsScene, "getGraphicsScene");
            
            REcmaHelper::registerFunction(&engine, proto, isValid, "isValid");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RInputEvent*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

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

    QScriptValue result;
        
            // generate constructor variants:
            
    if( context->argumentCount() ==
        3
                && (
                
                        context->argument(
                        0
                        ).isVariant()
                        ||
                    
                        context->argument(
                        0
                        ).isQObject()
                        ||
                    
                        context->argument(
                        0
                        ).isNull()
                ) /* type: RVector */
            
                && (
                
                        context->argument(
                        1
                        ).isVariant()
                        ||
                    
                        context->argument(
                        1
                        ).isQObject()
                        ||
                    
                        context->argument(
                        1
                        ).isNull()
                ) /* type: RGraphicsScene */
            
                && (
                
                        context->argument(
                        2
                        ).isVariant()
                        ||
                    
                        context->argument(
                        2
                        ).isQObject()
                        ||
                    
                        context->argument(
                        2
                        ).isNull()
                ) /* type: RGraphicsView */
            
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap0 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RInputEvent: Argument 0 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a0 = 
                    *ap0;
                
                    // argument is reference
                    RGraphicsScene*
                    ap1 =
                    qscriptvalue_cast<
                    RGraphicsScene*
                        >(
                        context->argument(
                        1
                        )
                    );
                    if( ap1 == NULL ){
                           return REcmaHelper::throwError("RInputEvent: Argument 1 is not of type RGraphicsScene*.",
                               context);                    
                    }
                    RGraphicsScene& a1 = *ap1;
                
                    // argument is reference
                    RGraphicsView*
                    ap2 =
                    qscriptvalue_cast<
                    RGraphicsView*
                        >(
                        context->argument(
                        2
                        )
                    );
                    if( ap2 == NULL ){
                           return REcmaHelper::throwError("RInputEvent: Argument 2 is not of type RGraphicsView*.",
                               context);                    
                    }
                    RGraphicsView& a2 = *ap2;
                
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RInputEvent
                    * cppResult =
                    new
                    RInputEvent
                    (
                    a0
        ,
    a1
        ,
    a2
                    );
                
                    // TODO: triggers: Warning: QScriptEngine::newVariant(): changing class of non-QScriptObject not supported:
                    result = engine->newVariant(context->thisObject(), qVariantFromValue(cppResult));
                
    } else 

    if( context->argumentCount() ==
        4
                && (
                
                        context->argument(
                        0
                        ).isVariant()
                        ||
                    
                        context->argument(
                        0
                        ).isQObject()
                        ||
                    
                        context->argument(
                        0
                        ).isNull()
                ) /* type: RVector */
            
                && (
                
                        context->argument(
                        1
                        ).isVariant()
                        ||
                    
                        context->argument(
                        1
                        ).isQObject()
                        ||
                    
                        context->argument(
                        1
                        ).isNull()
                ) /* type: RGraphicsScene */
            
                && (
                
                        context->argument(
                        2
                        ).isVariant()
                        ||
                    
                        context->argument(
                        2
                        ).isQObject()
                        ||
                    
                        context->argument(
                        2
                        ).isNull()
                ) /* type: RGraphicsView */
            
                && (
                
                        context->argument(
                        3
                        ).isNumber()
                ) /* type: qreal */
            
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap0 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RInputEvent: Argument 0 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a0 = 
                    *ap0;
                
                    // argument is reference
                    RGraphicsScene*
                    ap1 =
                    qscriptvalue_cast<
                    RGraphicsScene*
                        >(
                        context->argument(
                        1
                        )
                    );
                    if( ap1 == NULL ){
                           return REcmaHelper::throwError("RInputEvent: Argument 1 is not of type RGraphicsScene*.",
                               context);                    
                    }
                    RGraphicsScene& a1 = *ap1;
                
                    // argument is reference
                    RGraphicsView*
                    ap2 =
                    qscriptvalue_cast<
                    RGraphicsView*
                        >(
                        context->argument(
                        2
                        )
                    );
                    if( ap2 == NULL ){
                           return REcmaHelper::throwError("RInputEvent: Argument 2 is not of type RGraphicsView*.",
                               context);                    
                    }
                    RGraphicsView& a2 = *ap2;
                
                    // argument isStandardType
                    qreal
                    a3 =
                    (qreal)
                    
                    context->argument( 3 ).
                    toNumber();
                
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RInputEvent
                    * cppResult =
                    new
                    RInputEvent
                    (
                    a0
        ,
    a1
        ,
    a2
        ,
    a3
                    );
                
                    // TODO: triggers: Warning: QScriptEngine::newVariant(): changing class of non-QScriptObject not supported:
                    result = engine->newVariant(context->thisObject(), qVariantFromValue(cppResult));
                
    } else 

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

    // conversion functions for base classes:
    

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("getModelPosition", 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 'RVector'
    RVector cppResult =
        
               self->getModelPosition();
        // return type: RVector
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("setModelPosition", 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: RVector */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap0 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RInputEvent: Argument 0 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a0 = 
                    *ap0;
                
    // end of arguments

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("getCursorPosition", 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 'RVector'
    RVector cppResult =
        
               self->getCursorPosition();
        // return type: RVector
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("setCursorPosition", 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: RVector */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap0 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RInputEvent: Argument 0 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a0 = 
                    *ap0;
                
    // end of arguments

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("getScreenPosition", 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 'RVector'
    RVector cppResult =
        
               self->getScreenPosition();
        // return type: RVector
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("setScreenPosition", 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: RVector */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap0 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RInputEvent: Argument 0 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a0 = 
                    *ap0;
                
    // end of arguments

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("getGraphicsView", 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 'RGraphicsView &'
    RGraphicsView & cppResult =
        
               self->getGraphicsView();
        // return type: RGraphicsView &
                // reference
                result = engine->newVariant(
                QVariant::fromValue(&cppResult));
            
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("getGraphicsScene", 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 'RGraphicsScene &'
    RGraphicsScene & cppResult =
        
               self->getGraphicsScene();
        // return type: RGraphicsScene &
                // reference
                result = engine->newVariant(
                QVariant::fromValue(&cppResult));
            
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RInputEvent* self = 
                        getSelf("isValid", 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 'bool'
    bool cppResult =
        
               self->isValid();
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


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

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

        RInputEvent* self = getSelf("RInputEvent", 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();
    }
    RInputEvent* REcmaInputEvent::getSelf(const QString& fName, QScriptContext* context)
    
        {
            RInputEvent* 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<RInputEvent >(context->thisObject())
                
                ;
            //}

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

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

            return self;
            


        }
        