00001 //LabPlot : Style.h 00002 00003 #ifndef STYLE_H 00004 #define STYLE_H 00005 00006 #include <qcolor.h> 00007 #include <qdom.h> 00008 00009 class Style 00010 { 00011 public: 00012 Style(int t=0, QColor c="blue", bool f=0, QColor fc="green", int w=1,int p=1, int b=1 ); 00013 void save(QTextStream *t); 00014 int open(QTextStream *t,int version); // returns graph type 00015 QDomElement saveXML(QDomDocument doc); 00016 void openXML(QDomNode node); 00017 int Type() { return type; } 00018 void setType(int t) { type = t; } 00019 QColor Color() { return color; } 00020 void setColor(QString c) { color = QColor(c); } 00021 void setColor(QColor c) { color = c; } 00022 int Width() { return width; } 00023 void setWidth(int w) { width = w; } 00024 int PenStyle() { return penStyle; } 00025 void setPenStyle(int p) { penStyle = p; } 00026 int Brush() { return brush; } 00027 void setBrush (int b) { brush = b; } 00028 bool isFilled() { return fill; } 00029 void setFilled(int f) { fill = f; } 00030 QColor FillColor() { return fillcolor; } 00031 void setFillColor(QString c) { fillcolor = QColor(c); } 00032 void setFillColor(QColor c) { fillcolor = c; } 00033 int BoxWidth() { return boxwidth; } 00034 void setBoxWidth(int b) { boxwidth = b; } 00035 bool AutoBoxWidth() { return autoboxwidth; } 00036 void setAutoBoxWidth(bool b=true) { autoboxwidth = b; } 00037 bool PointsSortingEnabled() { return sort_points; } 00038 void setPointsSorting(bool e=true) { sort_points = e; } 00039 private: 00040 int type; // type : line,noline,steps,boxes,impulses,yboxes 00041 QColor color; // line color 00042 int width; // line width 00043 bool fill; // filled to baseline 00044 QColor fillcolor; // fill color 00045 int penStyle; // pen style :NoPen, SolidLine, DashLine, DotLine, DashDotLine, DashDotDotLine 00046 int brush; // fill brush : NoBrush, Solid, Dense1, Dense2, Dense3, Dense4, Dense5, 00047 // Dense6, Dense7, Horizontal, Vertical, Cross, BDiag, FDiag, DiagCross 00048 int boxwidth; // width for type boxes 00049 bool autoboxwidth; // automatic box width 00050 bool sort_points; // sort points before plotting ? 00051 }; 00052 00053 #endif // STYLE_H