1
/* This file is part of the KDE project
2
Copyright (C) 2003 Percy Leonhardt
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
21
#ifndef STYLEFACTORY_H
22
#define STYLEFACTORY_H
34
StrokeDashStyle( int style );
35
~StrokeDashStyle() {};
37
void toXML( QDomDocument & doc, QDomElement & e ) const;
38
QString name() const { return m_name; };
43
QString m_name, m_style, m_dots1, m_dots2, m_dots1_length, m_dots2_length,
50
GradientStyle( QDomElement & gradient, int index );
53
void toXML( QDomDocument & doc, QDomElement & e ) const;
54
QString name() const { return m_name; };
59
QString m_name, m_style, m_cx, m_cy, m_start_color, m_end_color,
60
m_start_intensity, m_end_intensity, m_angle, m_border;
66
MarkerStyle( int style );
69
void toXML( QDomDocument & doc, QDomElement & e ) const;
70
QString name() const { return m_name; };
75
QString m_name, m_viewBox, m_d;
81
HatchStyle( int style, QString & color );
84
void toXML( QDomDocument & doc, QDomElement & e ) const;
85
QString name() const { return m_name; };
90
QString m_name, m_style, m_color, m_distance, m_rotation;
96
FillImageStyle( QString & name );
99
void toXML( QDomDocument & doc, QDomElement & e ) const;
104
QString m_name, m_href, m_type, m_show, m_actuate;
107
class PageMasterStyle
110
PageMasterStyle( QDomElement & e, const uint index );
111
~PageMasterStyle() {};
113
void toXML( QDomDocument & doc, QDomElement & e ) const;
114
bool operator==( const PageMasterStyle & pageMasterStyle ) const;
115
QString name() const { return m_name; };
116
QString style() const { return m_style; };
119
PageMasterStyle() {};
121
QString m_name, m_page_width, m_page_height, m_orientation, m_style;
122
QString m_margin_top, m_margin_bottom, m_margin_left, m_margin_right;
128
PageStyle( StyleFactory * styleFactory, QDomElement & e, const uint index );
131
void toXML( QDomDocument & doc, QDomElement & e ) const;
132
bool operator==( const PageStyle & pageStyle ) const;
133
QString name() const { return m_name; };
138
QString m_name, m_bg_visible, m_bg_objects_visible, m_fill, m_fill_color,
139
m_fill_image_name, m_fill_image_width, m_fill_image_height,
140
m_fill_image_ref_point, m_fill_gradient_name, m_repeat;
146
TextStyle( QDomElement & e, const uint index );
149
void toXML( QDomDocument & doc, QDomElement & e ) const;
150
bool operator==( const TextStyle & textStyle ) const;
151
QString name() const { return m_name; };
156
QString m_name, m_font_size, m_font_family, m_font_family_generic,
157
m_color, m_font_pitch, m_font_style, m_font_weight, m_text_shadow,
158
m_text_underline, m_text_underline_color, m_text_crossing_out;
164
GraphicStyle( StyleFactory * styleFactory, QDomElement & e, const uint index );
165
GraphicStyle( const char * name,
166
const char * stroke, const char * stroke_color,
167
const char * stroke_width, const char * shadow,
168
const char * shadow_offset_x, const char * shadow_offset_y,
169
const char * shadow_color, const char * margin_left,
170
const char * margin_right, const char * margin_top,
171
const char * margin_bottom, const char * color,
172
const char * text_outline, const char * text_crossing_out,
173
const char * font_family, const char * font_size,
174
const char * font_style, const char * text_shadow,
175
const char * text_underline, const char * font_weight,
176
const char * line_height, const char * text_align,
177
const char * fill, const char * fill_color,
178
const char * enable_numbering );
181
void toXML( QDomDocument & doc, QDomElement & e ) const;
182
bool operator==( const GraphicStyle & graphicStyle ) const;
183
QString name() const { return m_name; };
188
QString m_name, m_stroke, m_stroke_color, m_stroke_width, m_shadow,
189
m_shadow_offset_x, m_shadow_offset_y, m_shadow_color, m_margin_left,
190
m_margin_right, m_margin_top, m_margin_bottom, m_color, m_text_outline,
191
m_text_crossing_out, m_font_family, m_font_size, m_font_style,
192
m_text_shadow, m_text_underline, m_font_weight, m_line_height,
193
m_text_align, m_fill, m_fill_color, m_enable_numbering, m_stroke_dash,
194
m_fill_hatch_name, m_marker_start, m_marker_start_width,
195
m_marker_end, m_marker_end_width, m_fill_gradient_name;
201
ParagraphStyle( QDomElement & e, const uint index );
202
~ParagraphStyle() {};
204
void toXML( QDomDocument & doc, QDomElement & e ) const;
205
bool operator==( const ParagraphStyle & paragraphStyle ) const;
206
QString name() const { return m_name; };
210
QString parseBorder( QDomElement e );
212
QString m_name, m_margin_left, m_margin_right, m_text_indent, m_text_align,
213
m_enable_numbering, m_text_shadow, m_margin_top, m_margin_bottom,
214
m_border_left, m_border_right, m_border_top, m_border_bottom,
215
m_line_height, m_line_height_at_least, m_line_spacing;
221
ListStyle( QDomElement & e, const uint index );
224
void toXML( QDomDocument & doc, QDomElement & e ) const;
225
bool operator==( const ListStyle & listStyle ) const;
226
QString name() const { return m_name; };
234
} list_level_style_t;
236
float m_min_label_width;
237
list_level_style_t m_listLevelStyle;
238
QString m_name, m_num_suffix, m_num_format, m_bullet_char, m_color,
239
m_font_size, m_font_family;
248
void addOfficeStyles( QDomDocument & doc, QDomElement & styles );
249
void addOfficeMaster( QDomDocument & doc, QDomElement & master );
250
void addOfficeAutomatic( QDomDocument & doc, QDomElement & automatic );
251
void addAutomaticStyles( QDomDocument & doc, QDomElement & autoStyles );
253
QString createStrokeDashStyle( int style );
254
QString createGradientStyle( QDomElement & gradient );
255
QString createMarkerStyle( int style );
256
QString createHatchStyle( int style, QString & color );
257
QString createListStyle( QDomElement & e );
258
QString createPageStyle( QDomElement & e );
259
QString createTextStyle( QDomElement & e );
260
QString createGraphicStyle( QDomElement & e );
261
QString createParagraphStyle( QDomElement & e );
262
QString createPageMasterStyle( QDomElement & e );
264
static QString toCM( const QString & point );
267
QPtrList<StrokeDashStyle> m_strokeDashStyles;
268
QPtrList<GradientStyle> m_gradientStyles;
269
QPtrList<HatchStyle> m_hatchStyles;
270
QPtrList<MarkerStyle> m_markerStyles;
271
QPtrList<FillImageStyle> m_fillImageStyles;
272
QPtrList<ListStyle> m_listStyles;
273
QPtrList<PageStyle> m_pageStyles;
274
QPtrList<TextStyle> m_textStyles;
275
QPtrList<GraphicStyle> m_graphicStyles;
276
QPtrList<ParagraphStyle> m_paragraphStyles;
277
QPtrList<PageMasterStyle> m_pageMasterStyles;