~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to filters/kpresenter/ooimpress/stylefactory.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
class StrokeDashStyle
32
32
{
33
33
public:
34
 
    explicit StrokeDashStyle( int style );
 
34
    explicit StrokeDashStyle(int style);
35
35
    ~StrokeDashStyle() {}
36
36
 
37
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
38
 
    QString name() const { return m_name; }
 
37
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
38
    QString name() const {
 
39
        return m_name;
 
40
    }
39
41
 
40
42
private:
41
43
    StrokeDashStyle() {}
42
44
 
43
45
    QString m_name, m_style, m_dots1, m_dots2, m_dots1_length, m_dots2_length,
44
 
        m_distance;
 
46
    m_distance;
45
47
};
46
48
 
47
49
class GradientStyle
48
50
{
49
51
public:
50
 
    GradientStyle( QDomElement & gradient, int index );
 
52
    GradientStyle(QDomElement & gradient, int index);
51
53
    ~GradientStyle() {}
52
54
 
53
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
54
 
    QString name() const { return m_name; }
 
55
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
56
    QString name() const {
 
57
        return m_name;
 
58
    }
55
59
 
56
60
private:
57
61
    GradientStyle() {}
58
62
 
59
63
    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;
 
64
    m_start_intensity, m_end_intensity, m_angle, m_border;
61
65
};
62
66
 
