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

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

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

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

            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 RAddObjectsOperation
        REcmaHelper::registerFunction(&engine, proto, getRAddObjectsOperation, "getRAddObjectsOperation");
        
        // conversion for base class ROperation
        REcmaHelper::registerFunction(&engine, proto, getROperation, "getROperation");
        
        // conversion for base class RRequireHeap
        REcmaHelper::registerFunction(&engine, proto, getRRequireHeap, "getRRequireHeap");
        

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

        
    

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RModifyObjectsOperation",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
     QScriptValue REcmaModifyObjectsOperation::createEcma(QScriptContext* context, QScriptEngine* engine) 
    
    {
    if (context->thisObject().strictlyEquals(
       engine->globalObject())) {
       return REcmaHelper::throwError(
       QString::fromLatin1("RModifyObjectsOperation(): 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:
            RModifyObjectsOperation
                    * cppResult =
                    new
                    RModifyObjectsOperation
                    ();
                
                    // TODO: triggers: Warning: QScriptEngine::newVariant(): changing class of non-QScriptObject not supported:
                    result = engine->newVariant(context->thisObject(), qVariantFromValue(cppResult));
                
    } else 

    if( context->argumentCount() ==
        1
                && (
                
                        context->argument(
                        0
                        ).isBool()
                ) /* type: bool */
            
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    bool
                    a0 =
                    (bool)
                    
                    context->argument( 0 ).
                    toBool();
                
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RModifyObjectsOperation
                    * cppResult =
                    new
                    RModifyObjectsOperation
                    (
                    a0
                    );
                
                    // TODO: triggers: Warning: QScriptEngine::newVariant(): changing class of non-QScriptObject not supported:
                    result = engine->newVariant(context->thisObject(), qVariantFromValue(cppResult));
                
    } else 

    if( context->argumentCount() ==
        1
                && (
                
                        context->argument(
                        0
                        ).isArray()
                ) /* type: QList < QSharedPointer < RObject > > */
            
    ){
    // prepare arguments:
    
                    // argument isArray
                    QList < QSharedPointer < RObject > >
                    a0;
                    REcmaHelper::fromScriptValue(
                        engine,
                        context->argument(0),
                        a0
                    );
                
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RModifyObjectsOperation
                    * cppResult =
                    new
                    RModifyObjectsOperation
                    (
                    a0
                    );
                
                    // TODO: triggers: Warning: QScriptEngine::newVariant(): changing class of non-QScriptObject not supported:
                    result = engine->newVariant(context->thisObject(), qVariantFromValue(cppResult));
                
    } else 

    if( context->argumentCount() ==
        2
                && (
                
                        context->argument(
                        0
                        ).isArray()
                ) /* type: QList < QSharedPointer < RObject > > */
            
                && (
                
                        context->argument(
                        1
                        ).isBool()
                ) /* type: bool */
            
    ){
    // prepare arguments:
    
                    // argument isArray
                    QList < QSharedPointer < RObject > >
                    a0;
                    REcmaHelper::fromScriptValue(
                        engine,
                        context->argument(0),
                        a0
                    );
                
                    // argument isStandardType
                    bool
                    a1 =
                    (bool)
                    
                    context->argument( 1 ).
                    toBool();
                
    // end of arguments

    // call C++ constructor:
    
            // non-copyable class:
            RModifyObjectsOperation
                    * cppResult =
                    new
                    RModifyObjectsOperation
                    (
                    a0
        ,
    a1
                    );
                
                    // 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("RModifyObjectsOperation(): no matching constructor found."),
           context);
    }
    
    return result;
    }
    

    // conversion functions for base classes:
     QScriptValue REcmaModifyObjectsOperation::getRAddObjectsOperation(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RAddObjectsOperation* cppResult =
                    qscriptvalue_cast<RModifyObjectsOperation*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
             QScriptValue REcmaModifyObjectsOperation::getROperation(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                ROperation* cppResult =
                    qscriptvalue_cast<RModifyObjectsOperation*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
             QScriptValue REcmaModifyObjectsOperation::getRRequireHeap(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RRequireHeap* cppResult =
                    qscriptvalue_cast<RModifyObjectsOperation*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RModifyObjectsOperation* self = 
                        getSelf("transformSelection", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    6 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RTransformation * */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNull()
        ) /* type: RDocumentInterface * */
     && (
            context->argument(2).isNumber()
        ) /* type: int */
     && (
            context->argument(3).isBool()
        ) /* type: bool */
     && (
            context->argument(4).isBool()
        ) /* type: bool */
     && (
            context->argument(5).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument is pointer
                    RTransformation * a0 = NULL;

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

                    a1 = 
                        REcmaHelper::scriptValueTo<RDocumentInterface >(
                            context->argument(1)
                        );
                    
                    if (a1==NULL && 
                        !context->argument(1).isNull()) {
                        return REcmaHelper::throwError("RModifyObjectsOperation: Argument 1 is not of type RDocumentInterface *RDocumentInterface *.", context);                    
                    }
                
                    // argument isStandardType
                    int
                    a2 =
                    (int)
                    
                    context->argument( 2 ).
                    toNumber();
                
                    // argument isStandardType
                    bool
                    a3 =
                    (bool)
                    
                    context->argument( 3 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a4 =
                    (bool)
                    
                    context->argument( 4 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a5 =
                    (bool)
                    
                    context->argument( 5 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->transformSelection(a0
        ,
    a1
        ,
    a2
        ,
    a3
        ,
    a4
        ,
    a5);
    } else


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

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

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

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

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

            return self;
            


        }
        