filters

ListStyle.h
1/* ListStyle: Stores (and writes) list-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 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 * For further information visit http://libwpd.sourceforge.net
22 *
23 */
24
25/* "This product is not manufactured, approved, or supported by
26 * Corel Corporation or Corel Corporation Limited."
27 */
28#ifndef _LISTSTYLE_H
29#define _LISTSTYLE_H
30#include <libwpd/libwpd.h>
31#include "shared_headers.h"
32
33#define WP6_NUM_LIST_LEVELS 8 // see WP6FileStructure.h (we shouldn't need to reference this)
34
35#include "Style.h"
36#include "WriterProperties.h"
37
38class DocumentElement;
39
40class ListLevelStyle
41{
42public:
43 virtual void write(DocumentHandler &xHandler, int iLevel) const = 0;
44 virtual ~ListLevelStyle() {}
45};
46
47class OrderedListLevelStyle : public ListLevelStyle
48{
49public:
50 OrderedListLevelStyle(const _SH_PropertyList &xPropList);
51 virtual void write(DocumentHandler &xHandler, int iLevel) const;
52private:
53 _SH_PropertyList mPropList;
54};
55
56class UnorderedListLevelStyle : public ListLevelStyle
57{
58public:
59 UnorderedListLevelStyle(const _SH_PropertyList &xPropList);
60 virtual void write(DocumentHandler &xHandler, int iLevel) const;
61private:
62 _SH_PropertyList mPropList;
63};
64
65class ListStyle : public Style
66{
67public:
68 ListStyle(const char *psName, const int iListID);
69 virtual ~ListStyle();
70 virtual void updateListLevel(const int iLevel, const _SH_PropertyList &xPropList) = 0;
71 virtual void write(DocumentHandler &xHandler) const;
72 const int getListID() { return miListID; }
73 const bool isListLevelDefined(int iLevel) const;
74
75protected:
76 void setListLevel(int iLevel, ListLevelStyle *iListLevelStyle);
77
78private:
79 ListLevelStyle *mppListLevels[WP6_NUM_LIST_LEVELS];
80 int miNumListLevels;
81 const int miListID;
82};
83
84class OrderedListStyle : public ListStyle
85{
86public:
87 OrderedListStyle(const char *psName, const int iListID) : ListStyle(psName, iListID) {}
88 void updateListLevel(const int iLevel, const _SH_PropertyList &xPropList);
89};
90
91class UnorderedListStyle : public ListStyle
92{
93public:
94 UnorderedListStyle(const char *psName, const int iListID) : ListStyle(psName, iListID) {}
95 void updateListLevel(const int iLevel, const _SH_PropertyList &xPropList);
96};
97#endif