summaryrefslogtreecommitdiffstats
path: root/src/diagram.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/diagram.h')
-rw-r--r--src/diagram.h102
1 files changed, 7 insertions, 95 deletions
diff --git a/src/diagram.h b/src/diagram.h
index 3e2cac2..e26f16c 100644
--- a/src/diagram.h
+++ b/src/diagram.h
@@ -16,108 +16,17 @@
*
*/
+#ifndef DIAGRAM_H
+#define DIAGRAM_H
+
#include "qtbc.h"
#include "types.h"
class ClassDef;
-class DiagramRow;
class TreeDiagram;
-class ClassDiagram;
-class DiagramItemList;
-class Image;
class FTextStream;
-class DiagramItem
-{
- public:
- DiagramItem(DiagramItem *p,int number,ClassDef *cd,
- Protection prot,Specifier virt,const char *ts);
- ~DiagramItem();
- QCString label() const;
- QCString fileName() const;
- DiagramItem *parentItem() { return parent; }
- DiagramItemList *getChildren() { return children; }
- void move(int dx,int dy) { x+=dx; y+=dy; }
- int xPos() const { return x; }
- int yPos() const { return y; }
- int avgChildPos() const;
- int numChildren() const;
- void addChild(DiagramItem *di);
- int number() const { return num; }
- Protection protection() const { return prot; }
- Specifier virtualness() const { return virt; }
- void putInList() { inList=TRUE; }
- bool isInList() const { return inList; }
- ClassDef *getClassDef() const { return classDef; }
- private:
- DiagramItemList *children;
- DiagramItem *parent;
- int x,y;
- int num;
- Protection prot;
- Specifier virt;
- QCString templSpec;
- bool inList;
- ClassDef *classDef;
-};
-
-class DiagramItemList : public QList<DiagramItem>
-{
- public:
- DiagramItemList() : QList<DiagramItem>() {}
- ~DiagramItemList() {}
-};
-
-class DiagramRow : public QList<DiagramItem>
-{
- public:
- DiagramRow(TreeDiagram *d,int l) : QList<DiagramItem>()
- {
- diagram=d;
- level=l;
- setAutoDelete(TRUE);
- }
- void insertClass(DiagramItem *parent,ClassDef *cd,bool doBases,
- Protection prot,Specifier virt,const char *ts);
- uint number() { return level; }
- private:
- TreeDiagram *diagram;
- uint level;
-};
-
-class DiagramRowIterator : public QListIterator<DiagramRow>
-{
- public:
- DiagramRowIterator(const QList<DiagramRow> &d)
- : QListIterator<DiagramRow>(d) {}
-};
-
-class TreeDiagram : public QList<DiagramRow>
-{
- public:
- TreeDiagram(ClassDef *root,bool doBases);
- ~TreeDiagram();
- void computeLayout();
- uint computeRows();
- //uint computeCols();
- void moveChildren(DiagramItem *root,int dx);
- void computeExtremes(uint *labelWidth,uint *xpos);
- void drawBoxes(FTextStream &t,Image *image,
- bool doBase,bool bitmap,
- uint baseRows,uint superRows,
- uint cellWidth,uint cellHeight,
- QCString relPath="",
- bool generateMap=TRUE);
- void drawConnectors(FTextStream &t,Image *image,
- bool doBase,bool bitmap,
- uint baseRows,uint superRows,
- uint cellWidth,uint cellheight);
- private:
- bool layoutTree(DiagramItem *root,int row);
- TreeDiagram &operator=(const TreeDiagram &);
- TreeDiagram(const TreeDiagram &);
-};
-
+/** Class representing a built-in class diagram. */
class ClassDiagram
{
public:
@@ -131,3 +40,6 @@ class ClassDiagram
TreeDiagram *base;
TreeDiagram *super;
};
+
+#endif
+