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

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

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

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

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        REcmaEntityExportListener::initEcma(engine, proto);
          
        */
    

    QScriptValue fun;

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

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class QObject
        REcmaHelper::registerFunction(&engine, proto, getQObject, "getQObject");
        
        // conversion for base class REntityExportListener
        REcmaHelper::registerFunction(&engine, proto, getREntityExportListener, "getREntityExportListener");
        

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

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

        // properties of secondary base class REntityExportListener:
        

        // methods of secondary base class REntityExportListener:
        
            REcmaHelper::registerFunction(&engine, proto, registerCustomProperty, "registerCustomProperty");
            
            REcmaHelper::registerFunction(&engine, proto, checkCustomProperty, "checkCustomProperty");
            

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, exportEntity, "exportEntity");
            
        engine.setDefaultPrototype(
            qMetaTypeId<REntityExportListenerAdapter*>(), *proto);

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

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

    // static properties:
    

    // enum values:
    

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

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

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

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

    // conversion functions for base classes:
     QScriptValue REcmaEntityExportListenerAdapter::getQObject(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                QObject* cppResult =
                    qscriptvalue_cast<REntityExportListenerAdapter*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
             QScriptValue REcmaEntityExportListenerAdapter::getREntityExportListener(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                REntityExportListener* cppResult =
                    qscriptvalue_cast<REntityExportListenerAdapter*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

        return qScriptValueFromSequence(engine, list);
    }
    
        // properties of secondary base class REntityExportListener:
        

        // methods of secondary base class REntityExportListener:
         QScriptValue
        REcmaEntityExportListenerAdapter::registerCustomProperty
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaEntityExportListenerAdapter::registerCustomProperty", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaEntityExportListenerAdapter::registerCustomProperty";
            //QCoreApplication::processEvents();

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

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

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    REntityExportListenerAdapter* self = 
                        getSelf("checkCustomProperty", 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: REntity * */
    
    ){
    // prepare arguments:
    
                    // argument is pointer
                    REntity * a0 = NULL;

                    a0 = 
                        REcmaHelper::scriptValueTo<REntity >(
                            context->argument(0)
                        );
                    
                    if (a0==NULL && 
                        !context->argument(0).isNull()) {
                        return REcmaHelper::throwError("REntityExportListener: Argument 0 is not of type REntity *REntity *.", context);                    
                    }
                
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->checkCustomProperty(a0);
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for REntityExportListenerAdapter.checkCustomProperty().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaEntityExportListenerAdapter::checkCustomProperty", context, engine);
            return result;
        }
        

    // properties:
    

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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RExporter * */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNull()
        ) /* type: REntity * */
    
    ){
    // prepare arguments:
    
                    // argument is pointer
                    RExporter * a0 = NULL;

                    a0 = 
                        REcmaHelper::scriptValueTo<RExporter >(
                            context->argument(0)
                        );
                    
                    if (a0==NULL && 
                        !context->argument(0).isNull()) {
                        return REcmaHelper::throwError("REntityExportListenerAdapter: Argument 0 is not of type RExporter *RExporter *.", context);                    
                    }
                
                    // argument is pointer
                    REntity * a1 = NULL;

                    a1 = 
                        REcmaHelper::scriptValueTo<REntity >(
                            context->argument(1)
                        );
                    
                    if (a1==NULL && 
                        !context->argument(1).isNull()) {
                        return REcmaHelper::throwError("REntityExportListenerAdapter: Argument 1 is not of type REntity *REntity *.", context);                    
                    }
                
    // end of arguments

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


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

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

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

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

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

            return self;
            


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