~ubuntu-branches/ubuntu/warty/gwenview/warty

« back to all changes in this revision

Viewing changes to gwenview/filethumbnailview.h

  • Committer: Bazaar Package Importer
  • Author(s): Christopher Martin
  • Date: 2004-06-13 18:55:04 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040613185504-net8ekxoswwvyxs9
Tags: 1.1.3-1
New upstream release. Translations now included.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Gwenview - A simple image viewer for KDE
3
 
Copyright (C) 2000-2002 Aur�lien G�teau
4
 
 
5
 
This program is free software; you can redistribute it and/or
6
 
modify it under the terms of the GNU General Public License
7
 
as published by the Free Software Foundation; either version 2
8
 
of the License, or (at your option) any later version.
9
 
 
10
 
This program is distributed in the hope that it will be useful,
11
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
GNU General Public License for more details.
14
 
 
15
 
You should have received a copy of the GNU General Public License
16
 
along with this program; if not, write to the Free Software
17
 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
 
 
19
 
*/
20
 
#ifndef FILETHUMBNAILVIEW_H
21
 
#define FILETHUMBNAILVIEW_H
22
 
 
23
 
// Qt includes
24
 
#include <qguardedptr.h>
25
 
#include <qiconview.h>
26
 
 
27
 
// KDE includes
28
 
#include <kfileview.h>
29
 
 
30
 
// Our includes
31
 
#include "browsablefileview.h"
32
 
#include "thumbnailsize.h"
33
 
 
34
 
 
35
 
class QPopupMenu;
36
 
 
37
 
class KConfig;
38
 
class KFileViewItem;
39
 
 
40
 
class ThumbnailLoadJob;
41
 
 
42
 
 
43
 
class FileThumbnailView : public QIconView, public KFileView, public BrowsableFileView {
44
 
Q_OBJECT
45
 
public:
46
 
        FileThumbnailView(QWidget* parent);
47
 
        ~FileThumbnailView();
48
 
        
49
 
        QWidget* widget() { return this; }
50
 
        void clearView();
51
 
        void clearSelection() { QIconView::clearSelection(); }
52
 
 
53
 
        void insertItem(KFileViewItem* item);
54
 
        void ensureItemVisible(const KFileViewItem* item);
55
 
        void setSelected(const KFileViewItem* item,bool enable);
56
 
        bool isSelected(const KFileViewItem* item) const;
57
 
        void removeItem(const KFileViewItem* item);
58
 
        void startThumbnailUpdate();
59
 
        void stopThumbnailUpdate();
60
 
 
61
 
// Browsable methods
62
 
        void selectFirst();
63
 
        void selectLast();
64
 
        void selectPrevious();
65
 
        void selectNext();
66
 
        
67
 
        QString previousItemText() const;
68
 
        QString currentItemText() const;
69
 
        QString nextItemText() const;
70
 
        bool currentIsFirst() const;
71
 
        bool currentIsLast() const;
72
 
 
73
 
        /**
74
 
         * Don't forget to call arrangeItemsInGrid to apply the changes
75
 
         */
76
 
        void setThumbnailSize(ThumbnailSize value);
77
 
        ThumbnailSize thumbnailSize() const { return mThumbnailSize; }
78
 
 
79
 
        /**
80
 
         * Don't forget to call arrangeItemsInGrid to apply the changes
81
 
         */
82
 
        void setMarginSize(int value);
83
 
        int marginSize() const { return mMarginSize; }
84
 
 
85
 
        void readConfig(KConfig*,const QString&);
86
 
        void writeConfig(KConfig*,const QString&) const;
87
 
 
88
 
 
89
 
public slots:
90
 
        void setThumbnailPixmap(const KFileViewItem*,const QPixmap&);
91
 
 
92
 
signals:
93
 
        void updateStarted(int);
94
 
        void updateEnded();
95
 
        void updatedOneThumbnail();
96
 
 
97
 
protected:
98
 
        void startDrag();
99
 
 
100
 
private:
101
 
        ThumbnailSize mThumbnailSize;
102
 
        int mMarginSize;
103
 
        QPopupMenu* mPopupMenu;
104
 
 
105
 
        QGuardedPtr<ThumbnailLoadJob> mThumbnailLoadJob;
106
 
        
107
 
};
108
 
 
109
 
 
110
 
#endif