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

        // forwards declarations mapped to includes
        
            
        // includes for base ecma wrapper classes
         void REcmaTerminateEvent::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

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

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

            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 QEvent
        REcmaHelper::registerFunction(&engine, proto, getQEvent, "getQEvent");
        

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

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

    // properties:
    

    // methods:
    
        engine.setDefaultPrototype(
            qMetaTypeId<RTerminateEvent*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

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

    // conversion functions for base classes:
     QScriptValue REcmaTerminateEvent::getQEvent(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                QEvent* cppResult =
                    qscriptvalue_cast<RTerminateEvent*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

    // public methods:
     QScriptValue REcmaTerminateEvent::toString
    (QScriptContext *context, QScriptEngine *engine)
    
    {

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

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

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

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

            return self;
            


        }
        