RVNGHTMLTextTextStyle.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* librevenge
3  * Version: MPL 2.0 / LGPLv2.1+
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  * Major Contributor(s):
10  * Copyright (C) 2002-2004 William Lachance (wrlach@gmail.com)
11  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
12  * Copyright (C) 2004 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2005 Net Integration Technologies (http://www.net-itech.com)
14  *
15  * For minor contributions see the git repository.
16  *
17  * Alternatively, the contents of this file may be used under the terms
18  * of the GNU Lesser General Public License Version 2.1 or later
19  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
20  * applicable instead of those above.
21  */
22 
23 #ifndef RVNGHTMLTEXT_TEXTSTYLE_H
24 #define RVNGHTMLTEXT_TEXTSTYLE_H
25 
26 #include <ostream>
27 #include <string>
28 #include <map>
29 #include <vector>
30 
32 
33 namespace librevenge
34 {
37 {
38 public:
41  {
42  }
45  {
46  }
48  void defineParagraph(RVNGPropertyList const &pList);
50  std::string getClass(RVNGPropertyList const &pList);
52  void send(std::ostream &out);
53 protected:
55  std::string getContent(RVNGPropertyList const &pList, bool isList) const;
57  std::map<std::string, std::string> m_contentNameMap;
59  std::map<int, std::string> m_idNameMap;
61  void parseBorders(RVNGPropertyList const &pList, std::ostream &out) const;
62 private:
65 };
66 
69 {
70 public:
71  struct List
72  {
75  {
76  }
79  {
80  }
82  void setLevel(int lvl, RVNGPropertyList const &property, bool ordered);
84  void openLevel() const
85  {
86  m_level++;
87  }
89  void closeLevel() const
90  {
91  if (m_level <= 0)
92  return;
93  m_level--;
94  }
95 
97  std::string str() const;
98  protected:
100  std::vector<std::string> m_contentsList;
102  mutable int m_level;
103  };
107  {
108  }
111  {
112  }
114  void defineLevel(RVNGPropertyList const &property, bool ordered);
116  std::string openLevel(RVNGPropertyList const &pList, bool ordered);
118  void closeLevel();
120  std::string getClass(RVNGPropertyList const &pList);
121 
123  void send(std::ostream &out);
124 protected:
126  std::map<std::string, std::string> m_levelNameMap;
128  std::map<int, List> m_idListMap;
130  std::vector<int> m_actualIdStack;
131 private:
134 };
135 
138 {
139 public:
142  {
143  }
146  {
147  }
149  void defineSpan(RVNGPropertyList const &pList);
151  std::string getClass(RVNGPropertyList const &pList);
153  void send(std::ostream &out);
154 protected:
156  std::string getContent(RVNGPropertyList const &pList) const;
158  void parseTextPosition(char const *value, std::ostream &out) const;
160  void parseDecorations(RVNGPropertyList const &pList, std::ostream &out) const;
162  std::map<std::string, std::string> m_contentNameMap;
164  std::map<int, std::string> m_idNameMap;
165 
166 private:
169 };
170 }
171 
172 #endif
173 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
void openLevel() const
open a new level
Definition: RVNGHTMLTextTextStyle.h:84
Small class to manage the list style.
Definition: RVNGHTMLTextTextStyle.h:68
std::map< std::string, std::string > m_contentNameMap
a map content -> name
Definition: RVNGHTMLTextTextStyle.h:162
std::map< int, std::string > m_idNameMap
a map id -> name
Definition: RVNGHTMLTextTextStyle.h:164
Definition: RVNGHTMLTextTextStyle.h:71
std::map< std::string, std::string > m_contentNameMap
a map content -> name
Definition: RVNGHTMLTextTextStyle.h:57
void defineParagraph(RVNGPropertyList const &pList)
define a paragraph style
Definition: RVNGHTMLTextTextStyle.cpp:191
std::vector< std::string > m_contentsList
the properties
Definition: RVNGHTMLTextTextStyle.h:100
std::string getClass(RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition: RVNGHTMLTextTextStyle.cpp:173
std::string str() const
return the content string
Definition: RVNGHTMLTextTextStyle.cpp:82
Small class to manage the span style.
Definition: RVNGHTMLTextTextStyle.h:137
~RVNGHTMLTextSpanStyleManager()
destructor
Definition: RVNGHTMLTextTextStyle.h:145
void defineLevel(RVNGPropertyList const &property, bool ordered)
add a level to the corresponding list
Definition: RVNGHTMLTextTextStyle.cpp:115
std::vector< int > m_actualIdStack
the actual list id
Definition: RVNGHTMLTextTextStyle.h:130
std::string getContent(RVNGPropertyList const &pList) const
convert a property list in a html content string
Definition: RVNGHTMLTextTextStyle.cpp:345
RVNGHTMLTextSpanStyleManager()
constructor
Definition: RVNGHTMLTextTextStyle.h:141
RVNGHTMLTextListStyleManager operator=(RVNGHTMLTextListStyleManager const &orig)
~RVNGHTMLTextListStyleManager()
destructor
Definition: RVNGHTMLTextTextStyle.h:110
std::string getClass(RVNGPropertyList const &pList)
returns the classname corresponding to a list element
Definition: RVNGHTMLTextTextStyle.cpp:103
std::string openLevel(RVNGPropertyList const &pList, bool ordered)
returns the class name corresponding to a propertylist
Definition: RVNGHTMLTextTextStyle.cpp:130
void send(std::ostream &out)
send the data to the stream
Definition: RVNGHTMLTextTextStyle.cpp:92
std::string getContent(RVNGPropertyList const &pList, bool isList) const
convert a property list in a html content string
Definition: RVNGHTMLTextTextStyle.cpp:214
List()
constructor
Definition: RVNGHTMLTextTextStyle.h:74
RVNGHTMLTextParagraphStyleManager()
constructor
Definition: RVNGHTMLTextTextStyle.h:40
void parseTextPosition(char const *value, std::ostream &out) const
add data corresponding to a text position in out
Definition: RVNGHTMLTextTextStyle.cpp:430
void send(std::ostream &out)
send the data to the stream
Definition: RVNGHTMLTextTextStyle.cpp:335
void defineSpan(RVNGPropertyList const &pList)
define a span style
Definition: RVNGHTMLTextTextStyle.cpp:322
virtual ~RVNGHTMLTextParagraphStyleManager()
destructor
Definition: RVNGHTMLTextTextStyle.h:44
void send(std::ostream &out)
send the data to the stream
Definition: RVNGHTMLTextTextStyle.cpp:204
void closeLevel() const
open a new level
Definition: RVNGHTMLTextTextStyle.h:89
void parseBorders(RVNGPropertyList const &pList, std::ostream &out) const
add data corresponding to the border
Definition: RVNGHTMLTextTextStyle.cpp:282
RVNGHTMLTextParagraphStyleManager operator=(RVNGHTMLTextParagraphStyleManager const &orig)
RVNGHTMLTextSpanStyleManager operator=(RVNGHTMLTextSpanStyleManager const &orig)
void closeLevel()
close a level
Definition: RVNGHTMLTextTextStyle.cpp:155
void setLevel(int lvl, RVNGPropertyList const &property, bool ordered)
set the property correspond to a level
Definition: RVNGHTMLTextTextStyle.cpp:40
Small class to manage the paragraph style.
Definition: RVNGHTMLTextTextStyle.h:36
std::string getClass(RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition: RVNGHTMLTextTextStyle.cpp:303
std::map< int, List > m_idListMap
a map listId -> list
Definition: RVNGHTMLTextTextStyle.h:128
std::map< int, std::string > m_idNameMap
a map id -> name
Definition: RVNGHTMLTextTextStyle.h:59
~List()
destructor
Definition: RVNGHTMLTextTextStyle.h:78
void parseDecorations(RVNGPropertyList const &pList, std::ostream &out) const
add data corresponding to the line decoration
Definition: RVNGHTMLTextTextStyle.cpp:415
Definition: RVNGPropertyList.h:38
int m_level
the actual list level
Definition: RVNGHTMLTextTextStyle.h:102
std::map< std::string, std::string > m_levelNameMap
a map content -> list level name
Definition: RVNGHTMLTextTextStyle.h:126
RVNGHTMLTextListStyleManager()
constructor
Definition: RVNGHTMLTextTextStyle.h:105

Generated for librevenge by doxygen 1.8.7