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

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

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

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

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        REcmaExportListener::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 RExportListener
        REcmaHelper::registerFunction(&engine, proto, getRExportListener, "getRExportListener");
        

    // 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 RExportListener:
        

        // methods of secondary base class RExportListener:
        

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, preExportEvent, "preExportEvent");
            
            REcmaHelper::registerFunction(&engine, proto, postExportEvent, "postExportEvent");
            
            REcmaHelper::registerFunction(&engine, proto, endOfExportEvent, "endOfExportEvent");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RExportListenerAdapter*>(), *proto);

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

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RExportListenerAdapter",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
     QScriptValue REcmaExportListenerAdapter::createEcma(QScriptContext* context, QScriptEngine* engine) 
    
    {
    if (context->thisObject().strictlyEquals(
       engine->globalObject())) {
       return REcmaHelper::throwError(
       QString::fromLatin1("RExportListenerAdapter(): 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:
            RExportListenerAdapter
                    * cppResult =
                    new
                    RExportListenerAdapter
                    ();
                
                    result = engine->newQObject(context->thisObject(), cppResult, QScriptEngine::QtOwnership);
                
    } else 

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

    // conversion functions for base classes:
     QScriptValue REcmaExportListenerAdapter::getQObject(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                QObject* cppResult =
                    qscriptvalue_cast<RExportListenerAdapter*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
             QScriptValue REcmaExportListenerAdapter::getRExportListener(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RExportListener* cppResult =
                    qscriptvalue_cast<RExportListenerAdapter*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

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

        // methods of secondary base class RExportListener:
        

    // properties:
    

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

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

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

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


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

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

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

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RExportListenerAdapter* self = 
                        getSelf("endOfExportEvent", 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: RExporter * */
    
    ){
    // 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("RExportListenerAdapter: Argument 0 is not of type RExporter *RExporter *.", context);                    
                    }
                
    // end of arguments

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


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

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

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

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

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

            return self;
            


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