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

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

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

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

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

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

        // methods of secondary base class RCoordinateListener:
        

    // properties:
    

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

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

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

    // static properties:
    

    // enum values:
    

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

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

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

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

    // conversion functions for base classes:
     QScriptValue REcmaCoordinateListenerAdapter::getQObject(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                QObject* cppResult =
                    qscriptvalue_cast<RCoordinateListenerAdapter*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
             QScriptValue REcmaCoordinateListenerAdapter::getRCoordinateListener(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RCoordinateListener* cppResult =
                    qscriptvalue_cast<RCoordinateListenerAdapter*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

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

        // methods of secondary base class RCoordinateListener:
        

    // properties:
    

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

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

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


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

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

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

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

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

            return self;
            


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