// qabstractitemview.sip generated by MetaSIP on Fri Apr 16 11:32:08 2010
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2010 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.
// 
// Please review the following information to ensure GNU General
// Public Licensing requirements will be met:
// http://trolltech.com/products/qt/licenses/licensing/opensource/. If
// you are unsure which license is appropriate for your use, please
// review the following information:
// http://trolltech.com/products/qt/licenses/licensing/licensingoverview
// or 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 <qabstractitemview.h>
%End

class QAbstractItemView : QAbstractScrollArea
{

%TypeHeaderCode
#include <qabstractitemview.h>
%End

public:
%If (Qt_4_2_0 -)

    enum DragDropMode
    {
        NoDragDrop,
        DragOnly,
        DropOnly,
        DragDrop,
        InternalMove,
    };

%End

    enum EditTrigger
    {
        NoEditTriggers,
        CurrentChanged,
        DoubleClicked,
        SelectedClicked,
        EditKeyPressed,
        AnyKeyPressed,
        AllEditTriggers,
    };

    typedef QFlags<QAbstractItemView::EditTrigger> EditTriggers;

    enum ScrollHint
    {
        EnsureVisible,
        PositionAtTop,
        PositionAtBottom,
%If (Qt_4_2_0 -)
        PositionAtCenter,
%End
    };

%If (Qt_4_2_0 -)

    enum ScrollMode
    {
        ScrollPerItem,
        ScrollPerPixel,
    };

%End

    enum SelectionBehavior
    {
        SelectItems,
        SelectRows,
        SelectColumns,
    };

    enum SelectionMode
    {
        NoSelection,
        SingleSelection,
        MultiSelection,
        ExtendedSelection,
        ContiguousSelection,
    };

    explicit QAbstractItemView(QWidget *parent /TransferThis/ = 0);
    virtual ~QAbstractItemView();
    virtual void setModel(QAbstractItemModel * /KeepReference/);
    QAbstractItemModel *model() const;
    virtual void setSelectionModel(QItemSelectionModel * /KeepReference/);
    QItemSelectionModel *selectionModel() const;
    void setItemDelegate(QAbstractItemDelegate * /KeepReference/);
    QAbstractItemDelegate *itemDelegate() const;
    void setSelectionMode(QAbstractItemView::SelectionMode);
    QAbstractItemView::SelectionMode selectionMode() const;
    void setSelectionBehavior(QAbstractItemView::SelectionBehavior);
    QAbstractItemView::SelectionBehavior selectionBehavior() const;
    QModelIndex currentIndex() const;
    QModelIndex rootIndex() const;
    void setEditTriggers(QFlags<QAbstractItemView::EditTrigger>);
    QFlags<QAbstractItemView::EditTrigger> editTriggers() const;
    void setAutoScroll(bool);
    bool hasAutoScroll() const;
    void setTabKeyNavigation(bool);
    bool tabKeyNavigation() const;
    void setDropIndicatorShown(bool);
    bool showDropIndicator() const;
    void setDragEnabled(bool);
    bool dragEnabled() const;
    void setAlternatingRowColors(bool);
    bool alternatingRowColors() const;
    void setIconSize(const QSize &);
    QSize iconSize() const;
    void setTextElideMode(Qt::TextElideMode);
    Qt::TextElideMode textElideMode() const;
    virtual void keyboardSearch(const QString &);
    virtual QRect visualRect(const QModelIndex &) const = 0;
    virtual void scrollTo(const QModelIndex &, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible) = 0;
    virtual QModelIndex indexAt(const QPoint &) const = 0;
    QSize sizeHintForIndex(const QModelIndex &) const;
    virtual int sizeHintForRow(int) const;
    virtual int sizeHintForColumn(int) const;
    void openPersistentEditor(const QModelIndex &);
    void closePersistentEditor(const QModelIndex &);
    void setIndexWidget(const QModelIndex &, QWidget * /Transfer/);
%MethodCode
        // We have to break the association with any existing widget.
        QWidget *w = sipCpp->indexWidget(*a0);
        
        if (w)
        {
            PyObject *wo = sipGetPyObject(w, sipType_QWidget);
        
            if (wo)
                sipTransferBreak(wo);
        }
        
        Py_BEGIN_ALLOW_THREADS
        sipCpp->setIndexWidget(*a0, a1);
        Py_END_ALLOW_THREADS
%End

    QWidget *indexWidget(const QModelIndex &) const;

public slots:
    virtual void reset();
    virtual void setRootIndex(const QModelIndex &);
    virtual void doItemsLayout();
    virtual void selectAll();
    void edit(const QModelIndex &);
    void clearSelection();
    void setCurrentIndex(const QModelIndex &);
    void scrollToTop();
    void scrollToBottom();
%If (Qt_4_3_0 -)
    void update();
%End
%If (Qt_4_3_0 -)
    void update(const QModelIndex &);
%End

protected slots:
    virtual void dataChanged(const QModelIndex &, const QModelIndex &);
    virtual void rowsInserted(const QModelIndex &, int, int);
    virtual void rowsAboutToBeRemoved(const QModelIndex &, int, int);
    virtual void selectionChanged(const QItemSelection &, const QItemSelection &);
    virtual void currentChanged(const QModelIndex &, const QModelIndex &);
    virtual void updateEditorData();
    virtual void updateEditorGeometries();
    virtual void updateGeometries();
    virtual void verticalScrollbarAction(int);
    virtual void horizontalScrollbarAction(int);
    virtual void verticalScrollbarValueChanged(int);
    virtual void horizontalScrollbarValueChanged(int);
    virtual void closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint);
    virtual void commitData(QWidget *);
    virtual void editorDestroyed(QObject *);

