00001
00002
00003 #ifndef LABEL_H
00004 #define LABEL_H
00005
00006 #include <qtextstream.h>
00007 #include <qfont.h>
00008 #include <qcolor.h>
00009 #include <qsimplerichtext.h>
00010 #include <qstringlist.h>
00011 #include "Point.h"
00012
00013 class Label {
00014 public:
00015 Label(QString string = QString(""), QFont font = QFont(QString("Adobe Times"),14),QColor color = QColor("black"));
00016 QStringList Info();
00017 void save(QTextStream *ts);
00018 void open(QTextStream *ts,int version);
00019 void draw(class Worksheet *ws, QPainter *p,Point pos,Point size, int w, int h, double phi);
00020
00021 bool inside(int x0, int y0, Point pos, Point size, int w, int h);
00022 bool insideY(int x0, int y0, Point pos, Point size, int w, int h);
00023 bool insideZ(int x0, int y0, Point pos, Point size, int w, int h);
00024 void setPosition(double X, double Y) { x=X; y=Y; }
00025 double X() { return x;}
00026 double Y() { return y;}
00027 QString Title() { return t; }
00028 void setTitle(QString title) { t = title; }
00029 void setColor(QColor color) { c = color; }
00030 void setColor(QString color) { c = QColor(color); }
00031 QColor Color() { return c; }
00032 void setFont(QFont font) { f = font; }
00033 QFont Font() { return f; }
00034 void setBoxed(bool b) { boxed = b; }
00035 bool Boxed() { return boxed; }
00036 double Rotation() { return rotation; }
00037 void setRotation(double r) { rotation = r; }
00038 bool isTeXLabel() { return is_texlabel; }
00039 void setTeXLabel(bool t) { is_texlabel=t; }
00040 private:
00041 double x, y;
00042 QString t;
00043 QFont f;
00044 QColor c;
00045 QSimpleRichText *richtext;
00046 bool boxed;
00047 double rotation;
00048 bool is_texlabel;
00049 };
00050
00051 #endif //LABEL_H