00001
00002
00003 #ifndef LEGEND_H
00004 #define LEGEND_H
00005
00006 #include <qfont.h>
00007 #include <qpainter.h>
00008 #include "GraphList.h"
00009 #include "Symbol.h"
00010
00011 class Legend {
00012 public:
00013 Legend();
00014 void save(QTextStream *t);
00015 void open(QTextStream *t, int version);
00016 QDomElement saveXML(QDomDocument doc);
00017 void openXML(QDomNode node);
00018 void setFont(QFont f) { font = f; }
00019 QFont Font() { return font; }
00020 void enable(bool b=true) { enabled = b; }
00021 bool Enabled() { return enabled; }
00022 void setPosition(double X, double Y) { x = X; y = Y; }
00023 double X() { return x; }
00024 double Y() { return y; }
00025 void enableBorder(bool b=true) { border = b; }
00026 bool BorderEnabled() { return border; }
00027 void setColor(QColor c) { color = c; }
00028 void setColor(QString c) { color = QColor(c); }
00029 QColor Color() { return color; }
00030 void setTransparent(bool t=true) { transparent=t; }
00031 bool Transparent() { return transparent; }
00032 bool getOrientation() { return orientation; }
00033 void setOrientation(bool o) { orientation=o; }
00034 int drawGraphs(QPainter *p, GraphList *gl, PType type, Point size, QFont tmpfont);
00035 void draw(QPainter *p, PType type, GraphList *graphlist, Point pos, Point size,int w, int h);
00036 bool inside(int X, int Y);
00037 int TicLabelLength() { return ticlabellength; }
00038 void setTicLabelLength(int l) { ticlabellength = l; }
00039 private:
00040 double x,y;
00041 int x1, y1, x2, y2;
00042 QFont font;
00043 bool border;
00044 bool enabled;
00045 QColor color;
00046 bool transparent;
00047 int namelength;
00048 bool orientation;
00049 int ticlabellength;
00050 };
00051
00052 #endif //LEGEND_H