filters
format.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __KSPREAD_LATEX_FORMAT_H__
00024 #define __KSPREAD_LATEX_FORMAT_H__
00025
00026 #include <qtextstream.h>
00027 #include <qstring.h>
00028 #include <qcolor.h>
00029 #include "xmlparser.h"
00030 #include "pen.h"
00031
00032
00033
00034
00035
00036 class Column;
00037 class Row;
00038
00042 class Format: public XmlParser
00043 {
00044 long _align;
00045 long _alignY;
00046 QColor _bgColor;
00047 long _multirow;
00048 bool _verticalText;
00049 double _angle;
00050 QColor _brushColor;
00051 int _brushStyle;
00052 int _indent;
00053 bool _dontprinttext;
00054
00055
00056 double _penWidth;
00057 int _penStyle;
00058 QColor _penColor;
00059
00060
00061 int _size;
00062 QString _family;
00063 int _weight;
00064
00065
00066 Pen *_bottomBorder;
00067 Pen *_topBorder;
00068 Pen *_leftBorder;
00069 Pen *_rightBorder;
00070
00071
00072 bool _isValidFormat;
00073
00074 public:
00082 Format();
00083
00084
00085
00086
00087
00088
00089 virtual ~Format();
00090
00094 long getMultirow() const { return _multirow; }
00095 long getAlign() const { return _align; }
00096 long getAlignY() const { return _alignY; }
00097 QColor getBgColor() const { return _bgColor; }
00098 bool getVerticalText() const { return _verticalText; }
00099 double getAngle() const { return _angle; }
00100 QColor getBrushColor() const { return _brushColor; }
00101 int getBrushStyle() const { return _brushStyle; }
00102 int getIndent() const { return _indent; }
00103 bool getDontPrintText() const { return _dontprinttext; }
00104
00105 bool hasBorder() const { return (hasTopBorder() || hasBottomBorder() || hasLeftBorder() || hasRightBorder()); }
00106 bool hasTopBorder() const;
00107
00108 bool hasBottomBorder() const;
00109
00110 bool hasLeftBorder() const;
00111
00112 bool hasRightBorder() const;
00113
00114
00115
00116 double getPenWidth() const { return _penWidth; }
00117 int getPenStyle() const { return _penStyle; }
00118 QColor getPenColor() const { return _penColor; }
00119
00120
00121 int getFontSize() const { return _size; }
00122 QString getFontFamily() const { return _family; }
00123 int getFontWeight() const { return _weight; }
00124 bool isValidFormat() const { return _isValidFormat; }
00125
00129 void setAlign(long a) { _align = a; }
00130 void setAlignY(long a) { _alignY = a; }
00131 void setBgColor(QColor b) { _bgColor = b; }
00132 void setMultirow(long mr) { _multirow = mr; }
00133 void setVerticalText(bool vt) { _verticalText = vt; }
00134 void setAngle(double a) { _angle = a; }
00135 void setBrushColor(QString bc) { _brushColor.setNamedColor(bc); }
00136 void setBrushStyle(int bs) { _brushStyle = bs; }
00137 void setIndent(int indent) { _indent = indent; }
00138 void setDontPrintText(bool dpt) { _dontprinttext = dpt; }
00139
00140
00141 void setPenWidth(double pw) { _penWidth = pw; }
00142 void setPenStyle(int ps) { _penStyle = ps; }
00143 void setPenColor(QString pc) { _penColor.setNamedColor(pc); }
00144
00145
00146 void setFontSize(int s) { _size = s; }
00147 void setFontFamily(QString f) { _family = f; }
00148 void setFontWeight(int w) { _weight = w; }
00149
00157 virtual void analyse(const QDomNode);
00158 virtual void analysePen(const QDomNode);
00159 virtual void analyseFont(const QDomNode);
00160
00169 void generate(QTextStream& out, Column* col = NULL, Row* row = NULL);
00170
00174 void generateTextFormat(QTextStream& out, QString text);
00175
00183 void generateColor(QTextStream& out);
00184 };
00185
00186 #endif
|