EPUBTableStyleManager.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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