ABWStylesCollector.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

ABWStylesCollector.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libabw project.
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 #ifndef __ABWSTYLESCOLLECTOR_H__
11 #define __ABWSTYLESCOLLECTOR_H__
12
13 #include <stack>
14 #include <librevenge/librevenge.h>
15 #include "ABWCollector.h"
16
17 namespace libabw
18 {
19
20 struct ABWStylesTableState
21 {
22 ABWStylesTableState();
23 ABWStylesTableState(const ABWStylesTableState &ts);
24 ~ABWStylesTableState();
25
26 ABWPropertyMap m_currentCellProperties;
27
28 int m_currentTableWidth;
29 int m_currentTableRow;
30 int m_currentTableId;
31 };
32
33 struct ABWStylesParsingState
34 {
35 ABWStylesParsingState();
36 ABWStylesParsingState(const ABWStylesParsingState &ps);
37 ~ABWStylesParsingState();
38
39 std::stack<ABWStylesTableState> m_tableStates;
40 };
41
42 class ABWStylesCollector : public ABWCollector
43 {
44 public:
45 ABWStylesCollector(std::map<int, int> &tableSizes,
46 std::map<std::string, ABWData> &data,
47 std::map<int, ABWListElement *> &listElements);
48 virtual ~ABWStylesCollector();
49
50 // collector functions
51
52 void collectTextStyle(const char *, const char *, const char *, const char *) {}
53 void collectDocumentProperties(const char *) {}
54 void collectParagraphProperties(const char *level, const char *listid, const char *parentid,
55 const char *style, const char *props);
56 void collectSectionProperties(const char *, const char *, const char *, const char *,
57 const char *, const char *, const char *, const char *,
58 const char *) {}
59 void collectCharacterProperties(const char *, const char *) {}
60 void collectPageSize(const char *, const char *, const char *, const char *) {}
61 void closeParagraphOrListElement() {}
62 void closeSpan() {}
63 void openLink(const char *) {}
64 void closeLink() {}
65 void openFoot(const char *) {}
66 void closeFoot() {}
67 void openEndnote(const char *) {}
68 void closeEndnote() {}
69 void endSection() {}
70 void startDocument() {}
71 void endDocument() {}
72 void insertLineBreak() {}
73 void insertColumnBreak() {}
74 void insertPageBreak() {}
75 void insertText(const char *) {}
76 void insertImage(const char *, const char *) {}
77
78 void collectData(const char *name, const char *mimeType, const librevenge::RVNGBinaryData &data);
79 void collectHeaderFooter(const char *, const char *) {}
80 void collectList(const char *id, const char *listDecimal, const char *listDelim,
81 const char *parentid, const char *startValue, const char *type);
82
83 void openTable(const char *props);
84 void closeTable();
85 void openCell(const char *props);
86 void closeCell();
87
88 void addMetadataEntry(const char *, const char *) {}
89
90 private:
91 ABWStylesCollector(const ABWStylesCollector &);
92 ABWStylesCollector &operator=(const ABWStylesCollector &);
93
94 std::string _findCellProperty(const char *name);
95 void _processList(int id, const char *listDelim, int parentid, int startValue, int type);
96
97 ABWStylesParsingState *m_ps;
98 std::map<int, int> &m_tableSizes;
99 std::map<std::string, ABWData> &m_data;
100 int m_tableCounter;
101 std::map<int, ABWListElement *> &m_listElements;
102 };
103
104 } // namespace libabw
105
106 #endif /* __ABWSTYLESCOLLECTOR_H__ */
107 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libabw::ABWStylesCollector::openLink
void openLink(const char *)
Definition: ABWStylesCollector.h:63
libabw::ABWStylesTableState::m_currentTableWidth
int m_currentTableWidth
Definition: ABWStylesCollector.h:28
libabw::ABWStylesTableState::~ABWStylesTableState
~ABWStylesTableState()
Definition: ABWStylesCollector.cpp:128
libabw::ABWStylesTableState::m_currentTableRow
int m_currentTableRow
Definition: ABWStylesCollector.h:29
libabw::ABWStylesCollector::insertLineBreak
void insertLineBreak()
Definition: ABWStylesCollector.h:72
libabw::ABWStylesCollector::insertText
void insertText(const char *)
Definition: ABWStylesCollector.h:75
libabw::ABWStylesCollector::operator=
ABWStylesCollector & operator=(const ABWStylesCollector &)
libabw::ABWStylesParsingState::~ABWStylesParsingState
~ABWStylesParsingState()
Definition: ABWStylesCollector.cpp:136
libabw::ABWStylesTableState
Definition: ABWStylesCollector.h:20
libabw::ABWStylesCollector
Definition: ABWStylesCollector.h:42
libabw::ABWStylesCollector::closeLink
void closeLink()
Definition: ABWStylesCollector.h:64
libabw::ABWStylesCollector::openTable
void openTable(const char *props)
Definition: ABWStylesCollector.cpp:152
libabw::ABWStylesTableState::m_currentCellProperties
ABWPropertyMap m_currentCellProperties
Definition: ABWStylesCollector.h:26
libabw::ABWStylesParsingState::m_tableStates
std::stack< ABWStylesTableState > m_tableStates
Definition: ABWStylesCollector.h:39
libabw::ABWStylesCollector::m_tableSizes
std::map< int, int > & m_tableSizes
Definition: ABWStylesCollector.h:98
libabw::ABWStylesCollector::collectHeaderFooter
void collectHeaderFooter(const char *, const char *)
Definition: ABWStylesCollector.h:79
libabw::ABWStylesTableState::m_currentTableId
int m_currentTableId
Definition: ABWStylesCollector.h:30
libabw::ABWStylesCollector::collectData
void collectData(const char *name, const char *mimeType, const librevenge::RVNGBinaryData &data)
Definition: ABWStylesCollector.cpp:206
libabw::ABWStylesCollector::closeSpan
void closeSpan()
Definition: ABWStylesCollector.h:62
libabw
Definition: ABWCollector.h:17
libabw::ABWStylesCollector::closeFoot
void closeFoot()
Definition: ABWStylesCollector.h:66
libabw::ABWStylesCollector::endDocument
void endDocument()
Definition: ABWStylesCollector.h:71
libabw::ABWStylesCollector::collectTextStyle
void collectTextStyle(const char *, const char *, const char *, const char *)
Definition: ABWStylesCollector.h:52
libabw::ABWStylesCollector::~ABWStylesCollector
virtual ~ABWStylesCollector()
Definition: ABWStylesCollector.cpp:147
libabw::ABWStylesTableState::ABWStylesTableState
ABWStylesTableState()
Definition: ABWStylesCollector.cpp:116
libabw::ABWStylesCollector::ABWStylesCollector
ABWStylesCollector(std::map< int, int > &tableSizes, std::map< std::string, ABWData > &data, std::map< int, ABWListElement * > &listElements)
Definition: ABWStylesCollector.cpp:138
libabw::ABWStylesCollector::closeParagraphOrListElement
void closeParagraphOrListElement()
Definition: ABWStylesCollector.h:61
libabw::ABWStylesCollector::collectSectionProperties
void collectSectionProperties(const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *)
Definition: ABWStylesCollector.h:56
libabw::ABWStylesCollector::m_tableCounter
int m_tableCounter
Definition: ABWStylesCollector.h:100
libabw::ABWStylesCollector::insertImage
void insertImage(const char *, const char *)
Definition: ABWStylesCollector.h:76
libabw::ABWStylesCollector::closeEndnote
void closeEndnote()
Definition: ABWStylesCollector.h:68
libabw::ABWStylesCollector::collectDocumentProperties
void collectDocumentProperties(const char *)
Definition: ABWStylesCollector.h:53
libabw::ABWStylesCollector::collectParagraphProperties
void collectParagraphProperties(const char *level, const char *listid, const char *parentid, const char *style, const char *props)
Definition: ABWStylesCollector.cpp:337
libabw::ABWStylesCollector::openEndnote
void openEndnote(const char *)
Definition: ABWStylesCollector.h:67
libabw::ABWStylesParsingState
Definition: ABWStylesCollector.h:33
libabw::ABWStylesParsingState::ABWStylesParsingState
ABWStylesParsingState()
Definition: ABWStylesCollector.cpp:130
libabw::ABWStylesCollector::collectPageSize
void collectPageSize(const char *, const char *, const char *, const char *)
Definition: ABWStylesCollector.h:60
libabw::ABWStylesCollector::addMetadataEntry
void addMetadataEntry(const char *, const char *)
Definition: ABWStylesCollector.h:88
libabw::ABWStylesCollector::insertColumnBreak
void insertColumnBreak()
Definition: ABWStylesCollector.h:73
libabw::ABWStylesCollector::m_listElements
std::map< int, ABWListElement * > & m_listElements
Definition: ABWStylesCollector.h:101
libabw::ABWStylesCollector::_findCellProperty
std::string _findCellProperty(const char *name)
Definition: ABWStylesCollector.cpp:198
libabw::ABWCollector
Definition: ABWCollector.h:103
libabw::ABWStylesCollector::openFoot
void openFoot(const char *)
Definition: ABWStylesCollector.h:65
libabw::ABWStylesCollector::collectList
void collectList(const char *id, const char *listDecimal, const char *listDelim, const char *parentid, const char *startValue, const char *type)
Definition: ABWStylesCollector.cpp:315
libabw::ABWStylesCollector::_processList
void _processList(int id, const char *listDelim, int parentid, int startValue, int type)
Definition: ABWStylesCollector.cpp:213
libabw::ABWStylesCollector::collectCharacterProperties
void collectCharacterProperties(const char *, const char *)
Definition: ABWStylesCollector.h:59
libabw::ABWStylesCollector::closeTable
void closeTable()
Definition: ABWStylesCollector.cpp:160
libabw::ABWPropertyMap
std::map< std::string, std::string > ABWPropertyMap
Definition: ABWCollector.h:38
libabw::ABWStylesCollector::endSection
void endSection()
Definition: ABWStylesCollector.h:69
libabw::ABWStylesCollector::openCell
void openCell(const char *props)
Definition: ABWStylesCollector.cpp:168
libabw::ABWStylesCollector::m_data
std::map< std::string, ABWData > & m_data
Definition: ABWStylesCollector.h:99
ABWCollector.h
libabw::ABWStylesCollector::startDocument
void startDocument()
Definition: ABWStylesCollector.h:70
libabw::ABWStylesCollector::m_ps
ABWStylesParsingState * m_ps
Definition: ABWStylesCollector.h:97
libabw::ABWStylesCollector::closeCell
void closeCell()
Definition: ABWStylesCollector.cpp:192
libabw::ABWStylesCollector::insertPageBreak
void insertPageBreak()
Definition: ABWStylesCollector.h:74