1
/* This file is part of the KDE project
2
Copyright (C) 2003 Norbert Andres <nandres@web.de>
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 OPENCALCSTYLEEXPORT_H
22
#define OPENCALCSTYLEEXPORT_H
24
#include "kspread_format.h"
36
typedef enum T1 { Boolean, Date, Number, Percentage, Time } NumberType;
41
enum breakBefore { none, automatic, page };
43
Style() : breakB( none ), size( 0.0 ) {}
53
SheetStyle() : visible( true ) {}
55
void copyData( SheetStyle const & ts ) { visible = ts.visible; }
56
static bool isEqual( SheetStyle const * const t1, SheetStyle const & t2 );
67
void copyData( NumberStyle const & ts ) { type = ts.type; }
68
static bool isEqual( NumberStyle const * const t1, NumberStyle const & t2 );
81
void copyData( CellStyle const & ts );
82
static bool isEqual( CellStyle const * const t1, CellStyle const & t2 );
84
// all except the number style
85
static void loadData( CellStyle & cs, KSpreadCell const * const cell );
106
KSpreadFormat::Align alignX;
107
KSpreadFormat::AlignY alignY;
110
class ColumnStyle : public Style
113
ColumnStyle() : Style() {}
115
void copyData( ColumnStyle const & cs );
116
static bool isEqual( ColumnStyle const * const c1, ColumnStyle const & c2 );
119
class RowStyle : public Style
122
RowStyle() : Style() {}
124
void copyData( RowStyle const & cs );
125
static bool isEqual( RowStyle const * const c1, RowStyle const & c2 );
134
void writeStyles ( QDomDocument & doc, QDomElement & autoStyles );
135
void writeFontDecl( QDomDocument & doc, QDomElement & content );
137
void addFont( QFont const & font, bool def = false );
139
QString cellStyle( CellStyle const & cs );
140
QString columnStyle( ColumnStyle const & cs );
141
QString numberStyle( NumberStyle const & ns );
142
QString rowStyle( RowStyle const & rs );
143
QString sheetStyle( SheetStyle const & ts );
146
QPtrList<CellStyle> m_cellStyles;
147
QPtrList<ColumnStyle> m_columnStyles;
148
QPtrList<NumberStyle> m_numberStyles;
149
QPtrList<RowStyle> m_rowStyles;
150
QPtrList<SheetStyle> m_sheetStyles;
151
QPtrList<QFont> m_fontList;
155
void addCellStyles( QDomDocument & doc, QDomElement & autoStyles );
156
void addColumnStyles( QDomDocument & doc, QDomElement & autoStyles );
157
void addNumberStyles( QDomDocument & doc, QDomElement & autoStyles );
158
void addRowStyles( QDomDocument & doc, QDomElement & autoStyles );
159
void addSheetStyles( QDomDocument & doc, QDomElement & autoStyles );