SVN_SILENT made messages (.desktop file)
[kdegraphics.git] / gwenview / app / thumbnailbarview.h
blobeeb6a4be800b4f5c4cd2781561d9504caccc9739
1 // vim: set tabstop=4 shiftwidth=4 noexpandtab:
2 /*
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
25 // Qt
26 #include <QAbstractItemDelegate>
28 // KDE
30 // Local
31 #include <lib/thumbnailview/thumbnailview.h>
33 class QTimeLine;
35 namespace Gwenview {
38 struct ThumbnailBarItemDelegatePrivate;
40 class ThumbnailBarItemDelegate : public QAbstractItemDelegate {
41 Q_OBJECT
42 public:
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;
50 protected:
51 virtual bool eventFilter(QObject*, QEvent*);
53 private:
54 ThumbnailBarItemDelegatePrivate* const d;
55 friend struct ThumbnailBarItemDelegatePrivate;
59 class ThumbnailBarView : public ThumbnailView {
60 Q_OBJECT
61 public:
62 ThumbnailBarView(QWidget* = 0);
63 ~ThumbnailBarView();
65 protected:
66 void paintEvent(QPaintEvent*);
68 virtual void resizeEvent(QResizeEvent * event);
69 virtual void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
71 private:
72 QStyle* mStyle;
73 QTimeLine* mTimeLine;
75 void smoothScrollTo(const QModelIndex& index);
76 int horizontalScrollToValue(const QRect& rect);
79 } // namespace
81 #endif /* THUMBNAILBARVIEW_H */