1
/* This file is part of the KDE project
2
Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; see the file COPYING. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
20
#ifndef __konq_listviewitems_h__
21
#define __konq_listviewitems_h__
23
#include <klistview.h>
25
#include <kicontheme.h>
27
#include <qvaluevector.h>
30
#include <sys/types.h>
36
class KonqBaseListViewWidget;
39
class KonqBaseListViewItem : public KListViewItem
42
KonqBaseListViewItem(KonqBaseListViewWidget *_listViewWidget, KFileItem* _fileitem);
43
KonqBaseListViewItem(KonqBaseListViewWidget *_listViewWidget, KonqBaseListViewItem *_parent, KFileItem* _fileitem);
44
virtual ~KonqBaseListViewItem();
45
/** @return the file item held by this instance */
46
KFileItem * item() { return m_fileitem; }
48
virtual void updateContents() = 0;
49
virtual void setDisabled( bool disabled ) { m_bDisabled = disabled; }
50
virtual void setActive ( bool active ) { m_bActive = active; }
51
virtual int compare( QListViewItem* i, int col, bool ascending ) const;
56
return KIcon::DisabledState;
58
return KIcon::ActiveState;
59
return KIcon::DefaultState;
62
/** For KonqMimeTypeResolver */
70
/** Pointer to the file item in KDirLister's list */
71
KFileItem* m_fileitem;
72
/** Parent tree view */
73
KonqBaseListViewWidget* m_pListViewWidget;
75
static const char* makeAccessString( const mode_t mode );
79
* One item in the detailed list or in the tree (not text)
81
class KonqListViewItem : public KonqBaseListViewItem
85
* Create an item in the tree toplevel representing a file
86
* @param _parent the parent widget, the tree view
87
* @param _fileitem the file item created by KDirLister
89
KonqListViewItem( KonqBaseListViewWidget *_listViewWidget, KFileItem* _fileitem );
91
* Create an item representing a file, inside a directory
92
* @param _treeview the parent tree view - now unused
93
* @param _parent the parent widget, a directory item in the tree view
94
* @param _fileitem the file item created by KDirLister
96
KonqListViewItem( KonqBaseListViewWidget *, KonqListViewItem *_parent, KFileItem* _fileitem );
98
virtual ~KonqListViewItem() {}
100
virtual void paintCell( QPainter *_painter, const QColorGroup & cg,
101
int column, int width, int alignment );
102
virtual void updateContents();
103
virtual void setDisabled( bool disabled );
104
virtual void setActive ( bool active );
106
virtual void setPixmap( int column, const QPixmap & pm );
107
virtual const QPixmap * pixmap( int column ) const;
110
QValueVector<QPixmap *> m_pixmaps;