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

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

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

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

            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 RRestrictOrthogonal
        REcmaHelper::registerFunction(&engine, proto, getRRestrictOrthogonal, "getRRestrictOrthogonal");
        
        // conversion for base class RSnapRestriction
        REcmaHelper::registerFunction(&engine, proto, getRSnapRestriction, "getRSnapRestriction");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
        engine.setDefaultPrototype(
            qMetaTypeId<RRestrictVertical*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RRestrictVertical",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
     QScriptValue REcmaRestrictVertical::createEcma(QScriptContext* context, QScriptEngine* engine) 
    
    {
    if (context->thisObject().strictlyEquals(
       engine->globalObject())) {
       return REcmaHelper::throwError(
       QString::fromLatin1("RRestrictVertical(): 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: 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("RRestrictVertical: Argument 0 is not of type RDocumentInterface *RDocumentInterface *.", context);                    
                    }
                
    // end of arguments

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

    // conversion functions for base classes:
     QScriptValue REcmaRestrictVertical::getRRestrictOrthogonal(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RRestrictOrthogonal* cppResult =
                    qscriptvalue_cast<RRestrictVertical*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
             QScriptValue REcmaRestrictVertical::getRSnapRestriction(QScriptContext *context,
            QScriptEngine *engine)
        
            {
                RSnapRestriction* cppResult =
                    qscriptvalue_cast<RRestrictVertical*> (context->thisObject());
                QScriptValue result = qScriptValueFromValue(engine, cppResult);
                return result;
            }
            

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

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

        return qScriptValueFromSequence(engine, list);
    }
    

    // properties:
    

    // public methods:
     QScriptValue REcmaRestrictVertical::toString
    (QScriptContext *context, QScriptEngine *engine)
    
    {

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

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

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

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

            return self;
            


        }
        