parts/fileview/fileitemfactory.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#ifndef FILEITEMFACTORY_H
00013
#define FILEITEMFACTORY_H
00014
00015
#include <kfiletreeview.h>
00016
00017
class FileTreeWidget;
00018
00022 namespace filetreeview
00023 {
00027 class FileTreeViewItem :
public KFileTreeViewItem
00028 {
00029
friend class FileTreeBranchItem;
00030
protected:
00031 FileTreeViewItem(
KFileTreeViewItem* parent,
KFileItem* item,
KFileTreeBranch* branch,
bool pf )
00032 :
KFileTreeViewItem( parent, item, branch ),
m_isProjectFile( pf )
00033 {
00034
hideOrShow();
00035 }
00036 FileTreeViewItem(
KFileTreeView* parent,
KFileItem* item,
KFileTreeBranch* branch )
00037 :
KFileTreeViewItem( parent, item, branch ),
m_isProjectFile( false )
00038 {
00039
hideOrShow();
00040 }
00041 virtual ~FileTreeViewItem() {}
00042
00043
public:
00044
virtual void paintCell(
QPainter *p,
const QColorGroup &cg,
int column,
int width,
int alignment );
00045
FileTreeWidget*
listView() const;
00046
void hideOrShow();
00047 bool isProjectFile()
const {
return m_isProjectFile; }
00048
bool setProjectFile(
QString const &path,
bool pf );
00049
00050
protected:
00051
virtual int compare(
QListViewItem *i,
int col,
bool ascending )
const;
00052
00053
private:
00054 bool m_isProjectFile;
00055 };
00056
00060 class FileTreeBranchItem :
public KFileTreeBranch
00061 {
00062
protected:
00063 FileTreeBranchItem(
KFileTreeView* view,
const KURL& url,
const QString& name,
const QPixmap& pix )
00064 :
KFileTreeBranch( view, url, name, pix, false,
00065 new
FileTreeViewItem( view, new
KFileItem( url, "inode/directory", S_IFDIR ), this ) )
00066 {
00067 }
00068 virtual ~FileTreeBranchItem()
00069 {
00070
00071
00072 }
00073
00074 };
00075
00079 class BranchItemFactory
00080 {
00081
public:
00082
virtual FileTreeBranchItem *
makeBranchItem(
KFileTreeView* view,
const KURL& url,
const QString& name,
const QPixmap& pix ) = 0;
00083 };
00084 }
00085
00086
#endif
This file is part of the documentation for KDevelop Version 3.0.4.