Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /* ListStyle: Stores (and writes) list-based information that is
3 : * needed at the head of an OO document.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : /* "This product is not manufactured, approved, or supported by
11 : * Corel Corporation or Corel Corporation Limited."
12 : */
13 : #ifndef _LISTSTYLE_H
14 : #define _LISTSTYLE_H
15 : #include <libwpd/libwpd.h>
16 :
17 : #define WP6_NUM_LIST_LEVELS 8 // see WP6FileStructure.h (we shouldn't need to reference this)
18 :
19 : #include "Style.hxx"
20 :
21 0 : class ListLevelStyle
22 : {
23 : public:
24 0 : virtual ~ListLevelStyle() {};
25 : virtual void write(OdfDocumentHandler *pHandler, int iLevel) const = 0;
26 : };
27 :
28 0 : class OrderedListLevelStyle : public ListLevelStyle
29 : {
30 : public:
31 : OrderedListLevelStyle(const WPXPropertyList &xPropList);
32 : void write(OdfDocumentHandler *pHandler, int iLevel) const;
33 : private:
34 : WPXPropertyList mPropList;
35 : };
36 :
37 0 : class UnorderedListLevelStyle : public ListLevelStyle
38 : {
39 : public:
40 : UnorderedListLevelStyle(const WPXPropertyList &xPropList);
41 : void write(OdfDocumentHandler *pHandler, int iLevel) const;
42 : private:
43 : WPXPropertyList mPropList;
44 : };
45 :
46 : class ListStyle : public Style
47 : {
48 : public:
49 : ListStyle(const char *psName, const int iListID);
50 : virtual ~ListStyle();
51 : virtual void updateListLevel(const int iLevel, const WPXPropertyList &xPropList) = 0;
52 : virtual void write(OdfDocumentHandler *pHandler) const;
53 0 : int getListID()
54 : {
55 0 : return miListID;
56 : }
57 : bool isListLevelDefined(int iLevel) const;
58 :
59 : protected:
60 : void setListLevel(int iLevel, ListLevelStyle *iListLevelStyle);
61 :
62 : private:
63 : ListLevelStyle *mppListLevels[WP6_NUM_LIST_LEVELS];
64 : const int miListID;
65 : };
66 :
67 0 : class OrderedListStyle : public ListStyle
68 : {
69 : public:
70 0 : OrderedListStyle(const char *psName, const int iListID) : ListStyle(psName, iListID) {}
71 : void updateListLevel(const int iLevel, const WPXPropertyList &xPropList);
72 : };
73 :
74 0 : class UnorderedListStyle : public ListStyle
75 : {
76 : public:
77 0 : UnorderedListStyle(const char *psName, const int iListID) : ListStyle(psName, iListID) {}
78 : void updateListLevel(const int iLevel, const WPXPropertyList &xPropList);
79 : };
80 : #endif
81 :
82 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|