00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __PROJECTVIEW_H__
00019 #define __PROJECTVIEW_H__
00020
00021 #include <qlistview.h>
00022 #include <qpopupmenu.h>
00023
00024 class ProjectView;
00025
00026 class ProjectFileItem : public QListViewItem
00027 {
00028 friend class ProjectView;
00029 public:
00030 ProjectFileItem( ProjectView *parent, QString file );
00031 private:
00032 QString fileName;
00033 ProjectView *view;
00034 };
00035
00036 class ProjectView : public QListView
00037 {
00038 Q_OBJECT
00039 friend class ProjectFileItem;
00040 public:
00041 ProjectView( QWidget *parent, const char *name );
00042 public slots:
00043 void addFile( QString file );
00044 void removeFile( QString file );
00045 void setProjectDir( QString dir ) { projectDir = dir; }
00046 protected slots:
00047 void slotRemoveFile();
00048 protected:
00049 void contentsMouseDoubleClickEvent( QMouseEvent *e );
00050 void contextMenuEvent( QContextMenuEvent *e );
00051 signals:
00052 void loadFile(QString);
00053 void removedFile(QString);
00054 private:
00055 QString projectDir;
00056 QPopupMenu *contextMenu;
00057 };
00058
00059 #endif