00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00028
00029 #define YASAGUI_WORKSPACETREE_VIEW_INCLUDE
00030
00031 #include <yasagui/yasagui.h>
00032 #include <qobject.h>
00033 #include <qpopupmenu.h>
00034 #include "widgets.h"
00035 #include "parser.h"
00036 #include "workspace.h"
00037 #include "mainwindow.h"
00038
00040 class YWorkSpaceManager;
00041 class YListViewItem;
00042 class YActionHandler;
00043 class YBackground;
00044
00046 class YWorkSpaceTreeView : public YListView
00047 {
00048 Q_OBJECT
00049 YObject *oldselected;
00050 public:
00051 YWorkSpaceTreeView(YSet *projectset, QFrame *frame) :
00052 YListView(projectset, frame, QString::null),
00053 oldselected(0)
00054 {}
00055 virtual int InitInstance();
00056 YListViewItem* CreateTreeItem(YObject &object, QListViewItem *parent, QListViewItem *after);
00057 public slots:
00058
00059 void MouseButtonClicked(int, QListViewItem *,const QPoint &,int );
00060 void ItemActivated( QListViewItem *item);
00061
00062 void RightButtonClicked(QListViewItem *,const QPoint &,int );
00063 void DoubleClicked(QListViewItem *);
00064 void keyPressEvent(QKeyEvent * e);
00065 void UpdateListView(YWorkSpace *workspace);
00066 void ClearListView(YWorkSpace *workspace);
00067
00068 virtual void NewChildObject(YObject *object);
00069 virtual void ChildObjectRemoved(YObject *object);
00070 };
00071
00072
00073
00074
00075
00076
00077
00079 class YWorkSpaceTreeOutputParser : public YOutputParser, public QList<QListViewItem>
00080 {
00081 QListViewItem *afterlistview;
00082 YWorkSpaceTreeView &workspaceview;
00083 YWorkSpace &workspace;
00084 public: YWorkSpaceTreeOutputParser(YWorkSpaceTreeView &view, YWorkSpace &ws) :
00085 afterlistview(0),
00086 workspaceview(view),
00087 workspace(ws)
00088 {}
00089 virtual int WriteContentString(const CONFIG_STRING key, const QString &s)
00090 { return 0;
00091 Q_CONSTUNUSED(key);
00092 Q_CONSTUNUSED(s);
00093 }
00094 virtual int WriteContentInt(const CONFIG_STRING key, int value)
00095 {
00096 return 0;
00097 Q_CONSTUNUSED(key);
00098 Q_UNUSED(value);
00099 }
00100 virtual int WriteContentObject(const CONFIG_STRING key, const YDerivedObject &object)
00101 {
00102 return 0;
00103 Q_CONSTUNUSED(key);
00104 Q_CONSTUNUSED(object);
00105 }
00106 virtual int WriteContentState(const CONFIG_STRING key, bool state)
00107 {
00108 return 0;
00109 Q_CONSTUNUSED(key);
00110 Q_UNUSED(state);
00111 }
00112 virtual int NewSection(const CONFIG_STRING newsectionsetkey, YObject &yobject );
00113 virtual int NewSectionSet(const CONFIG_STRING newsectionkey, YSet &yset );
00114 int Parse();
00115 };
00116
00117
00118
00119
00120
00122 #endif // ifndef YASAGUI_WORKSPACETREE_VIEW_INCLUDE