


	// ***** AUTOGENERATED CODE, DO NOT EDIT *****
    
        #include "REcmaShellFileImporterFactoryAdapter.h"
        #include "RMetaTypes.h"
        #include "../REcmaHelper.h"

        // forwards declarations mapped to includes
        
                #include "RFileImporter.h"
            
                #include "RMessageHandler.h"
            
                #include "RProgressHandler.h"
            
            
        // includes for base ecma wrapper classes
        
            #include "REcmaFileImporterFactory.h"
          

            #define QTSCRIPT_IS_GENERATED_FUNCTION(fun) ((fun.data().toUInt32() & 0xFFFF0000) == 0xBABE0000)
            #define QTSCRIPT_IS_FUNCTION_IN_CALL(fun) ((fun.data().toUInt32() & 0x0000F000) == 0x0000B000)

        
    // Destructor:
    REcmaShellFileImporterFactoryAdapter::~REcmaShellFileImporterFactoryAdapter() {}
        RFileImporterFactoryAdapter* REcmaShellFileImporterFactoryAdapter::getSelf(const QString& fName, QScriptContext* context)
    
        {
            RFileImporterFactoryAdapter* 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<RFileImporterFactoryAdapter >(context->thisObject())
                
                ;
            //}

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

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

            return self;
            


        }
        
    
    
      QStringList REcmaShellFileImporterFactoryAdapter::getFilterStrings(
                
            ) {
                QScriptEngine* engine = __qtscript_self.engine();
                //REcmaHelper::shellFunctionStart("REcmaShellFileImporterFactoryAdapter::getFilterStrings", engine);
                QScriptValue _q_function = __qtscript_self.property("getFilterStrings");



                if (!_q_function.isFunction() || 
                    QTSCRIPT_IS_GENERATED_FUNCTION(_q_function) ||
                    QTSCRIPT_IS_FUNCTION_IN_CALL(_q_function)
                    
                    /* function might have more arguments than expected:
                    || _q_function.property("length").toInt32()!=0*/
                    /*|| (__qtscript_self.propertyFlags("atEnd") & QScriptValue::QObjectMember)*/
                    ) {
                    //QString cppSig = "RFileImporterFactoryAdapter::getFilterStrings";
                    
                        // re-enable recursion for calls from C++ into ECMAScript functions
                        // leave it marked as generated though if appropriate:
                        
                        quint32 prev = _q_function.data().toUInt32();
                        //if (cppSig!="RGraphicsViewQt::event") {
                            _q_function.setData(QScriptValue(engine, prev & 0xFFFF0000));
                        //}
                        QStringList ret =
                        RFileImporterFactoryAdapter::getFilterStrings(
                            
                        );

                        // block recursion again:
                        _q_function.setData(QScriptValue(engine, prev));

                        //REcmaHelper::shellFunctionEnd("REcmaShellFileImporterFactoryAdapter::getFilterStrings", engine);

                        
                            return ret;
                          
                }
                    // prevent recursion if script implementation calls base implementation
                    // mark function as 'in call':
                    quint32 prev = _q_function.data().toUInt32();
                    _q_function.setData(QScriptValue(engine, uint(prev | 0x0000B000)));
                    QStringList res;
                      
                          res = qscriptvalue_cast< 
                            QStringList
                          >(
                        
                            _q_function.call(__qtscript_self)
                        
                      )
                    
                    ;
                    _q_function.setData(QScriptValue(engine, prev));

                    //REcmaHelper::shellFunctionEnd("REcmaShellFileImporterFactoryAdapter::getFilterStrings", engine);

                    
                            return res;
                          
            }
        
    
    
      int REcmaShellFileImporterFactoryAdapter::canImport(
                const QString & fileName, const QString & nameFilter
            ) {
                QScriptEngine* engine = __qtscript_self.engine();
                //REcmaHelper::shellFunctionStart("REcmaShellFileImporterFactoryAdapter::canImport", engine);
                QScriptValue _q_function = __qtscript_self.property("canImport");



                if (!_q_function.isFunction() || 
                    QTSCRIPT_IS_GENERATED_FUNCTION(_q_function) ||
                    QTSCRIPT_IS_FUNCTION_IN_CALL(_q_function)
                    
                    /* function might have more arguments than expected:
                    || _q_function.property("length").toInt32()!=2*/
                    /*|| (__qtscript_self.propertyFlags("atEnd") & QScriptValue::QObjectMember)*/
                    ) {
                    //QString cppSig = "RFileImporterFactoryAdapter::canImport";
                    
                        // re-enable recursion for calls from C++ into ECMAScript functions
                        // leave it marked as generated though if appropriate:
                        
                        quint32 prev = _q_function.data().toUInt32();
                        //if (cppSig!="RGraphicsViewQt::event") {
                            _q_function.setData(QScriptValue(engine, prev & 0xFFFF0000));
                        //}
                        int ret =
                        RFileImporterFactoryAdapter::canImport(
                            fileName, nameFilter
                        );

                        // block recursion again:
                        _q_function.setData(QScriptValue(engine, prev));

                        //REcmaHelper::shellFunctionEnd("REcmaShellFileImporterFactoryAdapter::canImport", engine);

                        
                            return ret;
                          
                }
                    // prevent recursion if script implementation calls base implementation
                    // mark function as 'in call':
                    quint32 prev = _q_function.data().toUInt32();
                    _q_function.setData(QScriptValue(engine, uint(prev | 0x0000B000)));
                    int res;
                      
                          res = qscriptvalue_cast< 
                            int
                          >(
                        
                            _q_function.call(__qtscript_self,
                                QScriptValueList()
                                



    // type: QString &, copyable: true
        << qScriptValueFromValue(engine, 

        fileName
        )
      



    // type: QString &, copyable: true
        << qScriptValueFromValue(engine, 

        nameFilter
        )
      
                            )
                        
                      )
                    
                    ;
                    _q_function.setData(QScriptValue(engine, prev));

                    //REcmaHelper::shellFunctionEnd("REcmaShellFileImporterFactoryAdapter::canImport", engine);

                    
                            return res;
                          
            }
        
    
    
      RFileImporter * REcmaShellFileImporterFactoryAdapter::instantiate(
                RDocument & document, RMessageHandler * messageHandler, RProgressHandler * progressHandler
            ) {
                QScriptEngine* engine = __qtscript_self.engine();
                //REcmaHelper::shellFunctionStart("REcmaShellFileImporterFactoryAdapter::instantiate", engine);
                QScriptValue _q_function = __qtscript_self.property("instantiate");



                if (!_q_function.isFunction() || 
                    QTSCRIPT_IS_GENERATED_FUNCTION(_q_function) ||
                    QTSCRIPT_IS_FUNCTION_IN_CALL(_q_function)
                    
                    /* function might have more arguments than expected:
                    || _q_function.property("length").toInt32()!=3*/
                    /*|| (__qtscript_self.propertyFlags("atEnd") & QScriptValue::QObjectMember)*/
                    ) {
                    //QString cppSig = "RFileImporterFactoryAdapter::instantiate";
                    
                        // re-enable recursion for calls from C++ into ECMAScript functions
                        // leave it marked as generated though if appropriate:
                        
                        quint32 prev = _q_function.data().toUInt32();
                        //if (cppSig!="RGraphicsViewQt::event") {
                            _q_function.setData(QScriptValue(engine, prev & 0xFFFF0000));
                        //}
                        RFileImporter * ret =
                        RFileImporterFactoryAdapter::instantiate(
                            document, messageHandler, progressHandler
                        );

                        // block recursion again:
                        _q_function.setData(QScriptValue(engine, prev));

                        //REcmaHelper::shellFunctionEnd("REcmaShellFileImporterFactoryAdapter::instantiate", engine);

                        
                            return ret;
                          
                }
                    // prevent recursion if script implementation calls base implementation
                    // mark function as 'in call':
                    quint32 prev = _q_function.data().toUInt32();
                    _q_function.setData(QScriptValue(engine, uint(prev | 0x0000B000)));
                    RFileImporter * res;
                      
                          res = qscriptvalue_cast< 
                            RFileImporter *
                          >(
                        
                            _q_function.call(__qtscript_self,
                                QScriptValueList()
                                



    // type: RDocument &, copyable: false
        << qScriptValueFromValue(engine, 

        &document
        )
      



    // type: RMessageHandler *, copyable: false
        << qScriptValueFromValue(engine, 

        messageHandler
        )
      



    // type: RProgressHandler *, copyable: false
        << qScriptValueFromValue(engine, 

        progressHandler
        )
      
                            )
                        
                      )
                    
                    ;
                    _q_function.setData(QScriptValue(engine, prev));

                    //REcmaHelper::shellFunctionEnd("REcmaShellFileImporterFactoryAdapter::instantiate", engine);

                    
                            return res;
                          
            }
        
    
  
        // methods of 1st level base class RFileImporterFactory:
        

    // protected methods (only available for ECMA shell classes) (generated by xsl2xpp.xsl):
	