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

Generated on Sat Oct 13 21:55:01 2007 for LabPlot by  doxygen 1.4.4