1 // vim: set tabstop=4 shiftwidth=4 noexpandtab:
3 Gwenview: an image viewer
4 Copyright 2008 Aurélien Gâteau <aurelien.gateau@free.fr>
5 Copyright 2008 Ilya Konkov <eruart@gmail.com>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
22 #ifndef THUMBNAILBARVIEW_H
23 #define THUMBNAILBARVIEW_H
26 #include <QAbstractItemDelegate>
31 #include <lib/thumbnailview/thumbnailview.h>
38 struct ThumbnailBarItemDelegatePrivate
;
40 class ThumbnailBarItemDelegate
: public QAbstractItemDelegate
{
43 ThumbnailBarItemDelegate(ThumbnailView
*);
44 ~ThumbnailBarItemDelegate();
46 virtual void paint( QPainter
* painter
, const QStyleOptionViewItem
& option
, const QModelIndex
& index
) const;
47 virtual QSize
sizeHint( const QStyleOptionViewItem
& /*option*/, const QModelIndex
& /*index*/ ) const;
51 virtual bool eventFilter(QObject
*, QEvent
*);
54 ThumbnailBarItemDelegatePrivate
* const d
;
55 friend struct ThumbnailBarItemDelegatePrivate
;
59 class ThumbnailBarView
: public ThumbnailView
{
62 ThumbnailBarView(QWidget
* = 0);
66 void paintEvent(QPaintEvent
*);
68 virtual void resizeEvent(QResizeEvent
* event
);
69 virtual void selectionChanged(const QItemSelection
& selected
, const QItemSelection
& deselected
);
75 void smoothScrollTo(const QModelIndex
& index
);
76 int horizontalScrollToValue(const QRect
& rect
);
81 #endif /* THUMBNAILBARVIEW_H */