EPUBTableStyleManager.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_EPUBTABLESTYLEMANAGER_H
11 #define INCLUDED_EPUBTABLESTYLEMANAGER_H
12 
13 #include <librevenge/librevenge.h>
14 
15 #include <string>
16 #include <vector>
17 
18 #include <boost/unordered_map.hpp>
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 openTable(librevenge::RVNGPropertyListVector const &colList);
44  void closeTable();
46  std::string getCellClass(librevenge::RVNGPropertyList const &pList);
48  std::string getRowClass(librevenge::RVNGPropertyList const &pList);
50  void send(EPUBCSSSink &out);
51 private:
53  void extractCellProperties(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const;
55  void extractRowProperties(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const;
57  bool getColumnsWidth(int i, int numSpanned, double &w) const;
59  ContentNameMap_t m_cellContentNameMap;
61  ContentNameMap_t m_rowContentNameMap;
63  std::vector<std::vector<double> > m_columWitdhsStack;
64 
67 };
68 
69 }
70 
71 #endif
72 
73 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
ContentNameMap_t m_rowContentNameMap
a map row content -> name
Definition: EPUBTableStyleManager.h:61
Definition: EPUBCSSSink.h:23
EPUBTableStyleManager operator=(EPUBTableStyleManager const &orig)
Definition: EPUBBinarySink.cpp:12
std::vector< std::vector< double > > m_columWitdhsStack
a stack of column width (in inches )
Definition: EPUBTableStyleManager.h:63
EPUBTableStyleManager()
constructor
Definition: EPUBTableStyleManager.h:34
std::string getCellClass(librevenge::RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition: EPUBTableStyleManager.cpp:88
Small class to manage the tables style.
Definition: EPUBTableStyleManager.h:28
void extractRowProperties(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const
convert a property list into a CSS property map
Definition: EPUBTableStyleManager.cpp:183
void openTable(librevenge::RVNGPropertyListVector const &colList)
open a table
Definition: EPUBTableStyleManager.cpp:25
std::map< std::string, std::string > EPUBCSSProperties
Definition: EPUBCSSProperties.h:21
~EPUBTableStyleManager()
destructor
Definition: EPUBTableStyleManager.h:38
void closeTable()
close a table
Definition: EPUBTableStyleManager.cpp:47
boost::unordered_map< EPUBCSSProperties, std::string > ContentNameMap_t
Definition: EPUBTableStyleManager.h:30
void extractCellProperties(librevenge::RVNGPropertyList const &pList, EPUBCSSProperties &cssProps) const
convert a property list into a CSS property map
Definition: EPUBTableStyleManager.cpp:131
bool getColumnsWidth(int i, int numSpanned, double &w) const
try to return the col width
Definition: EPUBTableStyleManager.cpp:57
ContentNameMap_t m_cellContentNameMap
a map cell content -> name
Definition: EPUBTableStyleManager.h:59
std::string getRowClass(librevenge::RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition: EPUBTableStyleManager.cpp:101
void send(EPUBCSSSink &out)
send the data to the sink
Definition: EPUBTableStyleManager.cpp:114

Generated for libepubgen by doxygen 1.8.13