// qtablewidget.sip generated by MetaSIP on Sun Apr 21 13:02:17 2013
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2013 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt.
// 
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file.  Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
// 
// If you are unsure which license is appropriate for your use, please
// contact the sales department at sales@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


%ModuleCode
#include <qtablewidget.h>
%End

class QTableWidgetSelectionRange
{
%TypeHeaderCode
#include <qtablewidget.h>
%End

public:
    QTableWidgetSelectionRange();
    QTableWidgetSelectionRange(int top, int left, int bottom, int right);
    QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other);
    ~QTableWidgetSelectionRange();
    int topRow() const;
    int bottomRow() const;
    int leftColumn() const;
    int rightColumn() const;
    int rowCount() const;
    int columnCount() const;
};

class QTableWidgetItem /Supertype=sip.wrapper/
{
%TypeHeaderCode
#include <qtablewidget.h>
%End

public:
%If (Qt_4_2_0 -)

    enum ItemType
    {
        Type,
        UserType,
    };

%End
%If (- Qt_4_2_0)

    enum
    {
        Type,
        UserType,
    };

%End
%If (Qt_5_0_0 -)
    explicit QTableWidgetItem(int type = Type);
%End
%If (- Qt_5_0_0)
    QTableWidgetItem(int type = Type);
%End
    QTableWidgetItem(const QString &text, int type = Type);
%If (Qt_4_2_0 -)
    QTableWidgetItem(const QIcon &icon, const QString &text, int type = Type);
%End
    QTableWidgetItem(const QTableWidgetItem &other);
    virtual ~QTableWidgetItem();
    virtual QTableWidgetItem *clone() const /Factory/;
    QTableWidget *tableWidget() const;
    Qt::ItemFlags flags() const;
    QString text() const;
    QIcon icon() const;
    QString statusTip() const;
%If (PyQt_ToolTip)
    QString toolTip() const;
%End
%If (PyQt_WhatsThis)
    QString whatsThis() const;
%End
    QFont font() const;
    int textAlignment() const;
    void setTextAlignment(int alignment);
    QColor backgroundColor() const;
    void setBackgroundColor(const QColor &color);
    QColor textColor() const;
    void setTextColor(const QColor &color);
    Qt::CheckState checkState() const;
    void setCheckState(Qt::CheckState state);
    virtual QVariant data(int role) const;
    virtual void setData(int role, const QVariant &value);
    virtual bool operator<(const QTableWidgetItem &other /NoCopy/) const;
    virtual void read(QDataStream &in) /ReleaseGIL/;
    virtual void write(QDataStream &out) const /ReleaseGIL/;
    int type() const;
    void setFlags(Qt::ItemFlags aflags);
    void setText(const QString &atext);
    void setIcon(const QIcon &aicon);
    void setStatusTip(const QString &astatusTip);
%If (PyQt_ToolTip)
    void setToolTip(const QString &atoolTip);
%End
%If (PyQt_WhatsThis)
    void setWhatsThis(const QString &awhatsThis);
%End
    void setFont(const QFont &afont);
    QSize sizeHint() const;
    void setSizeHint(const QSize &size);
%If (Qt_4_2_0 -)
    QBrush background() const;
%End
%If (Qt_4_2_0 -)
    void setBackground(const QBrush &brush);
%End
%If (Qt_4_2_0 -)
    QBrush foreground() const;
%End
%If (Qt_4_2_0 -)
    void setForeground(const QBrush &brush);
%End
%If (Qt_4_2_0 -)
    int row() const;
%End
%If (Qt_4_2_0 -)
    int column() const;
%End
%If (Qt_4_2_0 -)
    void setSelected(bool aselect);
%End
%If (Qt_4_2_0 -)
    bool isSelected() const;
%End

private:
    QTableWidgetItem &operator=(const QTableWidgetItem &);
};

QDataStream &operator>>(QDataStream &in, QTableWidgetItem &item /Constrained/);
QDataStream &operator<<(QDataStream &out, const QTableWidgetItem &item /Constrained/);

