3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
17 #include "support/debug.h"
18 #include "support/lstrings.h"
30 Floating::Floating(string const & type, string const & placement,
31 string const & ext, string const & within,
32 string const & style, string const & name,
33 string const & listName, std::string const & listCmd,
34 string const & htmlTag, string const & htmlAttrib,
35 string const & htmlStyle, bool needsfloat)
36 : floattype_(type), placement_(placement), ext_(ext), within_(within),
37 style_(style), name_(name), listname_(listName), listcommand_(listCmd),
38 needsfloatpkg_(needsfloat), html_tag_(htmlTag), html_attrib_(htmlAttrib),
39 html_style_(htmlStyle)
43 string const & Floating::htmlAttrib() const
45 if (html_attrib_.empty())
46 html_attrib_ = "class='float " + defaultCSSClass() + "'";
51 string const & Floating::htmlTag() const
53 if (html_tag_.empty())
59 string Floating::defaultCSSClass() const
61 if (!defaultcssclass_.empty())
62 return defaultcssclass_;
64 string n = floattype_;
65 string::const_iterator it = n.begin();
66 string::const_iterator en = n.end();
67 for (; it != en; ++it) {
70 else if (islower(*it))
73 d += support::lowercase(*it);
75 // are there other characters we need to remove?
76 defaultcssclass_ = "float-" + d;
77 return defaultcssclass_;