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

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

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

    
        // primary base class RObject:
        
            proto->setPrototype(engine.defaultPrototype(
            qMetaTypeId<RObjectPointer>()));
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    
        // shared pointer support:
        REcmaHelper::registerFunction(&engine, proto, data, "data");
        

        REcmaHelper::registerFunction(&engine, proto, isNull, "isNull");
        

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RObject
        REcmaHelper::registerFunction(&engine, proto, getRObject, "getRObject");
        

    // 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, getType, "getType");
            
            REcmaHelper::registerFunction(&engine, proto, clone, "clone");
            
            REcmaHelper::registerFunction(&engine, proto, getName, "getName");
            
            REcmaHelper::registerFunction(&engine, proto, setName, "setName");
            
            REcmaHelper::registerFunction(&engine, proto, getCenterPoint, "getCenterPoint");
            
            REcmaHelper::registerFunction(&engine, proto, setCenterPoint, "setCenterPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getWidth, "getWidth");
            
            REcmaHelper::registerFunction(&engine, proto, setWidth, "setWidth");
            
            REcmaHelper::registerFunction(&engine, proto, getHeight, "getHeight");
            
            REcmaHelper::registerFunction(&engine, proto, setHeight, "setHeight");
            
            REcmaHelper::registerFunction(&engine, proto, getBox, "getBox");
            
            REcmaHelper::registerFunction(&engine, proto, scale, "scale");
            
            REcmaHelper::registerFunction(&engine, proto, getProperty, "getProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RViewPointer>(), *proto);
      
    

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

    // static properties:
    
            ctor.setProperty("PropertyName",
                qScriptValueFromValue(&engine, RView::PropertyName),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyCenterPoint",
                qScriptValueFromValue(&engine, RView::PropertyCenterPoint),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyWidth",
                qScriptValueFromValue(&engine, RView::PropertyWidth),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyHeight",
                qScriptValueFromValue(&engine, RView::PropertyHeight),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            

    // enum values:
    

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

    if( context->argumentCount() ==
        5
                && (
                
                        context->argument(
                        0
                        ).isVariant()
                        ||
                    
                        context->argument(
                        0
                        ).isQObject()
                        ||
                    
                        context->argument(
                        0
                        ).isNull()
                ) /* type: RDocument * */
            
                && (
                
                        context->argument(
                        1
                        ).isString()
                ) /* type: QString */
            
                && (
                
                        context->argument(
                        2
                        ).isVariant()
                        ||
                    
                        context->argument(
                        2
                        ).isQObject()
                        ||
                    
                        context->argument(
                        2
                        ).isNull()
                ) /* type: RVector */
            
                && (
                
                        context->argument(
                        3
                        ).isNumber()
                ) /* type: double */
            
                && (
                
                        context->argument(
                        4
                        ).isNumber()
                ) /* type: double */
            
    ){
    // prepare arguments:
    
                    // argument is pointer
                    RDocument * a0 = NULL;

                    a0 = 
                        REcmaHelper::scriptValueTo<RDocument >(
                            context->argument(0)
                        );
                    
                    if (a0==NULL && 
                        !context->argument(0).isNull()) {
                        return REcmaHelper::throwError("RView: Argument 0 is not of type RDocument *RDocument *.", context);                    
                    }
                
                    // argument isStandardType
                    QString
                    a1 =
                    (QString)
                    
                    context->argument( 1 ).
                    toString();
                
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap2 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        2
                        )
                    );
                    if (ap2 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 2 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a2 = 
                    *ap2;
                
                    // argument isStandardType
                    double
                    a3 =
                    (double)
                    
                    context->argument( 3 ).
                    toNumber();
                
                    // argument isStandardType
                    double
                    a4 =
                    (double)
                    
                    context->argument( 4 ).
                    toNumber();
                
    // end of arguments

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

    // conversion functions for base classes:
     QScriptValue REcmaSharedPointerView::getRObject(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RObject* cppResult =
                    qscriptvalue_cast<RView*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

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

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

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


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

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


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

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


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

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


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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    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 'void'
    
               self->setName(a0);
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RView* self = 
                        getSelf("getCenterPoint", 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 'RVector'
    RVector cppResult =
        
               self->getCenterPoint();
        // return type: RVector
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RView* self = 
                        getSelf("setCenterPoint", 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: RVector */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap0 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 0 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a0 = 
                    *ap0;
                
    // end of arguments

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


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

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


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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isNumber()
        ) /* type: double */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    double
                    a0 =
                    (double)
                    
                    context->argument( 0 ).
                    toNumber();
                
    // end of arguments

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


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

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


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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isNumber()
        ) /* type: double */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    double
                    a0 =
                    (double)
                    
                    context->argument( 0 ).
                    toNumber();
                
    // end of arguments

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RView* self = 
                        getSelf("getBox", 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 'RBox'
    RBox cppResult =
        
               self->getBox();
        // return type: RBox
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isNumber()
        ) /* type: double */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    double
                    a0 =
                    (double)
                    
                    context->argument( 0 ).
                    toNumber();
                
    // end of arguments

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RView* self = 
                        getSelf("getProperty", 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: RPropertyTypeId */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


        
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isStandardType
                    bool
                    a1 =
                    (bool)
                    
                    context->argument( 1 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0
        ,
    a1);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


        
    
    if( context->argumentCount() ==
    3 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isBool()
        ) /* type: bool */
     && (
            context->argument(2).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isStandardType
                    bool
                    a1 =
                    (bool)
                    
                    context->argument( 1 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a2 =
                    (bool)
                    
                    context->argument( 2 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0
        ,
    a1
        ,
    a2);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


        
    
    if( context->argumentCount() ==
    4 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isBool()
        ) /* type: bool */
     && (
            context->argument(2).isBool()
        ) /* type: bool */
     && (
            context->argument(3).isBool()
        ) /* type: bool */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isStandardType
                    bool
                    a1 =
                    (bool)
                    
                    context->argument( 1 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a2 =
                    (bool)
                    
                    context->argument( 2 ).
                    toBool();
                
                    // argument isStandardType
                    bool
                    a3 =
                    (bool)
                    
                    context->argument( 3 ).
                    toBool();
                
    // end of arguments

    // call C++ function:
    // return type 'QPair < QVariant , RPropertyAttributes >'
    QPair < QVariant , RPropertyAttributes > cppResult =
        
               self->getProperty(a0
        ,
    a1
        ,
    a2
        ,
    a3);
        // return type: QPair < QVariant , RPropertyAttributes >
                // Pair of ...:
                //result = REcmaHelper::pairToScriptValue(engine, cppResult);
                QVariantList vl;
                QVariant v;
                
                    // first type of pair is variant:
                    if (QString(cppResult.first.typeName())=="RLineweight::Lineweight") {
                        v.setValue((int)cppResult.first.value<RLineweight::Lineweight>());
                    }
                    else {
                        v.setValue(cppResult.first);
                    }
                  

                vl.append(v);
                v.setValue(cppResult.second);
                vl.append(v);
                result = qScriptValueFromValue(engine, vl);
            
    } else


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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNumber() || 
            context->argument(1).isString() || 
            context->argument(1).isBool() || 
            context->argument(1).isArray() || 
            context->argument(1).isNull() || 
            context->argument(1).isUndefined()
        ) /* type: QVariant */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isCopyable or pointer
                    QVariant
                    a1 =
                    qscriptvalue_cast<
                    QVariant
                        >(
                        context->argument(
                        1
                        )
                    );
                
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->setProperty(a0
        ,
    a1);
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


        
    
    if( context->argumentCount() ==
    3 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RPropertyTypeId */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNumber() || 
            context->argument(1).isString() || 
            context->argument(1).isBool() || 
            context->argument(1).isArray() || 
            context->argument(1).isNull() || 
            context->argument(1).isUndefined()
        ) /* type: QVariant */
     && (
            context->argument(2).isVariant() || 
            context->argument(2).isQObject() || 
            context->argument(2).isNull()
        ) /* type: RTransaction * */
    
    ){
    // prepare arguments:
    
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RPropertyTypeId*
                    ap0 =
                    qscriptvalue_cast<
                    RPropertyTypeId*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if (ap0 == NULL) {
                           return REcmaHelper::throwError("RView: Argument 0 is not of type RPropertyTypeId.",
                               context);                    
                    }
                    RPropertyTypeId 
                    a0 = 
                    *ap0;
                
                    // argument isCopyable or pointer
                    QVariant
                    a1 =
                    qscriptvalue_cast<
                    QVariant
                        >(
                        context->argument(
                        1
                        )
                    );
                
                    // argument is pointer
                    RTransaction * a2 = NULL;

                    a2 = 
                        REcmaHelper::scriptValueTo<RTransaction >(
                            context->argument(2)
                        );
                    
                    if (a2==NULL && 
                        !context->argument(2).isNull()) {
                        return REcmaHelper::throwError("RView: Argument 2 is not of type RTransaction *RTransaction *.", context);                    
                    }
                
    // end of arguments

    // call C++ function:
    // return type 'bool'
    bool cppResult =
        
               self->setProperty(a0
        ,
    a1
        ,
    a2);
        // return type: bool
                // standard Type
                result = QScriptValue(cppResult);
            
    } else


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

    RView* self = getSelf("toString", context);
    
    QString result;
    
            QDebug d(&result);
            if (self!=NULL) {
                d << *self;
            }
            else {
                d << "NULL";
            }
        
    return QScriptValue(result);
    }
     QScriptValue REcmaSharedPointerView::destroy(QScriptContext *context, QScriptEngine *engine)
    
    {

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

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

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

            return self;
            


        }
         QScriptValue REcmaSharedPointerView::data
    (QScriptContext *context, QScriptEngine *engine)
    
    {

    RView* self = getSelf("data", context);
    return qScriptValueFromValue(engine, self);
    }
     QScriptValue REcmaSharedPointerView::isNull
    (QScriptContext *context, QScriptEngine *engine)
    
    {

    RViewPointer* self = REcmaHelper::scriptValueTo<RViewPointer >(context->thisObject());

    //RView* self = getSelf("isNull", context);
    //Q_ASSERT(self!=NULL);
    if (self==NULL) {
        return REcmaHelper::throwError("self is NULL", context);
    }
    return qScriptValueFromValue(engine, self->isNull());
    }
    