00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPTCANVASITEM_H
00021 #define KPTCANVASITEM_H
00022
00023 #include "kptnode.h"
00024 #include "KDGanttView.h"
00025 #include "KDGanttViewItem.h"
00026 #include "KDGanttViewSummaryItem.h"
00027 #include "KDGanttViewTaskItem.h"
00028 #include "KDGanttViewEventItem.h"
00029
00030 #include <q3canvas.h>
00031 #include <qrect.h>
00032
00033 #include <Q3PointArray>
00034 #include <Q3PtrList>
00035
00036 class QPainter;
00037
00038 namespace KPlato
00039 {
00040
00041 class Task;
00042 class Relation;
00043 class GanttView;
00044
00045
00046 class ItemBase
00047 {
00048 protected:
00049 KDGanttViewTaskLink::LinkType kdLinkType(int relationType);
00050 };
00051
00052
00054
00055 class GanttViewSummaryItem : public KDGanttViewSummaryItem, public ItemBase
00056 {
00057 public:
00058 GanttViewSummaryItem(KDGanttView *parent, Node *node);
00059 GanttViewSummaryItem(KDGanttViewItem *parent, Node *node);
00060
00061 Node *getNode() { return m_node; }
00062 void insertRelations(GanttView *view);
00063 KDGanttViewItem *find(Node *node);
00064 KDGanttViewItem *find(KDGanttViewItem *item, Node *node);
00065 KDGanttView *ganttView() const { return m_view; }
00066 bool isDrawn() const { return m_drawn; }
00067 void setDrawn(bool drawn) { m_drawn = drawn; }
00068
00069 protected:
00070 Node *m_node;
00071 KDGanttView *m_view;
00072 bool m_drawn;
00073 };
00074
00076
00077 class GanttViewTaskItem : public KDGanttViewTaskItem, public ItemBase
00078 {
00079 public:
00080 GanttViewTaskItem(KDGanttView *parent, KPlato::Task *task);
00081 GanttViewTaskItem(KDGanttViewItem *parent, KPlato::Task *task);
00082
00083 KPlato::Task *getTask() const { return m_task; }
00084 void insertRelations(GanttView *view);
00085 KDGanttViewItem *find(Node *node);
00086 KDGanttViewItem *find(KDGanttViewItem *item, Node *node);
00087 KDGanttView *ganttView() const { return m_view; }
00088 bool isDrawn() const { return m_drawn; }
00089 void setDrawn(bool drawn) { m_drawn = drawn; }
00090
00091 protected:
00092 KPlato::Task *m_task;
00093 KDGanttView *m_view;
00094 bool m_drawn;
00095 };
00096
00098
00099 class GanttViewEventItem : public KDGanttViewEventItem, public ItemBase
00100 {
00101 public:
00102 GanttViewEventItem(KDGanttView *parent, KPlato::Task *task);
00103 GanttViewEventItem(KDGanttViewItem *parent, KPlato::Task *task);
00104
00105 KPlato::Task *getTask() { return m_task; }
00106 void insertRelations(GanttView *view);
00107 KDGanttViewItem *find(Node *node);
00108 KDGanttViewItem *find(KDGanttViewItem *item, Node *node);
00109 KDGanttView *ganttView() const { return m_view; }
00110 bool isDrawn() const { return m_drawn; }
00111 void setDrawn(bool drawn) { m_drawn = drawn; }
00112
00113 protected:
00114 KPlato::Task *m_task;
00115 KDGanttView *m_view;
00116 bool m_drawn;
00117 };
00118
00119 }
00120
00121 #endif