~ubuntu-branches/ubuntu/edgy/gwenview/edgy

« back to all changes in this revision

Viewing changes to src/gvfilethumbnailview.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-12-06 17:59:19 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20051206175919-8yv9nfmw0pws6p52
Tags: 1.3.1-0ubuntu1
* Sync with Debian
* Edit kde.mk for .pot generation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// vim: set tabstop=4 shiftwidth=4 noexpandtab
2
 
/*
3
 
Gwenview - A simple image viewer for KDE
4
 
Copyright 2000-2004 Aur�lien G�teau
5
 
 
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.
10
 
 
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.
15
 
 
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.
19
 
 
20
 
*/
21
 
#ifndef GVFILETHUMBNAILVIEW_H
22
 
#define GVFILETHUMBNAILVIEW_H
23
 
 
24
 
// Qt includes
25
 
#include <qguardedptr.h>
26
 
#include <qptrlist.h>
27
 
 
28
 
// KDE includes
29
 
#include <kiconview.h>
30
 
 
31
 
// Our includes
32
 
#include "gvfileviewbase.h"
33
 
#include "thumbnailsize.h"
34
 
#include "gvbusylevelmanager.h"
35
 
 
36
 
class QDragEnterEvent;
37
 
class QIconViewItem;
38
 
class QPopupMenu;
39
 
class QShowEvent;
40
 
 
41
 
class KConfig;
42
 
class KFileItem;
43
 
typedef QPtrList<KFileItem> KFileItemList;
44
 
 
45
 
class GVFileThumbnailViewItem;
46
 
class ThumbnailLoadJob;
47
 
 
48
 
class GVFileThumbnailView : public KIconView, public GVFileViewBase {
49
 
Q_OBJECT
50
 
        friend class GVFileThumbnailViewItem;
51
 
        
52
 
public:
53
 
        GVFileThumbnailView(QWidget* parent);
54
 
        ~GVFileThumbnailView();
55
 
 
56
 
        QWidget* widget() { return this; }
57
 
 
58
 
        // KFileView methods
59
 
        void clearView();
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);
69
 
 
70
 
        KFileItem* firstFileItem() const;
71
 
        KFileItem* prevItem( const KFileItem*) const;
72
 
        KFileItem* currentFileItem() const;
73
 
        KFileItem* nextItem( const KFileItem*) const;
74
 
 
75
 
        /**
76
 
         * Don't forget to call arrangeItemsInGrid to apply the changes
77
 
         */
78
 
        void setThumbnailSize(ThumbnailSize value);
79
 
        ThumbnailSize thumbnailSize() const;
80
 
 
81
 
        /**
82
 
         * Don't forget to call arrangeItemsInGrid to apply the changes
83
 
         */
84
 
        void setMarginSize(int value);
85
 
        int marginSize() const;
86
 
 
87
 
        void readConfig(KConfig*,const QString&);
88
 
        void writeConfig(KConfig*,const QString&) const;
89
 
        /**
90
 
         * Used by the KParts, equivalent of readConfig(), this sets
91
 
         * some values but just uses the defaults rather than using
92
 
         * KConfig
93
 
         */
94
 
        void kpartConfig();
95
 
 
96
 
        void setShownFileItem(KFileItem*);
97
 
 
98
 
        void updateThumbnail(const KFileItem*);
99
 
 
100
 
public slots:
101
 
        void setThumbnailPixmap(const KFileItem*,const QPixmap&, const QSize&);
102
 
        void startThumbnailUpdate();
103
 
        void stopThumbnailUpdate();
104
 
 
105
 
signals:
106
 
        void dropped(QDropEvent*, KFileItem* target);
107
 
 
108
 
protected:
109
 
        void showEvent(QShowEvent*);
110
 
        void contentsDragEnterEvent(QDragEnterEvent*);
111
 
        void startDrag();
112
 
 
113
 
private:
114
 
        class Private;
115
 
        Private* d;
116
 
 
117
 
        void updateGrid();
118
 
        void doStartThumbnailUpdate(const KFileItemList*);
119
 
        void setSortingKey(QIconViewItem*, const KFileItem*);
120
 
        void updateVisibilityInfo( int x, int y );
121
 
 
122
 
private slots:
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();
130
 
};
131
 
 
132
 
 
133
 
#endif