EPUBSpanStyleManager.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

EPUBSpanStyleManager.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_EPUBSPANSTYLEMANAGER_H
11 #define INCLUDED_EPUBSPANSTYLEMANAGER_H
12
13 #include <map>
14 #include <string>
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 EPUBSpanStyleManager
29 {
30 typedef boost::unordered_map<EPUBCSSProperties, std::string> ContentNameMap_t;
31
32 public:
34 EPUBSpanStyleManager() : m_contentNameMap(), m_idNameMap()
35 {
36 }
38 ~EPUBSpanStyleManager()
39 {
40 }
42 void defineSpan(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, EPUBCSSProperties &cssProps) const;
51 void extractTextPosition(char const *value, EPUBCSSProperties &cssProps) const;
53 void extractDecorations(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const;
55 ContentNameMap_t m_contentNameMap;
57 std::map<int, std::string> m_idNameMap;
58
59 private:
60 EPUBSpanStyleManager(EPUBSpanStyleManager const &orig);
61 EPUBSpanStyleManager operator=(EPUBSpanStyleManager const &orig);
62 };
63
64 }
65
66 #endif
67
68 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libepubgen::EPUBSpanStyleManager::m_idNameMap
std::map< int, std::string > m_idNameMap
a map id -> name
Definition: EPUBSpanStyleManager.h:57
libepubgen::EPUBSpanStyleManager
Small class to manage the span style.
Definition: EPUBSpanStyleManager.h:28
libepubgen::EPUBCSSSink
Definition: EPUBCSSSink.h:23
libepubgen
Definition: EPUBBinarySink.cpp:12
libepubgen::EPUBSpanStyleManager::~EPUBSpanStyleManager
~EPUBSpanStyleManager()
destructor
Definition: EPUBSpanStyleManager.h:38
libepubgen::EPUBSpanStyleManager::defineSpan
void defineSpan(librevenge::RVNGPropertyList const &pList)
define a span style
Definition: EPUBSpanStyleManager.cpp:45
libepubgen::EPUBSpanStyleManager::ContentNameMap_t
boost::unordered_map< EPUBCSSProperties, std::string > ContentNameMap_t
Definition: EPUBSpanStyleManager.h:30
libepubgen::EPUBSpanStyleManager::getClass
std::string getClass(librevenge::RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition: EPUBSpanStyleManager.cpp:25
libepubgen::EPUBSpanStyleManager::EPUBSpanStyleManager
EPUBSpanStyleManager()
constructor
Definition: EPUBSpanStyleManager.h:34
EPUBCSSProperties.h
libepubgen::EPUBSpanStyleManager::operator=
EPUBSpanStyleManager operator=(EPUBSpanStyleManager const &orig)
libepubgen::EPUBSpanStyleManager::m_contentNameMap
ContentNameMap_t m_contentNameMap
a map content -> name
Definition: EPUBSpanStyleManager.h:55
libepubgen::EPUBSpanStyleManager::extractProperties
void extractProperties(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const
convert a property list into a CSS property map
Definition: EPUBSpanStyleManager.cpp:68
libepubgen::EPUBSpanStyleManager::send
void send(EPUBCSSSink &out)
send the data to the sink
Definition: EPUBSpanStyleManager.cpp:58
libepubgen::EPUBCSSProperties
std::map< std::string, std::string > EPUBCSSProperties
Definition: EPUBCSSProperties.h:21
libepubgen::EPUBSpanStyleManager::extractDecorations
void extractDecorations(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const
add data corresponding to the line decoration into the map
Definition: EPUBSpanStyleManager.cpp:136
libepubgen::EPUBSpanStyleManager::extractTextPosition
void extractTextPosition(char const *value, EPUBCSSProperties &cssProps) const
add data corresponding to a text position into the map
Definition: EPUBSpanStyleManager.cpp:151