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

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

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

    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    

    // 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, restrictSnap, "restrictSnap");
            
            REcmaHelper::registerFunction(&engine, proto, showUiOptions, "showUiOptions");
            
            REcmaHelper::registerFunction(&engine, proto, hideUiOptions, "hideUiOptions");
            
            REcmaHelper::registerFunction(&engine, proto, getLastSnap, "getLastSnap");
            
            REcmaHelper::registerFunction(&engine, proto, reset, "reset");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RSnapRestriction*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

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

    if( context->argumentCount() ==
        1
                && (
                
                        context->argument(
                        0
                        ).isVariant()
                        ||
                    
                        context->argument(
                        0
                        ).isQObject()
                        ||
                    
                        context->argument(
                        0
                        ).isNull()
                ) /* type: RDocumentInterface * */
            
    ){
    // prepare arguments:
    
                    // argument is pointer
                    RDocumentInterface * a0 = NULL;

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

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

    {
       return REcmaHelper::throwError(
       QString::fromLatin1("RSnapRestriction(): no matching constructor found."),
           context);
    }
    
    return result;
    }
    

    // conversion functions for base classes:
    

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

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

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

    // call C++ function:
    // return type 'RVector'
    RVector cppResult =
        
               self->restrictSnap(a0
        ,
    a1);
        // return type: RVector
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


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

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


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

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


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

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


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

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


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

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

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

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

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

            return self;
            


        }
        