63
67
class MarkerStyle
64
68
{
65
69
public:
66
 
    explicit MarkerStyle( int style );
 
70
    explicit MarkerStyle(int style);
67
71
    ~MarkerStyle() {}
68
72
 
69
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
70
 
    QString name() const { return m_name; }
 
73
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
74
    QString name() const {
 
75
        return m_name;
 
76
    }
71
77
 
72
78
private:
73
79
    MarkerStyle() {}
78
84
class HatchStyle
79
85
{
80
86
public:
81
 
    HatchStyle( int style, QString & color );
 
87
    HatchStyle(int style, QString & color);
82
88
    ~HatchStyle() {}
83
89
 
84
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
85
 
    QString name() const { return m_name; }
 
90
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
91
    QString name() const {
 
92
        return m_name;
 
93
    }
86
94
 
87
95
private:
88
96
    HatchStyle() {}
93
101
class FillImageStyle
94
102
{
95
103
public:
96
 
    explicit FillImageStyle( QString & name );
 
104
    explicit FillImageStyle(QString & name);
97
105
    ~FillImageStyle() {}
98
106
 
99
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
 
107
    void toXML(QDomDocument & doc, QDomElement & e) const;
100
108
 
101
109
private:
102
110
    FillImageStyle() {}
107
115
class PageMasterStyle
108
116
{
109
117
public:
110
 
    PageMasterStyle( QDomElement & e, const uint index );
 
118
    PageMasterStyle(QDomElement & e, const uint index);
111
119
    ~PageMasterStyle() {}
112
120
 
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; }
 
121
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
122
    bool operator==(const PageMasterStyle & pageMasterStyle) const;
 
123
    QString name() const {
 
124
        return m_name;
 
125
    }
 
126
    QString style() const {
 
127
        return m_style;
 
128
    }
117
129
 
118
130
private:
119
131
    PageMasterStyle() {}
125
137
class PageStyle
126
138
{
127
139
public:
128
 
    PageStyle( StyleFactory * styleFactory, QDomElement & e, const uint index );
 
140
    PageStyle(StyleFactory * styleFactory, QDomElement & e, const uint index);
129
141
    ~PageStyle() {}
130
142
 
131
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
132
 
    bool operator==( const PageStyle & pageStyle ) const;
133
 
    QString name() const { return m_name; }
 
143
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
144
    bool operator==(const PageStyle & pageStyle) const;
 
145
    QString name() const {
 
146
        return m_name;
 
147
    }
134
148
 
135
149
private:
136
150
    PageStyle() {}
137
151
 
138
152
    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, m_page_effect,
141
 
        m_page_duration;
 
153
    m_fill_image_name, m_fill_image_width, m_fill_image_height,
 
154
    m_fill_image_ref_point, m_fill_gradient_name, m_repeat, m_page_effect,
 
155
    m_page_duration;
142
156
};
143
157
 
144
158
class TextStyle
145
159
{
146
160
public:
147
 
    TextStyle( QDomElement & e, const uint index );
 
161
    TextStyle(QDomElement & e, const uint index);
148
162
    ~TextStyle() {}
149
163
 
150
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
151
 
    bool operator==( const TextStyle & textStyle ) const;
152
 
    QString name() const { return m_name; }
 
164
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
165
    bool operator==(const TextStyle & textStyle) const;
 
166
    QString name() const {
 
167
        return m_name;
 
168
    }
153
169
 
154
170
private:
155
171
    TextStyle() {}
156
172
 
157
173
    QString m_name, m_font_size, m_font_family, m_font_family_generic,
158
 
        m_color, m_font_pitch, m_font_style, m_font_weight, m_text_shadow,
159
 
        m_text_underline, m_text_underline_color, m_text_crossing_out;
 
174
    m_color, m_font_pitch, m_font_style, m_font_weight, m_text_shadow,
 
175
    m_text_underline, m_text_underline_color, m_text_crossing_out;
160
176
};
161
177
 
162
178
class GraphicStyle
163
179
{
164
180
public:
165
 
    GraphicStyle( StyleFactory * styleFactory, QDomElement & e, const uint index );
166
 
    GraphicStyle( const char * name,
167
 
                  const char * stroke, const char * stroke_color,
168
 
                  const char * stroke_width, const char * shadow,
169
 
                  const char * shadow_offset_x, const char * shadow_offset_y,
170
 
                  const char * shadow_color, const char * margin_left,
171
 
                  const char * margin_right, const char * margin_top,
172
 
                  const char * margin_bottom, const char * color,
173
 
                  const char * text_outline, const char * text_crossing_out,
174
 
                  const char * font_family, const char * font_size,
175
 
                  const char * font_style, const char * text_shadow,
176
 
                  const char * text_underline, const char * font_weight,
177
 
                  const char * line_height, const char * text_align,
178
 
                  const char * fill, const char * fill_color,
179
 
                  const char * enable_numbering );
 
181
    GraphicStyle(StyleFactory * styleFactory, QDomElement & e, const uint index);
 
182
    GraphicStyle(const char * name,
 
183
                 const char * stroke, const char * stroke_color,
 
184
                 const char * stroke_width, const char * shadow,
 
185
                 const char * shadow_offset_x, const char * shadow_offset_y,
 
186
                 const char * shadow_color, const char * margin_left,
 
187
                 const char * margin_right, const char * margin_top,
 
188
                 const char * margin_bottom, const char * color,
 
189
                 const char * text_outline, const char * text_crossing_out,
 
190
                 const char * font_family, const char * font_size,
 
191
                 const char * font_style, const char * text_shadow,
 
192
                 const char * text_underline, const char * font_weight,
 
193
                 const char * line_height, const char * text_align,
 
194
                 const char * fill, const char * fill_color,
 
195
                 const char * enable_numbering);
180
196
    ~GraphicStyle() {}
181
197
 
182
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
183
 
    bool operator==( const GraphicStyle & graphicStyle ) const;
184
 
    QString name() const { return m_name; }
 
198
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
199
    bool operator==(const GraphicStyle & graphicStyle) const;
 
200
    QString name() const {
 
201
        return m_name;
 
202
    }
185
203
 
186
204
private:
187
205
    GraphicStyle() {}
188
206
 
189
207
    QString m_name, m_stroke, m_stroke_color, m_stroke_width, m_shadow,
190
 
        m_shadow_offset_x, m_shadow_offset_y, m_shadow_color, m_margin_left,
191
 
        m_margin_right, m_margin_top, m_margin_bottom, m_color, m_text_outline,
192
 
        m_text_crossing_out, m_font_family, m_font_size, m_font_style,
193
 
        m_text_shadow, m_text_underline, m_font_weight, m_line_height,
194
 
        m_text_align, m_fill, m_fill_color, m_enable_numbering, m_stroke_dash,
195
 
        m_fill_hatch_name, m_marker_start, m_marker_start_width,
196
 
        m_marker_end, m_marker_end_width, m_fill_gradient_name, m_transparency, m_textAlignment,
197
 
        m_textMarginLeft, m_textMarginBottom, m_textMarginTop, m_textMarginRight;
 
208
    m_shadow_offset_x, m_shadow_offset_y, m_shadow_color, m_margin_left,
 
209
    m_margin_right, m_margin_top, m_margin_bottom, m_color, m_text_outline,
 
210
    m_text_crossing_out, m_font_family, m_font_size, m_font_style,
 
211
    m_text_shadow, m_text_underline, m_font_weight, m_line_height,
 
212
    m_text_align, m_fill, m_fill_color, m_enable_numbering, m_stroke_dash,
 
213
    m_fill_hatch_name, m_marker_start, m_marker_start_width,
 
214
    m_marker_end, m_marker_end_width, m_fill_gradient_name, m_transparency, m_textAlignment,
 
215
    m_textMarginLeft, m_textMarginBottom, m_textMarginTop, m_textMarginRight;
198
216
};
199
217
 
200
218
class ParagraphStyle
201
219
{
202
220
public:
203
 
    ParagraphStyle( QDomElement & e, const uint index );
 
221
    ParagraphStyle(QDomElement & e, const uint index);
204
222
    ~ParagraphStyle() {}
205
223
 
206
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
207
 
    bool operator==( const ParagraphStyle & paragraphStyle ) const;
208
 
    QString name() const { return m_name; }
 
224
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
225
    bool operator==(const ParagraphStyle & paragraphStyle) const;
 
226
    QString name() const {
 
227
        return m_name;
 
228
    }
209
229
 
210
230
private:
211
231
    ParagraphStyle() {}
212
 
    QString parseBorder( QDomElement e );
 
232
    QString parseBorder(QDomElement e);
213
233
 
214
234
    QString m_name, m_margin_left, m_margin_right, m_text_indent, m_text_align,
215
 
        m_enable_numbering,  m_text_shadow,  m_margin_top, m_margin_bottom,
216
 
        m_border_left, m_border_right, m_border_top, m_border_bottom,
217
 
        m_line_height, m_line_height_at_least, m_line_spacing;
 
235
    m_enable_numbering,  m_text_shadow,  m_margin_top, m_margin_bottom,
 
236
    m_border_left, m_border_right, m_border_top, m_border_bottom,
 
237
    m_line_height, m_line_height_at_least, m_line_spacing;
218
238
};
219
239
 
220
240
class ListStyle
221
241
{
222
242
public:
223
 
    ListStyle( QDomElement & e, const uint index );
 
243
    ListStyle(QDomElement & e, const uint index);
224
244
    ~ListStyle() {}
225
245
 
226
 
    void toXML( QDomDocument & doc, QDomElement & e ) const;
227
 
    bool operator==( const ListStyle & listStyle ) const;
228
 
    QString name() const { return m_name; }
 
246
    void toXML(QDomDocument & doc, QDomElement & e) const;
 
247
    bool operator==(const ListStyle & listStyle) const;
 
248
    QString name() const {
 
249
        return m_name;
 
250
    }
229
251
 
230
252
private:
231
253
    ListStyle() {}
238
260
    float m_min_label_width;
239
261
    list_level_style_t m_listLevelStyle;
240
262
    QString m_name, m_num_suffix, m_num_format, m_bullet_char, m_color,
241
 
        m_font_size, m_font_family;
 
263
    m_font_size, m_font_family;
242
264
};
243
265
 
244
266
class StyleFactory
247
269
    StyleFactory();
248
270
    ~StyleFactory();
249
271
 
250
 
    void addOfficeStyles( QDomDocument & doc, QDomElement & styles );
251
 
    void addOfficeMaster( QDomDocument & doc, QDomElement & master );
252
 
    void addOfficeAutomatic( QDomDocument & doc, QDomElement & automatic );
253
 
    void addAutomaticStyles( QDomDocument & doc, QDomElement & autoStyles );
254
 
 
255
 
    QString createStrokeDashStyle( int style );
256
 
    QString createGradientStyle( QDomElement & gradient );
257
 
    QString createMarkerStyle( int style );
258
 
    QString createHatchStyle( int style, QString & color );
259
 
    QString createListStyle( QDomElement & e );
260
 
    QString createPageStyle( QDomElement & e );
261
 
    QString createTextStyle( QDomElement & e );
262
 
    QString createGraphicStyle( QDomElement & e );
263
 
    QString createParagraphStyle( QDomElement & e );
264
 
    QString createPageMasterStyle( QDomElement & e );
265
 
 
266
 
    static QString toCentimeter( const QString & point );
 
272
    void addOfficeStyles(QDomDocument & doc, QDomElement & styles);
 
273
    void addOfficeMaster(QDomDocument & doc, QDomElement & master);
 
274
    void addOfficeAutomatic(QDomDocument & doc, QDomElement & automatic);
 
275
    void addAutomaticStyles(QDomDocument & doc, QDomElement & autoStyles);
 
276
 
 
277
    QString createStrokeDashStyle(int style);
 
278
    QString createGradientStyle(QDomElement & gradient);
 
279
    QString createMarkerStyle(int style);
 
280
    QString createHatchStyle(int style, QString & color);
 
281
    QString createListStyle(QDomElement & e);
 
282
    QString createPageStyle(QDomElement & e);
 
283
    QString createTextStyle(QDomElement & e);
 
284
    QString createGraphicStyle(QDomElement & e);
 
285
    QString createParagraphStyle(QDomElement & e);
 
286
    QString createPageMasterStyle(QDomElement & e);
 
287
 
 
288
    static QString toCentimeter(const QString & point);
267
289
 
268
290
private:
269
291
    QList<StrokeDashStyle*>   m_strokeDashStyles;