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

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

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

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

            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 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, getProperty, "getProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");
            
            REcmaHelper::registerFunction(&engine, proto, clear, "clear");
            
            REcmaHelper::registerFunction(&engine, proto, getCustomPropertyTypeIds, "getCustomPropertyTypeIds");
            
            REcmaHelper::registerFunction(&engine, proto, setKnownVariable, "setKnownVariable");
            
            REcmaHelper::registerFunction(&engine, proto, getKnownVariable, "getKnownVariable");
            
            REcmaHelper::registerFunction(&engine, proto, hasKnownVariable, "hasKnownVariable");
            
            REcmaHelper::registerFunction(&engine, proto, getCurrentLayerId, "getCurrentLayerId");
            
            REcmaHelper::registerFunction(&engine, proto, setCurrentLayerId, "setCurrentLayerId");
            
            REcmaHelper::registerFunction(&engine, proto, getUnit, "getUnit");
            
            REcmaHelper::registerFunction(&engine, proto, setUnit, "setUnit");
            
            REcmaHelper::registerFunction(&engine, proto, getMeasurement, "getMeasurement");
            
            REcmaHelper::registerFunction(&engine, proto, setMeasurement, "setMeasurement");
            
            REcmaHelper::registerFunction(&engine, proto, getLinetypeScale, "getLinetypeScale");
            
            REcmaHelper::registerFunction(&engine, proto, setLinetypeScale, "setLinetypeScale");
            
            REcmaHelper::registerFunction(&engine, proto, getDimensionFont, "getDimensionFont");
            
            REcmaHelper::registerFunction(&engine, proto, setDimensionFont, "setDimensionFont");
            
            REcmaHelper::registerFunction(&engine, proto, addAutoVariable, "addAutoVariable");
            
            REcmaHelper::registerFunction(&engine, proto, getAutoVariables, "getAutoVariables");
            
            REcmaHelper::registerFunction(&engine, proto, print, "print");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RDocumentVariables*>(), *proto);

        
    

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

    // static properties:
    
            ctor.setProperty("PropertyCustom",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyCustom),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyHandle",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyHandle),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyProtected",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyProtected),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyCurrentLayerId",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyCurrentLayerId),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyUnit",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyUnit),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyLinetypeScale",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyLinetypeScale),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyDimensionFont",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyDimensionFont),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyWorkingSetBlockReferenceId",
                qScriptValueFromValue(&engine, RDocumentVariables::PropertyWorkingSetBlockReferenceId),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RDocumentVariables",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
     QScriptValue REcmaDocumentVariables::createEcma(QScriptContext* context, QScriptEngine* engine) 
    
    {
    if (context->thisObject().strictlyEquals(
       engine->globalObject())) {
       return REcmaHelper::throwError(
       QString::fromLatin1("RDocumentVariables(): Did you forget to construct with 'new'?"),
           context);
    }

    QScriptValue result;
        
            // generate constructor variants:
            
    if( context->argumentCount() ==
        1
                && (
                
                        context->argument(
                        0
                        ).isVariant()
                        ||
                    
                        context->argument(
                        0
                        ).isQObject()
                        ||
                    
                        context->argument(
                        0
                        ).isNull()
                ) /* type: RDocument * */
            
    ){
    // 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("RDocumentVariables: Argument 0 is not of type RDocument *RDocument *.", context);                    
                    }
                
    // end of arguments

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

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

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

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

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

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* 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 RDocumentVariables.getType().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaDocumentVariables::getType", context, engine);
            return result;
        }
         QScriptValue
        REcmaDocumentVariables::clone
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaDocumentVariables::clone", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaDocumentVariables::clone";
            //QCoreApplication::processEvents();

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* 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("RDocumentVariables: 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("RDocumentVariables: 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("RDocumentVariables: 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("RDocumentVariables: 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 RDocumentVariables.getProperty().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaDocumentVariables::getProperty", context, engine);
            return result;
        }
         QScriptValue
        REcmaDocumentVariables::setProperty
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaDocumentVariables::setProperty", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaDocumentVariables::setProperty";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* 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("RDocumentVariables: 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("RDocumentVariables: 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("RDocumentVariables: 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 RDocumentVariables.setProperty().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaDocumentVariables::setProperty", context, engine);
            return result;
        }
         QScriptValue
        REcmaDocumentVariables::clear
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaDocumentVariables::clear", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaDocumentVariables::clear";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* self = 
                        getSelf("clear", 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 'void'
    
               self->clear();
    } else


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* self = 
                        getSelf("getCustomPropertyTypeIds", 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 'QSet < RPropertyTypeId >'
    QSet < RPropertyTypeId > cppResult =
        
               self->getCustomPropertyTypeIds();
        // return type: QSet < RPropertyTypeId >
                // QSet (convert to QVariantList):
                result = REcmaHelper::setToScriptValue(engine, cppResult);

                
    } else


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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isNumber()
        ) /* type: RS::KnownVariable */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNull()
        ) /* type: RVector */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    RS::KnownVariable
                    a0 =
                    (RS::KnownVariable)
                    (int)
                    context->argument( 0 ).
                    toNumber();
                
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RVector*
                    ap1 =
                    qscriptvalue_cast<
                    RVector*
                        >(
                        context->argument(
                        1
                        )
                    );
                    if (ap1 == NULL) {
                           return REcmaHelper::throwError("RDocumentVariables: Argument 1 is not of type RVector.",
                               context);                    
                    }
                    RVector 
                    a1 = 
                    *ap1;
                
    // end of arguments

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


        
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isNumber()
        ) /* type: RS::KnownVariable */
     && (
            context->argument(1).isVariant() || 
            context->argument(1).isQObject() || 
            context->argument(1).isNull()
        ) /* type: RColor */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    RS::KnownVariable
                    a0 =
                    (RS::KnownVariable)
                    (int)
                    context->argument( 0 ).
                    toNumber();
                
                    // argument isCopyable and has default constructor and isSimpleClass 
                    RColor*
                    ap1 =
                    qscriptvalue_cast<
                    RColor*
                        >(
                        context->argument(
                        1
                        )
                    );
                    if (ap1 == NULL) {
                           return REcmaHelper::throwError("RDocumentVariables: Argument 1 is not of type RColor.",
                               context);                    
                    }
                    RColor 
                    a1 = 
                    *ap1;
                
    // end of arguments

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


        
    
    if( context->argumentCount() ==
    2 && (
            context->argument(0).isNumber()
        ) /* type: RS::KnownVariable */
     && (
            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 isStandardType
                    RS::KnownVariable
                    a0 =
                    (RS::KnownVariable)
                    (int)
                    context->argument( 0 ).
                    toNumber();
                
                    // argument isCopyable or pointer
                    QVariant
                    a1 =
                    qscriptvalue_cast<
                    QVariant
                        >(
                        context->argument(
                        1
                        )
                    );
                
    // end of arguments

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


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

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

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

    // call C++ function:
    // return type 'QVariant'
    QVariant cppResult =
        
               self->getKnownVariable(a0);
        // return type: QVariant
                // QVariant:
                result = REcmaHelper::toScriptValue(engine, cppResult);
            
    } else


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

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

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

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


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

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


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

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

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

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


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

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


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

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

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

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


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

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


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

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

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

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


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

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* self = 
                        getSelf("setLinetypeScale", 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->setLinetypeScale(a0);
    } else


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

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* self = 
                        getSelf("setDimensionFont", 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->setDimensionFont(a0);
    } else


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

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


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

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


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

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RDocumentVariables* self = 
                        getSelf("print", 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: QDebug */
    
    ){
    // prepare arguments:
    
                    // argument is reference
                    QDebug*
                    ap0 =
                    qscriptvalue_cast<
                    QDebug*
                        >(
                        context->argument(
                        0
                        )
                    );
                    if( ap0 == NULL ){
                           return REcmaHelper::throwError("RDocumentVariables: Argument 0 is not of type QDebug*.",
                               context);                    
                    }
                    QDebug& a0 = *ap0;
                
    // end of arguments

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


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

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

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

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

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

            return self;
            


        }
        