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/lstrings.h"
29 Floating::Floating(string const & type, string const & placement,
30 string const & ext, string const & within,
31 string const & style, string const & name,
32 string const & listName, string const & htmlTag,
33 string const & htmlAttrib, string const & htmlStyle,
35 : floattype_(type), placement_(placement), ext_(ext), within_(within),
36 style_(style), name_(name), listname_(listName), needsfloatpkg_(needsfloat),
37 html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)
41 string const & Floating::htmlAttrib() const
43 if (html_attrib_.empty())
44 html_attrib_ = "class='float " + defaultCSSClass() + "'";
49 string const & Floating::htmlTag() const
51 if (html_tag_.empty())
57 string Floating::defaultCSSClass() const
59 if (!defaultcssclass_.empty())
60 return defaultcssclass_;
62 string n = floattype_;
63 string::const_iterator it = n.begin();
64 string::const_iterator en = n.end();
65 for (; it != en; ++it) {
68 else if (islower(*it))
71 d += support::lowercase(*it);
73 // are there other characters we need to remove?
74 defaultcssclass_ = "float-" + d;
75 return defaultcssclass_;