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

Generated for libepubgen by doxygen 1.8.8