filters

kspread/latex/export/format.h
1
2/*
3** Header file for inclusion with kword_xml2latex.c
4**
5** Copyright (C) 2002 Robert JACOLIN
6**
7** This library is free software; you can redistribute it and/or
8** modify it under the terms of the GNU Library General Public
9** License as published by the Free Software Foundation; either
10** version 2 of the License, or (at your option) any later version.
11**
12** This library is distributed in the hope that it will be useful,
13** but WITHOUT ANY WARRANTY; without even the implied warranty of
14** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15** Library General Public License for more details.
16**
17** To receive a copy of the GNU Library General Public License, write to the
18** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20**
21*/
22
23#ifndef __KSPREAD_LATEX_FORMAT_H__
24#define __KSPREAD_LATEX_FORMAT_H__
25
26#include <tqtextstream.h>
27#include <tqstring.h>
28#include <tqcolor.h>
29#include "xmlparser.h"
30#include "pen.h"
31
32/***********************************************************************/
33/* Class: Format */
34/***********************************************************************/
35
36class Column;
37class Row;
38
42class Format: public XmlParser
43{
44 long _align;
45 long _alignY;
46 TQColor _bgColor;
47 long _multirow;
48 bool _verticalText;
49 double _angle;
50 TQColor _brushColor;
51 int _brushStyle;
52 int _indent;
53 bool _dontprinttext;
54
55 /* pen */
56 double _penWidth;
57 int _penStyle;
58 TQColor _penColor;
59
60 /* font */
61 int _size;
62 TQString _family;
63 int _weight;
64
65 /* borders */
66 Pen *_bottomBorder;
67 Pen *_topBorder;
68 Pen *_leftBorder;
69 Pen *_rightBorder;
70
71 /* */
72 bool _isValidFormat;
73
74 public:
82 Format();
83
84 /*
85 * Destructor
86 *
87 * Nothing to do
88 */
89 virtual ~Format();
90
94 long getMultirow() const { return _multirow; }
95 long getAlign() const { return _align; }
96 long getAlignY() const { return _alignY; }
97 TQColor getBgColor() const { return _bgColor; }
98 bool getVerticalText() const { return _verticalText; }
99 double getAngle() const { return _angle; }
100 TQColor getBrushColor() const { return _brushColor; }
101 int getBrushStyle() const { return _brushStyle; }
102 int getIndent() const { return _indent; }
103 bool getDontPrintText() const { return _dontprinttext; }
104
105 bool hasBorder() const { return (hasTopBorder() || hasBottomBorder() || hasLeftBorder() || hasRightBorder()); }
106 bool hasTopBorder() const;
107 //Pen* getTopBorder() const { return _topBorder; }
108 bool hasBottomBorder() const;
109 //Pen* getBottomBorder() const { return _bottomBorder; }
110 bool hasLeftBorder() const;
111 //Pen* getLeftBorder() const { return _leftBorder; }
112 bool hasRightBorder() const;
113 //Pen* getRightBorder() const { return _rightBorder; }
114
115 /* pen */
116 double getPenWidth() const { return _penWidth; }
117 int getPenStyle() const { return _penStyle; }
118 TQColor getPenColor() const { return _penColor; }
119
120 /* font */
121 int getFontSize() const { return _size; }
122 TQString getFontFamily() const { return _family; }
123 int getFontWeight() const { return _weight; }
124 bool isValidFormat() const { return _isValidFormat; }
125
129 void setAlign(long a) { _align = a; }
130 void setAlignY(long a) { _alignY = a; }
131 void setBgColor(TQColor b) { _bgColor = b; }
132 void setMultirow(long mr) { _multirow = mr; }
133 void setVerticalText(bool vt) { _verticalText = vt; }
134 void setAngle(double a) { _angle = a; }
135 void setBrushColor(TQString bc) { _brushColor.setNamedColor(bc); }
136 void setBrushStyle(int bs) { _brushStyle = bs; }
137 void setIndent(int indent) { _indent = indent; }
138 void setDontPrintText(bool dpt) { _dontprinttext = dpt; }
139
140 /* pen */
141 void setPenWidth(double pw) { _penWidth = pw; }
142 void setPenStyle(int ps) { _penStyle = ps; }
143 void setPenColor(TQString pc) { _penColor.setNamedColor(pc); }
144
145 /* font */
146 void setFontSize(int s) { _size = s; }
147 void setFontFamily(TQString f) { _family = f; }
148 void setFontWeight(int w) { _weight = w; }
149
153
157 virtual void analyse(const TQDomNode);
158 virtual void analysePen(const TQDomNode);
159 virtual void analyseFont(const TQDomNode);
160
169 void generate(TQTextStream& out, Column* col = NULL, Row* row = NULL);
170
174 void generateTextFormat(TQTextStream& out, TQString text);
175
183 void generateColor(TQTextStream& out);
184};
185
186#endif /* __KSPREAD_LATEX_FORMAT_H__ */
This class hold a column.
Definition column.h:38
long getMultirow() const
getters
void generate(TQTextStream &out, Column *col=NULL, Row *row=NULL)
Generate the cell format inherited from the row or the colum format or use its own format.
void setAlign(long a)
setters
void generateColor(TQTextStream &out)
Generate the color format for a column or a row.
virtual void analyse(const TQDomNode)
Helpfull functions.
Format()
Constructors.
void generateTextFormat(TQTextStream &out, TQString text)
Generate the text cell format (color and font).
This class describe a pen which is used to draw borders.
Definition pen.h:39
This class hold a row.
Definition row.h:38