1
// vim: set tabstop=4 shiftwidth=4 noexpandtab
3
Gwenview - A simple image viewer for KDE
4
Copyright 2000-2004 Aur�lien G�teau
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License
8
as published by the Free Software Foundation; either version 2
9
of the License, or (at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#ifndef GVFILETHUMBNAILVIEW_H
22
#define GVFILETHUMBNAILVIEW_H
25
#include <qguardedptr.h>
29
#include <kiconview.h>
32
#include "gvfileviewbase.h"
33
#include "thumbnailsize.h"
34
#include "gvbusylevelmanager.h"
36
class QDragEnterEvent;
43
typedef QPtrList<KFileItem> KFileItemList;
45
class GVFileThumbnailViewItem;
46
class ThumbnailLoadJob;
48
class GVFileThumbnailView : public KIconView, public GVFileViewBase {
50
friend class GVFileThumbnailViewItem;
53
GVFileThumbnailView(QWidget* parent);
54
~GVFileThumbnailView();
56
QWidget* widget() { return this; }
60
void clearSelection() { QIconView::clearSelection(); }
61
void insertItem(KFileItem* item);
62
void ensureItemVisible(const KFileItem* item);
63
void setCurrentItem(const KFileItem* item);
64
void setSelected(const KFileItem* item,bool enable);
65
bool isSelected(const KFileItem* item) const;
66
void removeItem(const KFileItem* item);
67
void updateView(const KFileItem* item);
68
void setSorting(QDir::SortSpec);
70
KFileItem* firstFileItem() const;
71
KFileItem* prevItem( const KFileItem*) const;
72
KFileItem* currentFileItem() const;
73
KFileItem* nextItem( const KFileItem*) const;
76
* Don't forget to call arrangeItemsInGrid to apply the changes
78
void setThumbnailSize(ThumbnailSize value);
79
ThumbnailSize thumbnailSize() const;
82
* Don't forget to call arrangeItemsInGrid to apply the changes
84
void setMarginSize(int value);
85
int marginSize() const;
87
void readConfig(KConfig*,const QString&);
88
void writeConfig(KConfig*,const QString&) const;
90
* Used by the KParts, equivalent of readConfig(), this sets
91
* some values but just uses the defaults rather than using
96
void setShownFileItem(KFileItem*);
98
void updateThumbnail(const KFileItem*);
101
void setThumbnailPixmap(const KFileItem*,const QPixmap&, const QSize&);
102
void startThumbnailUpdate();
103
void stopThumbnailUpdate();
106
void dropped(QDropEvent*, KFileItem* target);
109
void showEvent(QShowEvent*);
110
void contentsDragEnterEvent(QDragEnterEvent*);
118
void doStartThumbnailUpdate(const KFileItemList*);
119
void setSortingKey(QIconViewItem*, const KFileItem*);
120
void updateVisibilityInfo( int x, int y );
123
void slotClicked(QIconViewItem*);
124
void slotDoubleClicked(QIconViewItem*);
125
void slotDropped(QDropEvent*);
126
void slotContentsMoving( int, int );
127
void slotCurrentChanged(QIconViewItem*);
128
void slotBusyLevelChanged( GVBusyLevel );
129
void slotUpdateEnded();