<?xml version="1.0"?>
<typesystem package="com.trolltech.qt.gui">

  <rejection class="QAbstractTextDocumentLayout"/>
  <rejection class="QColormap"/>
  <rejection class="QFontDatabase"/>
  <rejection class="QIconEngineV2"/>
  <rejection class="QInputMethodEvent"/>
  <rejection class="QPainterPath::Element"/>
  <rejection class="QTextBlock::iterator"/>
  <rejection class="QTextEdit::ExtraSelection"/>
  <rejection class="QTextFrame::iterator"/>
  <rejection class="QTextLayout::FormatRange"/>
  <rejection class="QTreeWidgetItemIterator"/>

  <!-- ### the generator uses the java name -->
  <rejection class="QAccessibleFactoryInterface"/>
  <rejection class="QIconEngineFactoryInterfaceV2"/>
  <rejection class="QImageIOHandlerFactoryInterface"/>  
  <rejection class="QInputContextFactoryInterface"/>
  <rejection class="QStyleFactoryInterface"/>
  <rejection class="QTextCodecFactoryInterface"/>
  <rejection class="QPictureFormatInterface"/>

  <!-- ### these don't compile -->
  <rejection class="QAbstractProxyModel"/>
  <rejection class="QSortFilterProxyModel"/>
  <rejection class="QDirModel"/>
  <rejection class="QDrag"/>
  <rejection class="QDropEvent"/>
  <rejection class="QFileSystemModel"/>
  <rejection class="QGraphicsSceneDragDropEvent"/>
  <rejection class="QPrinterInfo"/>
  <rejection class="QProxyModel"/>
  <rejection class="QPrinterInfo"/> <!-- ### constructor takes QPrinter&, must become QPrinter* -->
  <rejection class="QTextOption"/> <!-- ### nested class QTextOption::Tab -->

  <value-type name="QTextFormat">
    <modify-function signature="setProperty(int,QVector&lt;QTextLength&gt;)" rename="setLengthVectorProperty"/>
    <inject-code class="native" position="constructor">
    if ((context-&gt;argumentCount() == 1) &amp;&amp; (qMetaTypeId&lt;QTextFormat&gt;() == context-&gt;argument(0).toVariant().userType())) {
        QTextFormat _q_arg0 = qscriptvalue_cast&lt;QTextFormat&gt;(context->argument(0));
        QTextFormat _q_cpp_result(_q_arg0);
        QScriptValue _q_result = context-&gt;engine()-&gt;newVariant(context-&gt;thisObject(), qVariantFromValue(_q_cpp_result));
        return _q_result;
    }
    </inject-code>
  </value-type>

  <value-type name="QBrush">
    <modify-function signature="QBrush(QGradient)">
      <modify-argument index="1">
        <replace-type modified-type="QGradient*"/>
        <conversion-rule class="native">
        QGradient &amp; %out% = *qscriptvalue_cast&lt;QGradient*&gt;(%in%);
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </value-type>

  <interface-type name="QGraphicsItem">
    <modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
    <modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
  </interface-type>

  <object-type name="QGraphicsItemAnimation">
    <extra-includes>
        <include file-name="QPair" location="global"/>
    </extra-includes>
  </object-type>

  <value-type name="QFontInfo">
    <modify-function signature="QFontInfo(QFontInfo)">
      <modify-argument index="1">
        <replace-type modified-type="QFontInfo*"/>
        <conversion-rule class="native">
        QFontInfo &amp; %out% = *qscriptvalue_cast&lt;QFontInfo*&gt;(%in%);
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </value-type>

  <!-- ### QFontMetrics and QFontMetricsF are value-typed but don't have default constructor -->
  <value-type name="QFontMetrics">
    <modify-function signature="QFontMetrics(QFontMetrics)" remove="all"/>
    <modify-function signature="operator==(QFontMetrics)const" remove="all"/>
    <modify-function signature="operator!=(QFontMetrics)const" remove="all"/>
  </value-type>
  <value-type name="QFontMetricsF">
    <modify-function signature="QFontMetricsF(QFontMetricsF)" remove="all"/>
    <modify-function signature="QFontMetricsF(QFontMetrics)" remove="all"/>
    <modify-function signature="operator==(QFontMetricsF)const" remove="all"/>
    <modify-function signature="operator!=(QFontMetricsF)const" remove="all"/>
  </value-type>

  <object-type name="QFontDialog">
    <inject-code class="native" position="beginning">
    Q_DECLARE_METATYPE(QScriptValue)
    </inject-code>
    <modify-function signature="getFont(bool*,QWidget*)">
        <modify-argument index="1">
          <remove-argument/>
          <conversion-rule class="native">
          <insert-template name="core.prepare_removed_bool*_argument"/>
          </conversion-rule>            
        </modify-argument>
        <modify-argument index="return">
          <conversion-rule class="native">
          <insert-template name="core.convert_to_null_or_wrap"/>
          </conversion-rule>
        </modify-argument>
    </modify-function>

    <modify-function signature="getFont(bool*,QFont,QWidget*)">
        <modify-argument index="1">
          <remove-argument/>
          <conversion-rule class="native">
          <insert-template name="core.prepare_removed_bool*_argument"/>
          </conversion-rule>            
        </modify-argument>
        <modify-argument index="return">
          <conversion-rule class="native">
          <insert-template name="core.convert_to_null_or_wrap"/>
          </conversion-rule>
        </modify-argument>
    </modify-function>

    <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
        <modify-argument index="1">
          <remove-argument/>
          <conversion-rule class="native">
          <insert-template name="core.prepare_removed_bool*_argument"/>
          </conversion-rule>            
        </modify-argument>
        <modify-argument index="return">
          <conversion-rule class="native">
          <insert-template name="core.convert_to_null_or_wrap"/>
          </conversion-rule>
        </modify-argument>
    </modify-function>
  </object-type>

  <value-type name="QImage">
    <modify-function signature="QImage(const char**)" remove="all"/>
    <modify-function signature="QImage(const uchar *,int,int,QImage::Format)" remove="all"/>
    <modify-function signature="QImage(const uchar *,int,int,int,QImage::Format)" remove="all"/>
    <modify-function signature="QImage(uchar *,int,int,QImage::Format)" remove="all"/>
    <modify-function signature="QImage(uchar *,int,int,int,QImage::Format)" remove="all"/>
    <modify-function signature="setColorTable(const QVector&lt;uint&gt;)" remove="all"/>
    <modify-function signature="loadFromData(const uchar *,int,const char *)" remove="all"/>
    <modify-function signature="fromData(const uchar *,int,const char *)" remove="all"/>
    <modify-function signature="bits()" remove="all"/>
    <modify-function signature="scanLine(int)" remove="all"/>

    <modify-function signature="QImage(QString,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="fromData(QByteArray,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="load(QString,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="load(QIODevice*,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="loadFromData(QByteArray,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="save(QString,const char*,int)const">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="save(QIODevice*,const char*,int)const">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

  </value-type>

  <object-type name="QInputDialog">
    <inject-code class="native" position="beginning">
    Q_DECLARE_METATYPE(QScriptValue)
    </inject-code>
    <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
        <modify-argument index="8">
          <remove-argument/>
          <conversion-rule class="native">
          <insert-template name="core.prepare_removed_bool*_argument"/>
          </conversion-rule>            
        </modify-argument>
        <modify-argument index="return">
          <conversion-rule class="native">
          <insert-template name="core.convert_to_null_or_primitive"/>
          </conversion-rule>
        </modify-argument>
    </modify-function>
    
    <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
        <modify-argument index="8">
          <remove-argument/>
          <conversion-rule class="native">
          <insert-template name="core.prepare_removed_bool*_argument"/>
          </conversion-rule>            
        </modify-argument>
        <modify-argument index="return">
          <conversion-rule class="native">
          <insert-template name="core.convert_to_null_or_primitive"/>
          </conversion-rule>
        </modify-argument>
    </modify-function>
      
    <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
        <modify-argument index="7">
          <remove-argument/>
          <conversion-rule class="native">
          <insert-template name="core.prepare_removed_bool*_argument"/>
          </conversion-rule>            
        </modify-argument>
        <modify-argument index="return">
          <conversion-rule class="native">
          <insert-template name="core.convert_to_null_or_primitive"/>
          </conversion-rule>
        </modify-argument>
    </modify-function>
   
    <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
        <modify-argument index="6">
          <remove-argument/>
          <conversion-rule class="native">
          <insert-template name="core.prepare_removed_bool*_argument"/>
          </conversion-rule>            
        </modify-argument>
        <modify-argument index="return">
          <conversion-rule class="native">
          <insert-template name="core.convert_to_null_or_primitive"/>
          </conversion-rule>
        </modify-argument>
    </modify-function>
  </object-type>

  <object-type name="QListWidgetItem">
    <modify-function signature="read(QDataStream &amp;)" remove="all"/>
    <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
    <modify-function signature="QListWidgetItem(QListWidgetItem)" remove="all"/>
    <modify-function signature="operator=(QListWidgetItem)" remove="all"/>
    <modify-function signature="operator&lt;(QListWidgetItem)const" remove="all"/>
  </object-type>

  <object-type name="QTableWidgetItem">
    <modify-function signature="read(QDataStream &amp;)" remove="all"/>
    <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
    <modify-function signature="QTableWidgetItem(QTableWidgetItem)" remove="all"/>
    <modify-function signature="operator=(QTableWidgetItem)" remove="all"/>
    <modify-function signature="operator&lt;(QTableWidgetItem)const" remove="all"/>
  </object-type>

  <object-type name="QTreeWidgetItem">
    <modify-function signature="read(QDataStream &amp;)" remove="all"/>
    <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem)" remove="all"/>
    <modify-function signature="operator=(QTreeWidgetItem)" remove="all"/>
    <modify-function signature="operator&lt;(QTreeWidgetItem)const" remove="all"/>
  </object-type>

  <object-type name="QStandardItem">
    <modify-function signature="read(QDataStream &amp;)" remove="all"/>
    <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
    <modify-function signature="operator=(QStandardItem)" remove="all"/>
    <modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
  </object-type>

  <object-type name="QPainter">
    <modify-function signature="fontInfo()const" remove="all"/>
    <modify-function signature="fontMetrics()const" remove="all"/>
    <modify-function signature="QPainter(QPaintDevice*)" remove="all"/>

    <modify-function signature="begin(QPaintDevice*)">
      <modify-argument index="1">
        <conversion-rule class="native">
        <insert-template name="core.convert_pointer_arg_and_check_null">
          <replace from="%TYPE%" to="QPaintDevice*"/>
          <replace from="%CLASS_NAME%" to="QPainter"/>
          <replace from="%FUNCTION_NAME%" to="begin"/>
        </insert-template>
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </object-type>

  <object-type name="QPrinter">
    <extra-includes>
        <include file-name="QPrinterInfo" location="global"/>
    </extra-includes>
  </object-type>

  <object-type name="QStyle">
    <modify-function signature="itemTextRect(QFontMetrics,QRect,int,bool,QString)const" remove="all"/>
  </object-type>

  <object-type name="QWidget">
    <modify-function signature="fontInfo()const" remove="all"/>
    <modify-function signature="fontMetrics()const" remove="all"/>
    <modify-function signature="sizeHint()const" rename="getSizeHint"/>
    <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
    <modify-function signature="setVisible(bool)" remove="all"/>
  </object-type>

  <!-- FIXME -->
  <object-type name="QCalendarWidget">
      <modify-function signature="sizeHint()const" rename="getSizeHint"/>
      <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
  </object-type>

  <object-type name="QAbstractItemView">
    <!-- ### because the CursorAction enum is protected -->
    <modify-function signature="moveCursor(QAbstractItemView::CursorAction,QFlags&lt;Qt::KeyboardModifier&gt;)" remove="all"/>
    <inject-code class="shell-declaration">
    QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers)
    { return QModelIndex(); }
    </inject-code>
  </object-type>

  <object-type name="QAbstractSlider">
    <modify-function signature="sliderChange(QAbstractSlider::SliderChange)" remove="all"/>
  </object-type>

  <object-type name="QListWidget">
    <modify-function signature="mimeData(const QList&lt;QListWidgetItem*&gt;)const" remove="all"/>
  </object-type>

  <object-type name="QTableWidget">
    <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const" remove="all"/>
  </object-type>

  <object-type name="QTreeWidget">
    <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const" remove="all"/>
  </object-type>

  <object-type name="QApplication">
    <modify-function signature="QApplication(int&amp;,char**,QApplication::Type,int)" remove="all"/>
    <modify-function signature="QApplication(int&amp;,char**,bool,int)" remove="all"/>
    <modify-function signature="QApplication(int&amp;,char**,int)" remove="all"/>
    <modify-function signature="commitData(QSessionManager&amp;)" remove="all"/>
    <modify-function signature="saveState(QSessionManager&amp;)" remove="all"/>
    <modify-function signature="fontMetrics()" remove="all"/>
    <modify-function signature="setFont(QFont,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>
    <modify-function signature="setPalette(QPalette,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </object-type>

  <value-type name="QPicture">
    <modify-function signature="setData(const char*,uint)" remove="all"/>

    <modify-function signature="load(QIODevice*,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="load(QString,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="save(QIODevice*,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="save(QString,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </value-type>

  <object-type name="QPictureIO">
    <modify-function signature="QPictureIO(QIODevice*,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="QPictureIO(QString,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="setFormat(const char*)">
      <modify-argument index="1">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="setParameters(const char*)">
      <modify-argument index="1">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </object-type>

  <value-type name="QPixmap">
    <modify-function signature="loadFromData(const uchar *,uint,const char *,QFlags&lt;Qt::ImageConversionFlag&gt;)" remove="all"/>

    <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="save(QIODevice*,const char*,int)const">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>

    <modify-function signature="save(QString,const char*,int)const">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </value-type>

  <value-type name="QBitmap">
    <modify-function signature="fromData(QSize,const uchar*,QImage::Format)" remove="all"/>

    <modify-function signature="QBitmap(QString,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="QString"/>
        <conversion-rule class="native">
          <insert-template name="core.convert_string_arg_to_char*"/>
        </conversion-rule>            
      </modify-argument>
    </modify-function>
  </value-type>

  <value-type name="QMatrix">
      <modify-function signature="inverted(bool*)const">
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
      </modify-function>
  </value-type>

  <value-type name="QTransform">
      <modify-function signature="inverted(bool*)const">
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
      </modify-function>
  </value-type>

  <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles" />
  <suppress-warning text="WARNING(MetaJavaBuilder) :: Cannot find enum constant for value 'DragMove' in 'QDragMoveEvent' or any of its super classes" />

</typesystem>
