RVNGHTMLTextTableStyle.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* librevenge
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2002-2004 William Lachance (wrlach@gmail.com)
00011  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
00012  * Copyright (C) 2004 Fridrich Strba (fridrich.strba@bluewin.ch)
00013  * Copyright (C) 2005 Net Integration Technologies (http://www.net-itech.com)
00014  *
00015  * For minor contributions see the git repository.
00016  *
00017  * Alternatively, the contents of this file may be used under the terms
00018  * of the GNU Lesser General Public License Version 2.1 or later
00019  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00020  * applicable instead of those above.
00021  */
00022 
00023 #ifndef RVNGHTMLTEXT_TABLESTYLE_H
00024 #define RVNGHTMLTEXT_TABLESTYLE_H
00025 
00026 #include <librevenge/librevenge.h>
00027 
00028 #include <ostream>
00029 #include <string>
00030 #include <map>
00031 #include <vector>
00032 
00033 namespace librevenge
00034 {
00036 class RVNGHTMLTextTableStyleManager
00037 {
00038 public:
00040         RVNGHTMLTextTableStyleManager() : m_cellContentNameMap(), m_rowContentNameMap(), m_columWitdhsStack()
00041         {
00042         }
00044         ~RVNGHTMLTextTableStyleManager()
00045         {
00046         }
00048         void openTable(RVNGPropertyListVector const &colList);
00050         void closeTable();
00052         std::string getCellClass(RVNGPropertyList const &pList);
00054         std::string getRowClass(RVNGPropertyList const &pList);
00056         void send(std::ostream &out);
00057 private:
00059         std::string getCellContent(RVNGPropertyList const &pList) const;
00061         std::string getRowContent(RVNGPropertyList const &pList) const;
00063         bool getColumnsWidth(int i, int numSpanned, double &w) const;
00065         std::map<std::string, std::string> m_cellContentNameMap;
00067         std::map<std::string, std::string> m_rowContentNameMap;
00069         std::vector<std::vector<double> > m_columWitdhsStack;
00070 
00071         RVNGHTMLTextTableStyleManager(RVNGHTMLTextTableStyleManager const &orig);
00072         RVNGHTMLTextTableStyleManager operator=(RVNGHTMLTextTableStyleManager const &orig);
00073 };
00074 }
00075 #endif
00076 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */