Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Label.h

Go to the documentation of this file.
00001 //LabPlot: Label.h
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(QPainter *p,Point pos,Point size, int w, int h, double phi);  // draw the label with given width and height
00020         bool inside(int x0, int y0, Point pos, Point size, int w, int h);
00021         bool insideY(int x0, int y0, Point pos, Point size, int w, int h);
00022         bool insideZ(int x0, int y0, Point pos, Point size, int w, int h);      // for 3d y-axes
00023         void setPosition(double X, double Y) { x=X; y=Y; }
00024         double X() { return x;}
00025         double Y() { return y;}
00026         QString title() { return t; }           
00027         void setTitle(QString title) { t = title; }
00028         void setColor(QColor color) { c = color; }
00029         QColor color() { return c; }
00030         void setFont(QFont font) { f = font; }
00031         QFont font() { return f; }
00032         void setBoxed(bool b) { boxed = b; }
00033         bool Boxed() { return boxed; }
00034         double getRotation() { return rotation; }
00035         void setRotation(double r) { rotation = r; }
00036 private:
00037         double x, y;            // position
00038         QString t;                      // label string
00039         QFont f;                        // label font
00040         QColor c;                       // label color
00041         QSimpleRichText *richtext;
00042         bool boxed;             // surrounding box
00043         double rotation;        // label rotation
00044 };
00045 
00046 #endif //LABEL_H

Generated on Sun Nov 28 22:31:17 2004 for LabPlot by doxygen 1.3.6