1// qlistview.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QListView : QAbstractItemView
24{
25%TypeHeaderCode
26#include <qlistview.h>
27%End
28
29public:
30    enum Movement
31    {
32        Static,
33        Free,
34        Snap,
35    };
36
37    enum Flow
38    {
39        LeftToRight,
40        TopToBottom,
41    };
42
43    enum ResizeMode
44    {
45        Fixed,
46        Adjust,
47    };
48
49    enum LayoutMode
50    {
51        SinglePass,
52        Batched,
53    };
54
55    enum ViewMode
56    {
57        ListMode,
58        IconMode,
59    };
60
61    explicit QListView(QWidget *parent /TransferThis/ = 0);
62    virtual ~QListView();
63    void setMovement(QListView::Movement movement);
64    QListView::Movement movement() const;
65    void setFlow(QListView::Flow flow);
66    QListView::Flow flow() const;
67    void setWrapping(bool enable);
68    bool isWrapping() const;
69    void setResizeMode(QListView::ResizeMode mode);
70    QListView::ResizeMode resizeMode() const;
71    void setLayoutMode(QListView::LayoutMode mode);
72    QListView::LayoutMode layoutMode() const;
73    void setSpacing(int space);
74    int spacing() const;
75    void setGridSize(const QSize &size);
76    QSize gridSize() const;
77    void setViewMode(QListView::ViewMode mode);
78    QListView::ViewMode viewMode() const;
79    void clearPropertyFlags();
80    bool isRowHidden(int row) const;
81    void setRowHidden(int row, bool hide);
82    void setModelColumn(int column);
83    int modelColumn() const;
84    void setUniformItemSizes(bool enable);
85    bool uniformItemSizes() const;
86    virtual QRect visualRect(const QModelIndex &index) const;
87    virtual void scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible);
88    virtual QModelIndex indexAt(const QPoint &p) const;
89    virtual void reset();
90    virtual void setRootIndex(const QModelIndex &index);
91
92signals:
93    void indexesMoved(const QModelIndexList &indexes);
94
95protected:
96    virtual void scrollContentsBy(int dx, int dy);
97    virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>());
98    virtual void rowsInserted(const QModelIndex &parent, int start, int end);
99    virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
100    virtual bool event(QEvent *e);
101    virtual void mouseMoveEvent(QMouseEvent *e);
102    virtual void mouseReleaseEvent(QMouseEvent *e);
103    virtual void timerEvent(QTimerEvent *e);
104    virtual void resizeEvent(QResizeEvent *e);
105    virtual void dragMoveEvent(QDragMoveEvent *e);
106    virtual void dragLeaveEvent(QDragLeaveEvent *e);
107    virtual void dropEvent(QDropEvent *e);
108%If (Qt_5_6_0 -)
109    virtual void wheelEvent(QWheelEvent *e);
110%End
111    virtual void startDrag(Qt::DropActions supportedActions);
112    virtual QStyleOptionViewItem viewOptions() const;
113    virtual void paintEvent(QPaintEvent *e);
114    virtual int horizontalOffset() const;
115    virtual int verticalOffset() const;
116    virtual QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers);
117    QRect rectForIndex(const QModelIndex &index) const;
118    void setPositionForIndex(const QPoint &position, const QModelIndex &index);
119    virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command);
120    virtual QRegion visualRegionForSelection(const QItemSelection &selection) const;
121    virtual QModelIndexList selectedIndexes() const;
122    virtual void updateGeometries();
123    virtual bool isIndexHidden(const QModelIndex &index) const;
124%If (Qt_5_2_0 -)
125    virtual QSize viewportSizeHint() const;
126%End
127
128public:
129    void setBatchSize(int batchSize);
130    int batchSize() const;
131    void setWordWrap(bool on);
132    bool wordWrap() const;
133    void setSelectionRectVisible(bool show);
134    bool isSelectionRectVisible() const;
135
136protected:
137    virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
138    virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous);
139
140public:
141%If (Qt_5_12_0 -)
142    void setItemAlignment(Qt::Alignment alignment);
143%End
144%If (Qt_5_12_0 -)
145    Qt::Alignment itemAlignment() const;
146%End
147};
148