39
40
class AbstractDocumentInfoProvider;
40
41
class AbstractThumbnailViewHelper;
42
43
struct ThumbnailViewPrivate;
43
class GWENVIEWLIB_EXPORT ThumbnailView : public QListView {
44
class GWENVIEWLIB_EXPORT ThumbnailView : public QListView
47
MinThumbnailSize = 48,
48
MaxThumbnailSize = 256
50
ThumbnailView(QWidget* parent);
53
void setThumbnailViewHelper(AbstractThumbnailViewHelper* helper);
55
AbstractThumbnailViewHelper* thumbnailViewHelper() const;
57
void setDocumentInfoProvider(AbstractDocumentInfoProvider* provider);
59
AbstractDocumentInfoProvider* documentInfoProvider() const;
62
* Returns the thumbnail size.
64
int thumbnailSize() const;
66
QPixmap thumbnailForIndex(const QModelIndex&, QSize* fullSize = 0);
69
* Returns true if the document pointed by the index has been modified
72
bool isModified(const QModelIndex&) const;
75
* Returns true if the document pointed by the index is currently busy
76
* (loading, saving, rotating...)
78
bool isBusy(const QModelIndex& index) const;
80
virtual void setModel(QAbstractItemModel* model);
83
* Publish this method so that delegates can call it.
85
using QListView::scheduleDelayedItemsLayout;
88
* Returns the current pixmap to paint when drawing a busy index.
90
QPixmap busySequenceCurrentPixmap() const;
92
void reloadThumbnail(const QModelIndex&);
49
MinThumbnailSize = 48,
50
MaxThumbnailSize = 256
52
ThumbnailView(QWidget* parent);
55
void setThumbnailViewHelper(AbstractThumbnailViewHelper* helper);
57
AbstractThumbnailViewHelper* thumbnailViewHelper() const;
59
void setDocumentInfoProvider(AbstractDocumentInfoProvider* provider);
61
AbstractDocumentInfoProvider* documentInfoProvider() const;
64
* Returns the thumbnail size.
66
int thumbnailSize() const;
68
QPixmap thumbnailForIndex(const QModelIndex&, QSize* fullSize = 0);
71
* Returns true if the document pointed by the index has been modified
74
bool isModified(const QModelIndex&) const;
77
* Returns true if the document pointed by the index is currently busy
78
* (loading, saving, rotating...)
80
bool isBusy(const QModelIndex& index) const;
82
virtual void setModel(QAbstractItemModel* model);
85
* Publish this method so that delegates can call it.
87
using QListView::scheduleDelayedItemsLayout;
90
* Returns the current pixmap to paint when drawing a busy index.
92
QPixmap busySequenceCurrentPixmap() const;
94
void reloadThumbnail(const QModelIndex&);
96
* It seems we can't use the 'activated()' signal for now because it does
97
* not know about KDE single vs doubleclick settings. The indexActivated()
100
void indexActivated(const QModelIndex&);
101
void urlListDropped(const KUrl::List& lst, const KUrl& destination);
103
void thumbnailSizeChanged(int);
106
* Emitted whenever selectionChanged() is called.
107
* This signal is suffixed with "Signal" because
108
* QAbstractItemView::selectionChanged() is a slot.
110
void selectionChangedSignal(const QItemSelection&, const QItemSelection&);
113
* Forward some signals from model, so that the delegate can use them
115
void rowsRemovedSignal(const QModelIndex& parent, int start, int end);
117
void rowsInsertedSignal(const QModelIndex& parent, int start, int end);
98
* It seems we can't use the 'activated()' signal for now because it does
99
* not know about KDE single vs doubleclick settings. The indexActivated()
100
* signal replaces it.
102
void indexActivated(const QModelIndex&);
103
void urlListDropped(const KUrl::List& lst, const KUrl& destination);
105
void thumbnailSizeChanged(int);
108
* Emitted whenever selectionChanged() is called.
109
* This signal is suffixed with "Signal" because
110
* QAbstractItemView::selectionChanged() is a slot.
112
void selectionChangedSignal(const QItemSelection&, const QItemSelection&);
115
* Forward some signals from model, so that the delegate can use them
117
void rowsRemovedSignal(const QModelIndex& parent, int start, int end);
119
void rowsInsertedSignal(const QModelIndex& parent, int start, int end);
122
* Sets the thumbnail size, in pixels.
124
void setThumbnailSize(int pixel);
123
* Sets the thumbnail size, in pixels.
125
void setThumbnailSize(int pixel);
126
void scrollToSelectedIndex();
127
void scrollToSelectedIndex();
129
virtual void dragEnterEvent(QDragEnterEvent*);
131
virtual void dragMoveEvent(QDragMoveEvent*);
133
virtual void dropEvent(QDropEvent*);
135
virtual void keyPressEvent(QKeyEvent*);
137
virtual void resizeEvent(QResizeEvent*);
139
virtual void scrollContentsBy(int dx, int dy);
141
virtual void showEvent(QShowEvent*);
143
virtual void wheelEvent(QWheelEvent*);
145
virtual void startDrag(Qt::DropActions);
130
virtual void dragEnterEvent(QDragEnterEvent*);
132
virtual void dragMoveEvent(QDragMoveEvent*);
134
virtual void dropEvent(QDropEvent*);
136
virtual void keyPressEvent(QKeyEvent*);
138
virtual void resizeEvent(QResizeEvent*);
140
virtual void scrollContentsBy(int dx, int dy);
142
virtual void showEvent(QShowEvent*);
144
virtual void wheelEvent(QWheelEvent*);
146
virtual void startDrag(Qt::DropActions);
147
148
protected Q_SLOTS:
148
virtual void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end);
149
virtual void rowsInserted(const QModelIndex& parent, int start, int end);
150
virtual void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
151
virtual void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
149
virtual void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end);
150
virtual void rowsInserted(const QModelIndex& parent, int start, int end);
151
virtual void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
152
virtual void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
154
void showContextMenu();
155
void emitIndexActivatedIfNoModifiers(const QModelIndex&);
156
void setThumbnail(const KFileItem&, const QPixmap&, const QSize&);
157
void setBrokenThumbnail(const KFileItem&);
160
* Generate thumbnail for @a index.
162
void updateThumbnail(const QModelIndex& index);
165
* Tells the view the busy state of the document pointed by the index has changed.
167
void updateThumbnailBusyState(const QModelIndex& index, bool);
170
* Cause a repaint of all busy indexes
172
void updateBusyIndexes();
174
void generateThumbnailsForVisibleItems();
175
void smoothNextThumbnail();
155
void showContextMenu();
156
void emitIndexActivatedIfNoModifiers(const QModelIndex&);
157
void setThumbnail(const KFileItem&, const QPixmap&, const QSize&);
158
void setBrokenThumbnail(const KFileItem&);
161
* Generate thumbnail for @a index.
163
void updateThumbnail(const QModelIndex& index);
166
* Tells the view the busy state of the document pointed by the index has changed.
168
void updateThumbnailBusyState(const QModelIndex& index, bool);
171
* Cause a repaint of all busy indexes
173
void updateBusyIndexes();
175
void generateThumbnailsForVisibleItems();
176
void smoothNextThumbnail();
178
friend struct ThumbnailViewPrivate;
179
ThumbnailViewPrivate * const d;
179
friend struct ThumbnailViewPrivate;
180
ThumbnailViewPrivate * const d;