merge the formfield patch from ooo-build
[ooovba.git] / writerperfect / source / filter / TableStyle.hxx
bloba4c7116edb6d7d2e943a70bb993a21f6d2573731
1 /* TableStyle: Stores (and writes) table-based information that is
2 * needed at the head of an OO document.
4 * Copyright (C) 2002-2003 William Lachance (william.lachance@sympatico.ca)
5 * Copyright (C) 2004 Fridrich Strba (fridrich.strba@bluewin.ch)
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser 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.
12 * This program 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.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * For further information visit http://libwpd.sourceforge.net
25 /* "This product is not manufactured, approved, or supported by
26 * Corel Corporation or Corel Corporation Limited."
28 #ifndef _TABLESTYLE_H
29 #define _TABLESTYLE_H
30 #if defined _MSC_VER
31 #pragma warning( push, 1 )
32 #endif
33 #include <libwpd/libwpd.h>
34 #if defined _MSC_VER
35 #pragma warning( pop )
36 #endif
37 #include <vector>
39 #include "Style.hxx"
40 #include "WriterProperties.hxx"
42 class DocumentElement;
43 class DocumentHandler;
45 class TableCellStyle : public Style
47 public:
48 TableCellStyle(const WPXPropertyList &xPropList, const char *psName);
49 virtual void write(DocumentHandler *pHandler) const;
50 private:
51 WPXPropertyList mPropList;
54 class TableRowStyle : public Style
56 public:
57 TableRowStyle(const WPXPropertyList &propList, const char *psName);
58 virtual void write(DocumentHandler *pHandler) const;
59 private:
60 WPXPropertyList mPropList;
63 class TableStyle : public Style, public TopLevelElementStyle
65 public:
66 TableStyle(const WPXPropertyList &xPropList, const WPXPropertyListVector &columns, const char *psName);
67 ~TableStyle();
68 virtual void write(DocumentHandler *pHandler) const;
69 int getNumColumns() const { return mColumns.count(); }
70 void addTableCellStyle(TableCellStyle *pTableCellStyle) { mTableCellStyles.push_back(pTableCellStyle); }
71 int getNumTableCellStyles() { return mTableCellStyles.size(); }
72 void addTableRowStyle(TableRowStyle *pTableRowStyle) { mTableRowStyles.push_back(pTableRowStyle); }
73 int getNumTableRowStyles() { return mTableRowStyles.size(); }
74 private:
75 WPXPropertyList mPropList;
76 WPXPropertyListVector mColumns;
77 std::vector<TableCellStyle *> mTableCellStyles;
78 std::vector<TableRowStyle *> mTableRowStyles;
80 #endif