Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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 <qdom.h>
00012 #include <klocale.h>
00013 #include <kconfig.h>
00014 #include "Point.h"
00015 
00016 class Label {
00017 public:
00018         Label(QString t = QString(""), QFont f = QFont(QString("Adobe Times"),14),QColor c = QColor("black"));
00019         QStringList Info();
00020         void save(QTextStream *ts);
00021         void open(QTextStream *ts, int version, bool skip=true);
00022         QDomElement saveXML(QDomDocument doc);
00023         void openXML(QDomNode node);
00024         void saveSettings(KConfig *config, QString entry);
00025         void readSettings(KConfig *config, QString entry);
00026         void draw(class Worksheet *ws, QPainter *p, Point pos,Point size, int w, int h, double phi);    
00027                                                                                 // draw the label with given width and height
00028         bool inside(int x0, int y0, Point pos, Point size, int w, int h);
00029         bool insideY(int x0, int y0, Point pos, Point size, int w, int h);
00030         bool insideZ(int x0, int y0, Point pos, Point size, int w, int h);      // for 3d y-axes
00031         void setPosition(double X, double Y) { x=X; y=Y; }
00032         double X() { return x;}
00033         double Y() { return y;}
00034         void setX(double X) { x=X; }
00035         void setY(double Y) { y=Y; }
00036         QString Title() { return title; }               
00037         QString simpleTitle();          // all html tags removed from title             
00038         void setTitle(QString t) { title = t; }
00039         void setColor(QColor c) { color = c; }
00040         void setColor(QString c) { color = QColor(c); }
00041         QColor Color() { return color; }
00042         void setBackgroundColor(QColor c) { bgcolor = c; }
00043         void setBackgroundColor(QString c) { bgcolor = QColor(c); }
00044         QColor BackgroundColor() { return bgcolor; }
00045         void setFont(QFont f) { font = f; }
00046         QFont Font() { return font; }
00047         void setBoxed(bool b=true) { boxed = b; }
00048         bool Boxed() { return boxed; }
00049         void setTransparent(bool t) { transparent = t; }
00050         bool Transparent() { return transparent; }
00051         double Rotation() { return rotation; }
00052         void setRotation(double r) { rotation = r; }
00053         bool isTeXLabel() { return is_texlabel; }
00054         void setTeXLabel(bool t) { is_texlabel=t; }
00055         int Length();                                           // calculate length of richtext
00056 private:
00057         double x, y;                    // position
00058         QString title;                  // label string
00059         QFont font;                     // label font
00060         QColor color, bgcolor;          // label + background color
00061         QSimpleRichText *richtext;
00062         bool boxed;                     // surrounding box
00063         bool transparent;               // transparent ?
00064         double rotation;                // label rotation
00065         bool is_texlabel;               // if it is a tex label
00066 };
00067 
00068 #endif //LABEL_H

Generated on Sun Apr 2 02:05:09 2006 for LabPlot by  doxygen 1.4.4