~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/gui/itemviews/qlistview.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the item views module of the Qt Toolkit.
 
6
**
 
7
** This file may be distributed under the terms of the Q Public License
 
8
** as defined by Trolltech AS of Norway and appearing in the file
 
9
** LICENSE.QPL included in the packaging of this file.
 
10
**
 
11
** This file may be distributed and/or modified under the terms of the
 
12
** GNU General Public License version 2 as published by the Free Software
 
13
** Foundation and appearing in the file LICENSE.GPL included in the
 
14
** packaging of this file.
 
15
**
 
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
17
**   information about Qt Commercial License Agreements.
 
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
 
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
#ifndef QLISTVIEW_H
 
30
#define QLISTVIEW_H
 
31
 
 
32
#include <QtGui/qabstractitemview.h>
 
33
 
 
34
class QListViewPrivate;
 
35
 
 
36
class Q_GUI_EXPORT QListView : public QAbstractItemView
 
37
{
 
38
    Q_OBJECT
 
39
    Q_ENUMS(Movement Flow ResizeMode LayoutMode ViewMode)
 
40
    Q_PROPERTY(Movement movement READ movement WRITE setMovement)
 
41
    Q_PROPERTY(Flow flow READ flow WRITE setFlow)
 
42
    Q_PROPERTY(bool isWrapping READ isWrapping WRITE setWrapping)
 
43
    Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)
 
44
    Q_PROPERTY(LayoutMode layoutMode READ layoutMode WRITE setLayoutMode)
 
45
    Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
 
46
    Q_PROPERTY(QSize gridSize READ gridSize WRITE setGridSize)
 
47
    Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode)
 
48
    Q_PROPERTY(int modelColumn READ modelColumn WRITE setModelColumn)
 
49
 
 
50
public:
 
51
    enum Movement { Static, Free, Snap };
 
52
    enum Flow { LeftToRight, TopToBottom };
 
53
    enum ResizeMode { Fixed, Adjust };
 
54
    enum LayoutMode { SinglePass, Batched };
 
55
    enum ViewMode { ListMode, IconMode };
 
56
 
 
57
    explicit QListView(QWidget *parent = 0);
 
58
    ~QListView();
 
59
 
 
60
    void setMovement(Movement movement);
 
61
    Movement movement() const;
 
62
 
 
63
    void setFlow(Flow flow);
 
64
    Flow flow() const;
 
65
 
 
66
    void setWrapping(bool enable);
 
67
    bool isWrapping() const;
 
68
 
 
69
    void setResizeMode(ResizeMode mode);
 
70
    ResizeMode resizeMode() const;
 
71
 
 
72
    void setLayoutMode(LayoutMode mode);
 
73
    LayoutMode layoutMode() const;
 
74
 
 
75
    void setSpacing(int space);
 
76
    int spacing() const;
 
77
 
 
78
    void setGridSize(const QSize &size);
 
79
    QSize gridSize() const;
 
80
 
 
81
    void setViewMode(ViewMode mode);
 
82
    ViewMode viewMode() const;
 
83
 
 
84
    void clearPropertyFlags();
 
85
 
 
86
    bool isRowHidden(int row) const;
 
87
    void setRowHidden(int row, bool hide);
 
88
 
 
89
    void setModelColumn(int column);
 
90
    int modelColumn() const;
 
91
 
 
92
    QRect visualRect(const QModelIndex &index) const;
 
93
    void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
 
94
    QModelIndex indexAt(const QPoint &p) const;
 
95
 
 
96
    void doItemsLayout();
 
97
    void reset();
 
98
    void setRootIndex(const QModelIndex &index);
 
99
 
 
100
protected:
 
101
    QListView(QListViewPrivate &, QWidget *parent = 0);
 
102
 
 
103
    void scrollContentsBy(int dx, int dy);
 
104
 
 
105
    void resizeContents(int width, int height);
 
106
    QSize contentsSize() const;
 
107
 
 
108
    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
 
109
    void rowsInserted(const QModelIndex &parent, int start, int end);
 
110
    void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
 
111
 
 
112
    void mouseMoveEvent(QMouseEvent *e);
 
113
    void mouseReleaseEvent(QMouseEvent *e);
 
114
 
 
115
    void timerEvent(QTimerEvent *e);
 
116
    void resizeEvent(QResizeEvent *e);
 
117
    void dragMoveEvent(QDragMoveEvent *e);
 
118
    void dragLeaveEvent(QDragLeaveEvent *e);
 
119
    void dropEvent(QDropEvent *e);
 
120
    void startDrag(Qt::DropActions supportedActions);
 
121
 
 
122
    void internalDrop(QDropEvent *e);
 
123
    void internalDrag(Qt::DropActions supportedActions);
 
124
 
 
125
    QStyleOptionViewItem viewOptions() const;
 
126
    void paintEvent(QPaintEvent *e);
 
127
 
 
128
    int horizontalOffset() const;
 
129
    int verticalOffset() const;
 
130
    QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers);
 
131
    QRect rectForIndex(const QModelIndex &index) const;
 
132
 
 
133
    void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command);
 
134
    QRegion visualRegionForSelection(const QItemSelection &selection) const;
 
135
    QModelIndexList selectedIndexes() const;
 
136
 
 
137
    void updateGeometries();
 
138
 
 
139
    bool isIndexHidden(const QModelIndex &index) const;
 
140
 
 
141
private:
 
142
    Q_DECLARE_PRIVATE(QListView)
 
143
    Q_DISABLE_COPY(QListView)
 
144
};
 
145
 
 
146
#endif // QLISTVIEW_H