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

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

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

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

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

    // 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, getScriptFile, "getScriptFile");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RScriptAction*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RScriptAction",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
     QScriptValue REcmaScriptAction::createEcma(QScriptContext* context, QScriptEngine* engine) 
    
    {
           return REcmaHelper::throwError("Abstract class RScriptAction: Cannot be constructed.",
               context); 
    }
    

    // conversion functions for base classes:
     QScriptValue REcmaScriptAction::getRAction(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RAction* cppResult =
                    qscriptvalue_cast<RScriptAction*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

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

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


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

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

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

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

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

            return self;
            


        }
        