Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef RVNGHTMLTEXT_TEXTSTYLE_H
00024 #define RVNGHTMLTEXT_TEXTSTYLE_H
00025
00026 #include <ostream>
00027 #include <string>
00028 #include <map>
00029 #include <vector>
00030
00031 #include <librevenge-generators/librevenge-generators.h>
00032
00033 namespace librevenge
00034 {
00036 class RVNGHTMLTextParagraphStyleManager
00037 {
00038 public:
00040 RVNGHTMLTextParagraphStyleManager() : m_contentNameMap(), m_idNameMap()
00041 {
00042 }
00044 virtual ~RVNGHTMLTextParagraphStyleManager()
00045 {
00046 }
00048 void defineParagraph(RVNGPropertyList const &pList);
00050 std::string getClass(RVNGPropertyList const &pList);
00052 void send(std::ostream &out);
00053 protected:
00055 std::string getContent(RVNGPropertyList const &pList, bool isList) const;
00057 std::map<std::string, std::string> m_contentNameMap;
00059 std::map<int, std::string> m_idNameMap;
00061 void parseBorders(RVNGPropertyList const &pList, std::ostream &out) const;
00062 private:
00063 RVNGHTMLTextParagraphStyleManager(RVNGHTMLTextParagraphStyleManager const &orig);
00064 RVNGHTMLTextParagraphStyleManager operator=(RVNGHTMLTextParagraphStyleManager const &orig);
00065 };
00066
00068 class RVNGHTMLTextListStyleManager : public RVNGHTMLTextParagraphStyleManager
00069 {
00070 public:
00071 struct List
00072 {
00074 List() : m_contentsList(), m_level(0)
00075 {
00076 }
00078 ~List()
00079 {
00080 }
00082 void setLevel(int lvl, RVNGPropertyList const &property, bool ordered);
00084 void openLevel() const
00085 {
00086 m_level++;
00087 }
00089 void closeLevel() const
00090 {
00091 if (m_level <= 0)
00092 return;
00093 m_level--;
00094 }
00095
00097 std::string str() const;
00098 protected:
00100 std::vector<std::string> m_contentsList;
00102 mutable int m_level;
00103 };
00105 RVNGHTMLTextListStyleManager() : RVNGHTMLTextParagraphStyleManager(), m_levelNameMap(),
00106 m_idListMap(), m_actualIdStack()
00107 {
00108 }
00110 ~RVNGHTMLTextListStyleManager()
00111 {
00112 }
00114 void defineLevel(RVNGPropertyList const &property, bool ordered);
00116 std::string openLevel(RVNGPropertyList const &pList, bool ordered);
00118 void closeLevel();
00120 std::string getClass(RVNGPropertyList const &pList);
00121
00123 void send(std::ostream &out);
00124 protected:
00126 std::map<std::string, std::string> m_levelNameMap;
00128 std::map<int, List> m_idListMap;
00130 std::vector<int> m_actualIdStack;
00131 private:
00132 RVNGHTMLTextListStyleManager(RVNGHTMLTextListStyleManager const &orig);
00133 RVNGHTMLTextListStyleManager operator=(RVNGHTMLTextListStyleManager const &orig);
00134 };
00135
00137 class RVNGHTMLTextSpanStyleManager
00138 {
00139 public:
00141 RVNGHTMLTextSpanStyleManager() : m_contentNameMap(), m_idNameMap()
00142 {
00143 }
00145 ~RVNGHTMLTextSpanStyleManager()
00146 {
00147 }
00149 void defineSpan(RVNGPropertyList const &pList);
00151 std::string getClass(RVNGPropertyList const &pList);
00153 void send(std::ostream &out);
00154 protected:
00156 std::string getContent(RVNGPropertyList const &pList) const;
00158 void parseTextPosition(char const *value, std::ostream &out) const;
00160 void parseDecorations(RVNGPropertyList const &pList, std::ostream &out) const;
00162 std::map<std::string, std::string> m_contentNameMap;
00164 std::map<int, std::string> m_idNameMap;
00165
00166 private:
00167 RVNGHTMLTextSpanStyleManager(RVNGHTMLTextSpanStyleManager const &orig);
00168 RVNGHTMLTextSpanStyleManager operator=(RVNGHTMLTextSpanStyleManager const &orig);
00169 };
00170 }
00171
00172 #endif
00173