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
33namespace librevenge
34{
37{
38public:
43
47
48 void defineParagraph(RVNGPropertyList const &pList);
50 std::string getClass(RVNGPropertyList const &pList);
52 void send(std::ostream &out);
53protected:
55 static std::string getContent(RVNGPropertyList const &pList, bool isList);
57 std::map<std::string, std::string> m_contentNameMap;
59 std::map<int, std::string> m_idNameMap;
61 static void parseBorders(RVNGPropertyList const &pList, std::ostream &out);
62private:
65};
66
69{
70public:
71 struct List
72 {
75 {
76 }
77
79 {
80 }
81
82 void setLevel(int lvl, RVNGPropertyList const &property, bool ordered);
84 void openLevel() const
85 {
86 m_level++;
87 }
88
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 };
104
109
113
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);
124protected:
126 std::map<std::string, std::string> m_levelNameMap;
128 std::map<int, List> m_idListMap;
130 std::vector<int> m_actualIdStack;
131private:
134};
135
138{
139public:
144
148
149 void defineSpan(RVNGPropertyList const &pList);
151 std::string getClass(RVNGPropertyList const &pList);
153 void send(std::ostream &out);
154protected:
156 static std::string getContent(RVNGPropertyList const &pList);
158 static void parseTextPosition(char const *value, std::ostream &out);
160 static void parseDecorations(RVNGPropertyList const &pList, std::ostream &out);
162 std::map<std::string, std::string> m_contentNameMap;
164 std::map<int, std::string> m_idNameMap;
165
166private:
169};
170}
171
172#endif
173/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
RVNGHTMLTextListStyleManager operator=(RVNGHTMLTextListStyleManager const &orig)
RVNGHTMLTextListStyleManager()
constructor
Definition RVNGHTMLTextTextStyle.h:105
void send(std::ostream &out)
send the data to the stream
Definition RVNGHTMLTextTextStyle.cpp:92
std::string openLevel(RVNGPropertyList const &pList, bool ordered)
returns the class name corresponding to a propertylist
Definition RVNGHTMLTextTextStyle.cpp:130
~RVNGHTMLTextListStyleManager()
destructor
Definition RVNGHTMLTextTextStyle.h:110
std::string getClass(RVNGPropertyList const &pList)
returns the classname corresponding to a list element
Definition RVNGHTMLTextTextStyle.cpp:103
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::map< int, List > m_idListMap
a map listId -> list
Definition RVNGHTMLTextTextStyle.h:128
RVNGHTMLTextListStyleManager(RVNGHTMLTextListStyleManager const &orig)
std::map< std::string, std::string > m_levelNameMap
a map content -> list level name
Definition RVNGHTMLTextTextStyle.h:126
void closeLevel()
close a level
Definition RVNGHTMLTextTextStyle.cpp:155
static void parseBorders(RVNGPropertyList const &pList, std::ostream &out)
add data corresponding to the border
Definition RVNGHTMLTextTextStyle.cpp:282
void defineParagraph(RVNGPropertyList const &pList)
define a paragraph style
Definition RVNGHTMLTextTextStyle.cpp:191
void send(std::ostream &out)
send the data to the stream
Definition RVNGHTMLTextTextStyle.cpp:204
RVNGHTMLTextParagraphStyleManager operator=(RVNGHTMLTextParagraphStyleManager const &orig)
virtual ~RVNGHTMLTextParagraphStyleManager()
destructor
Definition RVNGHTMLTextTextStyle.h:44
RVNGHTMLTextParagraphStyleManager()
constructor
Definition RVNGHTMLTextTextStyle.h:40
std::string getClass(RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition RVNGHTMLTextTextStyle.cpp:173
static std::string getContent(RVNGPropertyList const &pList, bool isList)
convert a property list in a html content string
Definition RVNGHTMLTextTextStyle.cpp:214
std::map< std::string, std::string > m_contentNameMap
a map content -> name
Definition RVNGHTMLTextTextStyle.h:57
RVNGHTMLTextParagraphStyleManager(RVNGHTMLTextParagraphStyleManager const &orig)
std::map< int, std::string > m_idNameMap
a map id -> name
Definition RVNGHTMLTextTextStyle.h:59
std::string getClass(RVNGPropertyList const &pList)
returns the class name corresponding to a propertylist
Definition RVNGHTMLTextTextStyle.cpp:303
~RVNGHTMLTextSpanStyleManager()
destructor
Definition RVNGHTMLTextTextStyle.h:145
RVNGHTMLTextSpanStyleManager(RVNGHTMLTextSpanStyleManager const &orig)
static std::string getContent(RVNGPropertyList const &pList)
convert a property list in a html content string
Definition RVNGHTMLTextTextStyle.cpp:345
void defineSpan(RVNGPropertyList const &pList)
define a span style
Definition RVNGHTMLTextTextStyle.cpp:322
std::map< std::string, std::string > m_contentNameMap
a map content -> name
Definition RVNGHTMLTextTextStyle.h:162
RVNGHTMLTextSpanStyleManager operator=(RVNGHTMLTextSpanStyleManager const &orig)
static void parseDecorations(RVNGPropertyList const &pList, std::ostream &out)
add data corresponding to the line decoration
Definition RVNGHTMLTextTextStyle.cpp:415
std::map< int, std::string > m_idNameMap
a map id -> name
Definition RVNGHTMLTextTextStyle.h:164
RVNGHTMLTextSpanStyleManager()
constructor
Definition RVNGHTMLTextTextStyle.h:141
static void parseTextPosition(char const *value, std::ostream &out)
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
Definition RVNGPropertyList.h:39
Definition RVNGBinaryData.cpp:40
int m_level
the actual list level
Definition RVNGHTMLTextTextStyle.h:102
~List()
destructor
Definition RVNGHTMLTextTextStyle.h:78
void closeLevel() const
open a new level
Definition RVNGHTMLTextTextStyle.h:89
std::vector< std::string > m_contentsList
the properties
Definition RVNGHTMLTextTextStyle.h:100
std::string str() const
return the content string
Definition RVNGHTMLTextTextStyle.cpp:82
List()
constructor
Definition RVNGHTMLTextTextStyle.h:74
void openLevel() const
open a new level
Definition RVNGHTMLTextTextStyle.h:84
void setLevel(int lvl, RVNGPropertyList const &property, bool ordered)
set the property correspond to a level
Definition RVNGHTMLTextTextStyle.cpp:40

Generated for librevenge by doxygen 1.14.0