class QTableWidget : QTableView
{
%TypeHeaderCode
#include <qtablewidget.h>
%End

public:
    explicit QTableWidget(QWidget *parent /TransferThis/ = 0);
    QTableWidget(int rows, int columns, QWidget *parent /TransferThis/ = 0);
    virtual ~QTableWidget();
    void setRowCount(int rows);
    int rowCount() const;
    void setColumnCount(int columns);
    int columnCount() const;
    int row(const QTableWidgetItem *item) const;
    int column(const QTableWidgetItem *item) const;
    QTableWidgetItem *item(int row, int column) const;
    void setItem(int row, int column, QTableWidgetItem *item /Transfer/);
    QTableWidgetItem *takeItem(int row, int column) /TransferBack/;
    QTableWidgetItem *verticalHeaderItem(int row) const;
    void setVerticalHeaderItem(int row, QTableWidgetItem *item /Transfer/);
    QTableWidgetItem *takeVerticalHeaderItem(int row) /TransferBack/;
    QTableWidgetItem *horizontalHeaderItem(int column) const;
    void setHorizontalHeaderItem(int column, QTableWidgetItem *item /Transfer/);
    QTableWidgetItem *takeHorizontalHeaderItem(int column) /TransferBack/;
    void setVerticalHeaderLabels(const QStringList &labels);
    void setHorizontalHeaderLabels(const QStringList &labels);
    int currentRow() const;
    int currentColumn() const;
    QTableWidgetItem *currentItem() const;
    void setCurrentItem(QTableWidgetItem *item);
%If (Qt_4_4_0 -)
    void setCurrentItem(QTableWidgetItem *item, QFlags<QItemSelectionModel::SelectionFlag> command);
%End
    void setCurrentCell(int row, int column);
%If (Qt_4_4_0 -)
    void setCurrentCell(int row, int column, QFlags<QItemSelectionModel::SelectionFlag> command);
%End
    void sortItems(int column, Qt::SortOrder order = Qt::AscendingOrder);
    void setSortingEnabled(bool enable);
    bool isSortingEnabled() const;
    void editItem(QTableWidgetItem *item);
    void openPersistentEditor(QTableWidgetItem *item);
    void closePersistentEditor(QTableWidgetItem *item);
    QWidget *cellWidget(int row, int column) const;
    void setCellWidget(int row, int column, QWidget *widget /Transfer/);
%MethodCode
        // We have to break the association with any existing widget.
        QWidget *w = sipCpp->cellWidget(a0, a1);
        
        if (w)
        {
            PyObject *wo = sipGetPyObject(w, sipType_QWidget);
        
            if (wo)
                sipTransferTo(wo, 0);
        }
        
        Py_BEGIN_ALLOW_THREADS
        sipCpp->setCellWidget(a0, a1, a2);
        Py_END_ALLOW_THREADS
%End

%If (Qt_4_3_0 -)
    void removeCellWidget(int arow, int acolumn);
%MethodCode
        // We have to break the association with any existing widget.
        QWidget *w = sipCpp->cellWidget(a0, a1);
        
        if (w)
        {
            PyObject *wo = sipGetPyObject(w, sipType_QWidget);
        
            if (wo)
                sipTransferTo(wo, 0);
        }
        
        Py_BEGIN_ALLOW_THREADS
        sipCpp->removeCellWidget(a0, a1);
        Py_END_ALLOW_THREADS
%End

%End
    bool isItemSelected(const QTableWidgetItem *item) const;
    void setItemSelected(const QTableWidgetItem *item, bool select);
    void setRangeSelected(const QTableWidgetSelectionRange &range, bool select);
    QList<QTableWidgetSelectionRange> selectedRanges() const;
%If (Qt_5_0_0 -)
    QList<QTableWidgetItem*> selectedItems() const;
%End
%If (- Qt_5_0_0)
    QList<QTableWidgetItem*> selectedItems();
%End
    QList<QTableWidgetItem*> findItems(const QString &text, Qt::MatchFlags flags) const;
    int visualRow(int logicalRow) const;
    int visualColumn(int logicalColumn) const;
    QTableWidgetItem *itemAt(const QPoint &p) const;
    QTableWidgetItem *itemAt(int ax, int ay) const;
    QRect visualItemRect(const QTableWidgetItem *item) const;
    const QTableWidgetItem *itemPrototype() const;
    void setItemPrototype(const QTableWidgetItem *item /Transfer/);

public slots:
    void scrollToItem(const QTableWidgetItem *item, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible);
    void insertRow(int row);
    void insertColumn(int column);
    void removeRow(int row);
    void removeColumn(int column);
    void clear();
%If (Qt_4_2_0 -)
    void clearContents();
%End

signals:
    void itemPressed(QTableWidgetItem *item);
    void itemClicked(QTableWidgetItem *item);
    void itemDoubleClicked(QTableWidgetItem *item);
    void itemActivated(QTableWidgetItem *item);
    void itemEntered(QTableWidgetItem *item);
    void itemChanged(QTableWidgetItem *item);
    void currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);
    void itemSelectionChanged();
    void cellPressed(int row, int column);
    void cellClicked(int row, int column);
    void cellDoubleClicked(int row, int column);
    void cellActivated(int row, int column);
    void cellEntered(int row, int column);
    void cellChanged(int row, int column);
    void currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);

protected:
    virtual QStringList mimeTypes() const;
    virtual QMimeData *mimeData(const QList<QTableWidgetItem*> items) const /TransferBack/;
    virtual bool dropMimeData(int row, int column, const QMimeData *data, Qt::DropAction action);
    virtual Qt::DropActions supportedDropActions() const;
    QList<QTableWidgetItem*> items(const QMimeData *data) const;
    QModelIndex indexFromItem(QTableWidgetItem *item) const;
    QTableWidgetItem *itemFromIndex(const QModelIndex &index) const;
    virtual bool event(QEvent *e);
%If (Qt_4_2_0 -)
    virtual void dropEvent(QDropEvent *event);
%End

private:
    virtual void setModel(QAbstractItemModel *model /KeepReference/);
    QTableWidget(const QTableWidget &);
};
