2
Gwenview - A simple image viewer for KDE
3
Copyright (C) 2000-2002 Aur�lien G�teau
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.
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.
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.
24
#include <qlistview.h>
27
#include <kfileitem.h>
34
class DirViewItem : public QListViewItem {
36
DirViewItem(DirView* folderWidget, const QString& label);
37
DirViewItem(DirView* folderWidget, QListViewItem* parent, const QString& label);
39
void initExpandable();
40
void setIsDropTarget(bool);
42
// Overriden from QListViewItem
44
void paintCell(QPainter *, const QColorGroup &, int column, int width, int align);
47
DirViewItem* find(const QString& label) const;
48
virtual QString folder() const=0;
49
virtual const KURL& url() const=0;
59
class RootDirViewItem : public DirViewItem {
61
RootDirViewItem(DirView* folderWidget, const QString& label)
62
: DirViewItem(folderWidget,label) {}
64
QString folder() const { return "/"; }
65
const KURL& url() const;
71
class SubDirViewItem : public DirViewItem {
73
SubDirViewItem(DirView* folderWidget,QListViewItem* parent,const QString& label, KFileItem* item)
74
: DirViewItem(folderWidget, parent, label), mFileItem(item) {}
77
KFileItem* fileItem() const { return mFileItem; }
78
QString folder() const { return mFileItem->url().path(); }
79
const KURL& url() const { return mFileItem->url(); }
81
// Refresh the label according to the url