TableStyle.h
1/* TableStyle: Stores (and writes) table-based information that is
2 * needed at the head of an OO document.
3 *
4 * Copyright (C) 2002-2003 William Lachance (william.lachance@sympatico.ca)
5 * Copyright (C) 2004 Fridrich Strba (fridrich.strba@bluewin.ch)
6 *
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.
11 *
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.
16 *
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., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 * For further information visit http://libwpd.sourceforge.net
23 *
24 */
25
26/* "This product is not manufactured, approved, or supported by
27 * Corel Corporation or Corel Corporation Limited."
28 */
29#ifndef _TABLESTYLE_H
30#define _TABLESTYLE_H
31#include <libwpd/libwpd.h>
32#include <vector>
33#include "shared_headers.h"
34#include "Style.h"
35#include "WriterProperties.h"
36
37class DocumentElement;
38class DocumentHandler;
39
40class TableCellStyle : public Style
41{
42public:
43 TableCellStyle(const _SH_PropertyList &xPropList, const char *psName);
44 virtual void write(DocumentHandler &xHandler) const;
45private:
46 _SH_PropertyList mPropList;
47};
48
49class TableRowStyle : public Style
50{
51public:
52 TableRowStyle(const _SH_PropertyList &propList, const char *psName);
53 virtual void write(DocumentHandler &xHandler) const;
54private:
55 _SH_PropertyList mPropList;
56};
57
58class TableStyle : public Style, public TopLevelElementStyle
59{
60public:
61 TableStyle(const _SH_PropertyList &xPropList, const _SH_PropertyListVector &columns, const char *psName);
62 ~TableStyle();
63 virtual void write(DocumentHandler &xHandler) const;
64 const int getNumColumns() const { return mColumns.count(); }
65 void addTableCellStyle(TableCellStyle *pTableCellStyle) { mTableCellStyles.push_back(pTableCellStyle); }
66 int getNumTableCellStyles() { return mTableCellStyles.size(); }
67 void addTableRowStyle(TableRowStyle *pTableRowStyle) { mTableRowStyles.push_back(pTableRowStyle); }
68 int getNumTableRowStyles() { return mTableRowStyles.size(); }
69private:
70 _SH_PropertyList mPropList;
71 _SH_PropertyListVector mColumns;
72 std::vector<TableCellStyle *> mTableCellStyles;
73 std::vector<TableRowStyle *> mTableRowStyles;
74};
75#endif