signals:
    void pressed(const QModelIndex &);
    void clicked(const QModelIndex &);
    void doubleClicked(const QModelIndex &);
    void activated(const QModelIndex &);
    void entered(const QModelIndex &);
    void viewportEntered();

protected:
    void setHorizontalStepsPerItem(int);
    int horizontalStepsPerItem() const;
    void setVerticalStepsPerItem(int);
    int verticalStepsPerItem() const;

    enum CursorAction
    {
        MoveUp,
        MoveDown,
        MoveLeft,
        MoveRight,
        MoveHome,
        MoveEnd,
        MovePageUp,
        MovePageDown,
        MoveNext,
        MovePrevious,
    };

    virtual QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers) = 0;
    virtual int horizontalOffset() const = 0;
    virtual int verticalOffset() const = 0;
    virtual bool isIndexHidden(const QModelIndex &) const = 0;
    virtual void setSelection(const QRect &, QFlags<QItemSelectionModel::SelectionFlag>) = 0;
    virtual QRegion visualRegionForSelection(const QItemSelection &) const = 0;
    virtual QModelIndexList selectedIndexes() const;
    virtual bool edit(const QModelIndex &, QAbstractItemView::EditTrigger, QEvent *);
    virtual QFlags<QItemSelectionModel::SelectionFlag> selectionCommand(const QModelIndex &, const QEvent *event = 0) const;
    virtual void startDrag(Qt::DropActions);
    virtual QStyleOptionViewItem viewOptions() const;

    enum State
    {
        NoState,
        DraggingState,
        DragSelectingState,
        EditingState,
        ExpandingState,
        CollapsingState,
%If (Qt_4_2_0 -)
        AnimatingState,
%End
    };

    QAbstractItemView::State state() const;
    void setState(QAbstractItemView::State);
    void scheduleDelayedItemsLayout();
    void executeDelayedItemsLayout();
    void scrollDirtyRegion(int, int);
    void setDirtyRegion(const QRegion &);
    QPoint dirtyRegionOffset() const;
    virtual bool event(QEvent *);
    virtual bool viewportEvent(QEvent *);
    virtual void mousePressEvent(QMouseEvent *);
    virtual void mouseMoveEvent(QMouseEvent *);
    virtual void mouseReleaseEvent(QMouseEvent *);
    virtual void mouseDoubleClickEvent(QMouseEvent *);
    virtual void dragEnterEvent(QDragEnterEvent *);
    virtual void dragMoveEvent(QDragMoveEvent *);
    virtual void dragLeaveEvent(QDragLeaveEvent *);
    virtual void dropEvent(QDropEvent *);
    virtual void focusInEvent(QFocusEvent *);
    virtual void focusOutEvent(QFocusEvent *);
    virtual void keyPressEvent(QKeyEvent *);
    virtual void resizeEvent(QResizeEvent *);
    virtual void timerEvent(QTimerEvent *);

    enum DropIndicatorPosition
    {
        OnItem,
        AboveItem,
        BelowItem,
        OnViewport,
    };

    QAbstractItemView::DropIndicatorPosition dropIndicatorPosition() const;

public:
%If (Qt_4_2_0 -)
    void setVerticalScrollMode(QAbstractItemView::ScrollMode);
%End
%If (Qt_4_2_0 -)
    QAbstractItemView::ScrollMode verticalScrollMode() const;
%End
%If (Qt_4_2_0 -)
    void setHorizontalScrollMode(QAbstractItemView::ScrollMode);
%End
%If (Qt_4_2_0 -)
    QAbstractItemView::ScrollMode horizontalScrollMode() const;
%End
%If (Qt_4_2_0 -)
    void setDragDropOverwriteMode(bool);
%End
%If (Qt_4_2_0 -)
    bool dragDropOverwriteMode() const;
%End
%If (Qt_4_2_0 -)
    void setDragDropMode(QAbstractItemView::DragDropMode);
%End
%If (Qt_4_2_0 -)
    QAbstractItemView::DragDropMode dragDropMode() const;
%End
%If (Qt_4_2_0 -)
    void setItemDelegateForRow(int, QAbstractItemDelegate *);
%End
%If (Qt_4_2_0 -)
    QAbstractItemDelegate *itemDelegateForRow(int) const;
%End
%If (Qt_4_2_0 -)
    void setItemDelegateForColumn(int, QAbstractItemDelegate *);
%End
%If (Qt_4_2_0 -)
    QAbstractItemDelegate *itemDelegateForColumn(int) const;
%End
%If (Qt_4_2_0 -)
    QAbstractItemDelegate *itemDelegate(const QModelIndex &) const;
%End
%If (Qt_4_2_0 -)
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery) const;
%End
%If (Qt_4_4_0 -)
    void setAutoScrollMargin(int);
%End
%If (Qt_4_4_0 -)
    int autoScrollMargin() const;
%End

protected:
%If (Qt_4_2_0 -)
    virtual bool focusNextPrevChild(bool);
%End
%If (Qt_4_2_0 -)
    virtual void inputMethodEvent(QInputMethodEvent *);
%End

public:
%If (Qt_4_6_0 -)
    void setDefaultDropAction(Qt::DropAction);
%End
%If (Qt_4_6_0 -)
    Qt::DropAction defaultDropAction() const;
%End

private:
    QAbstractItemView(const QAbstractItemView &);
};

QFlags<QAbstractItemView::EditTrigger> operator|(QAbstractItemView::EditTrigger, QFlags<QAbstractItemView::EditTrigger>);
