


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

        // forwards declarations mapped to includes
        
            
        // includes for base ecma wrapper classes
        

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

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

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

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

            return self;
            


        }
        
    
    
    // Constructors:
    
      REcmaShellToolMatrixItemDelegate::REcmaShellToolMatrixItemDelegate(
                QTreeView * view, QWidget * parent
            ) : RToolMatrixItemDelegate(
                view, parent
                ) {
            }
        
    
    
      void REcmaShellToolMatrixItemDelegate::paint(
                QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index
            ) {
                QScriptEngine* engine = __qtscript_self.engine();
                //REcmaHelper::shellFunctionStart("REcmaShellToolMatrixItemDelegate::paint", engine);
                QScriptValue _q_function = __qtscript_self.property("paint");



                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 = "RToolMatrixItemDelegate::paint";
                    
                        // 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));
                        //}
                        RToolMatrixItemDelegate::paint(
                            painter, option, index
                        );

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

                        //REcmaHelper::shellFunctionEnd("REcmaShellToolMatrixItemDelegate::paint", engine);

                        
                            return;
                          
                }
                    // 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)));
                    
                            _q_function.call(__qtscript_self,
                                QScriptValueList()
                                



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

        painter
        )
      



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

        
            // const reference argument - make a new object:
            new QStyleOptionViewItem(option)
        )
      



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

        
            // const reference argument - make a new object:
            new QModelIndex(index)
        )
      
                            )
                        
                    ;
                    _q_function.setData(QScriptValue(engine, prev));

                    //REcmaHelper::shellFunctionEnd("REcmaShellToolMatrixItemDelegate::paint", engine);

                    
            }
        
    
    
      QSize REcmaShellToolMatrixItemDelegate::sizeHint(
                const QStyleOptionViewItem & opt, const QModelIndex & index
            ) {
                QScriptEngine* engine = __qtscript_self.engine();
                //REcmaHelper::shellFunctionStart("REcmaShellToolMatrixItemDelegate::sizeHint", engine);
                QScriptValue _q_function = __qtscript_self.property("sizeHint");



                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 = "RToolMatrixItemDelegate::sizeHint";
                    
                        // 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));
                        //}
                        QSize ret =
                        RToolMatrixItemDelegate::sizeHint(
                            opt, index
                        );

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

                        //REcmaHelper::shellFunctionEnd("REcmaShellToolMatrixItemDelegate::sizeHint", 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)));
                    QSize res;
                      
                          res = qscriptvalue_cast< 
                            QSize
                          >(
                        
                            _q_function.call(__qtscript_self,
                                QScriptValueList()
                                



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

        
            // const reference argument - make a new object:
            new QStyleOptionViewItem(opt)
        )
      



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

        
            // const reference argument - make a new object:
            new QModelIndex(index)
        )
      
                            )
                        
                      )
                    
                    ;
                    _q_function.setData(QScriptValue(engine, prev));

                    //REcmaHelper::shellFunctionEnd("REcmaShellToolMatrixItemDelegate::sizeHint", engine);

                    
                            return res;
                          
            }
        
    
  

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