- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

EPUBParagraphStyleManager.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 libepubgen 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 INCLUDED_EPUBPARAGRAPHSTYLEMANAGER_H
11 #define INCLUDED_EPUBPARAGRAPHSTYLEMANAGER_H
12
13 #include <string>
14 #include <map>
15
16 #include <boost/unordered_map.hpp>
17
18 #include <librevenge/librevenge.h>
19
20 #include "EPUBCSSProperties.h"
21
22 namespace libepubgen
23 {
24
25 class EPUBCSSSink;
26
28 class EPUBParagraphStyleManager
29 {
30 typedef boost::unordered_map<EPUBCSSProperties, std::string> ContentNameMap_t;
31
32 public:
34 EPUBParagraphStyleManager() : m_contentNameMap(), m_idNameMap()
35 {
36 }
38 virtual ~EPUBParagraphStyleManager()
39 {
40 }
42 void defineParagraph(librevenge::RVNGPropertyList const &pList);
44 std::string getClass(librevenge::RVNGPropertyList const &pList);
46 void send(EPUBCSSSink &out);
47 protected:
49 void extractProperties(librevenge::RVNGPropertyList const &pList, bool isList, EPUBCSSProperties &cssProps) const;
51 ContentNameMap_t m_contentNameMap;
53 std::map<int, std::string> m_idNameMap;
55 void extractBorders(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const;
56 private:
57 EPUBParagraphStyleManager(EPUBParagraphStyleManager const &orig);
58 EPUBParagraphStyleManager operator=(EPUBParagraphStyleManager const &orig);
59 };
60
61 }
62
63 #endif
64
65 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libepubgen::EPUBParagraphStyleManager::defineParagraph
void defineParagraph(librevenge::RVNGPropertyList const &pList)
define a paragraph style
Definition: EPUBParagraphStyleManager.cpp:44
libepubgen::EPUBCSSSink
Definition: EPUBCSSSink.h:23
libepubgen
Definition: EPUBBinarySink.cpp:12
libepubgen::EPUBParagraphStyleManager::ContentNameMap_t
boost::unordered_map< EPUBCSSProperties, std::string > ContentNameMap_t
Definition: EPUBParagraphStyleManager.h:30
libepubgen::EPUBParagraphStyleManager
Small class to manage the paragraph style.
Definition: EPUBParagraphStyleManager.h:28
libepubgen::EPUBParagraphStyleManager::m_contentNameMap
ContentNameMap_t m_contentNameMap
a map content -> name
Definition: EPUBParagraphStyleManager.h:51
libepubgen::EPUBParagraphStyleManager::~EPUBParagraphStyleManager
virtual ~EPUBParagraphStyleManager()
destructor
Definition: EPUBParagraphStyleManager.h:38
EPUBCSSProperties.h
libepubgen::EPUBParagraphStyleManager::extractBorders
void extractBorders(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const
add data corresponding to the border
Definition: EPUBParagraphStyleManager.cpp:138
libepubgen::EPUBParagraphStyleManager::operator=
EPUBParagraphStyleManager operator=(EPUBParagraphStyleManager const &orig)
libepubgen::EPUBCSSProperties
std::map< std::string, std::string > EPUBCSSProperties
Definition: EPUBCSSProperties.h:21
libepubgen::EPUBParagraphStyleManager::m_idNameMap
std::map< int, std::string > m_idNameMap
a map id -> name
Definition: EPUBParagraphStyleManager.h:53
libepubgen::EPUBParagraphStyleManager::getClass
std::string getClass(librevenge::RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition: EPUBParagraphStyleManager.cpp:25
libepubgen::EPUBParagraphStyleManager::extractProperties
void extractProperties(librevenge::RVNGPropertyList const &pList, bool isList, EPUBCSSProperties &cssProps) const
convert a property list into a CSS property map
Definition: EPUBParagraphStyleManager.cpp:67
libepubgen::EPUBParagraphStyleManager::EPUBParagraphStyleManager
EPUBParagraphStyleManager()
constructor
Definition: EPUBParagraphStyleManager.h:34
libepubgen::EPUBParagraphStyleManager::send
void send(EPUBCSSSink &out)
send the data to the sink
Definition: EPUBParagraphStyleManager.cpp:57