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

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

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

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

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

    // 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<RPatternListImperial*>(), *proto);

        
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, init, "init");
            
            REcmaHelper::registerFunction(&engine, &ctor, uninit, "uninit");
            
            REcmaHelper::registerFunction(&engine, &ctor, getNames, "getNames");
            
            REcmaHelper::registerFunction(&engine, &ctor, get, "get");
            

    // static properties:
    

    // enum values:
    

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

    // conversion functions for base classes:
     QScriptValue REcmaPatternListImperial::getRPatternList(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RPatternList* cppResult =
                    qscriptvalue_cast<RPatternListImperial*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

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

            QScriptValue result = engine->undefinedValue();
            
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'void'
    RPatternListImperial::
       init();
    } else


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

            QScriptValue result = engine->undefinedValue();
            
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'void'
    RPatternListImperial::
       uninit();
    } else


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

            QScriptValue result = engine->undefinedValue();
            
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'QStringList'
    QStringList cppResult =
        RPatternListImperial::
       getNames();
        // return type: QStringList
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


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

            QScriptValue result = engine->undefinedValue();
            
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isString()
        ) /* type: QString */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    QString
                    a0 =
                    (QString)
                    
                    context->argument( 0 ).
                    toString();
                
    // end of arguments

    // call C++ function:
    // return type 'RPattern *'
    RPattern * cppResult =
        RPatternListImperial::
       get(a0);
        // return type: RPattern *
                // pointer, copyable 
                result = qScriptValueFromValue(engine, *cppResult);
            
    } else


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

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

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

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

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

            return self;
            


        }
        