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 void setFont(QFont font) { f = font; }
00017 QFont Font() { return f; }
00018 void enable(bool b=true) { e = b; }
00019 bool enabled() { return e; }
00020 void setPosition(double X, double Y) { x = X; y = Y; }
00021 double X() { return x; }
00022 double Y() { return y; }
00023 void enableBorder(bool b=true) { border = b; }
00024 bool borderEnabled() { return border; }
00025 bool getOrientation() { return orientation; }
00026 void setOrientation(bool o) { orientation=o; }
00027 void draw(QPainter *p, PType type, GraphList *graphlist, Point pos, Point size,int w, int h);
00028 bool inside(int X, int Y);
00029 int TicLabelLength() { return ticlabellength; }
00030 void setTicLabelLength(int l) { ticlabellength = l; }
00031 private:
00032 double x,y;
00033 int x1, y1, x2, y2;
00034 QFont f;
00035 bool border;
00036 bool e;
00037 int namelength;
00038 bool orientation;
00039 int ticlabellength;
00040 };
00041
00042 #endif //LEGEND_H