4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
15 #include "support/strfwd.h"
22 /** This is a "float layout" object. It contains the parameters for how to
23 * handle the different kinds of floats, default ones and user created ones.
24 * Objects of this class is stored in a container in FloatList. The different
25 * InsetFloat(s) have a pointer/reference through the name of the Floating
26 * so that it knows how the different floats should be handled.
31 Floating() : usesfloatpkg_(false), ispredefined_(false),
32 allowswide_(true), allowssideways_(true) {}
34 Floating(std::string const & type, std::string const & placement,
35 std::string const & ext, std::string const & within,
36 std::string const & style, std::string const & name,
37 std::string const & listName, std::string const & listCmd,
38 std::string const & refPrefix, std::string const & allowedplacement,
39 std::string const & htmlType, std::string const & htmlClass,
40 docstring const & htmlStyle, std::string const & docbookTag,
41 std::string const & docbookAttr, std::string const & docbookTagType,
42 std::string const & required, bool usesfloat, bool isprefined,
43 bool allowswide, bool allowssideways);
45 std::string const & floattype() const { return floattype_; }
47 std::string const & placement() const { return placement_; }
49 std::string const & ext() const {return ext_; }
51 std::string const & within() const { return within_; }
53 std::string const & style() const { return style_; }
55 std::string const & name() const { return name_; }
56 /// the title of a list of this kind of float
57 std::string const & listName() const { return listname_; }
58 /// the command used to generate that list. this has to be given
59 /// if usesFloatPkg() is false, unless this float uses the same
60 /// auxfile as another defined previously. this should not contain
62 std::string const & listCommand() const { return listcommand_; }
63 /// prefix to use for formatted references to such floats
64 std::string const & refPrefix() const { return refprefix_; }
65 /// allowed placement options
66 std::string const & allowedPlacement() const { return allowedplacement_; }
68 bool usesFloatPkg() const { return usesfloatpkg_; }
69 /// allowed placement options
70 std::string const & required() const { return required_; }
72 bool isPredefined() const { return ispredefined_; }
74 bool allowsWide() const { return allowswide_; }
76 bool allowsSideways() const { return allowssideways_; }
77 /// style information, for preamble
78 docstring const & htmlStyle() const { return html_style_; }
79 /// class, for css, defaults to "float-" + type()
80 std::string const & htmlAttrib() const;
81 /// tag type, defaults to "div"
82 std::string const & htmlTag() const;
84 std::string const & docbookTag(bool hasTitle = false) const;
86 std::string const & docbookAttr() const;
88 std::string const & docbookTagType() const;
90 std::string const & docbookCaption() const;
93 std::string defaultCSSClass() const;
95 std::string floattype_;
97 std::string placement_;
107 std::string listname_;
109 std::string listcommand_;
111 std::string refprefix_;
113 std::string allowedplacement_;
115 std::string required_;
123 bool allowssideways_;
125 mutable std::string html_tag_;
127 mutable std::string html_attrib_;
129 mutable std::string defaultcssclass_;
131 docstring html_style_;
133 mutable std::string docbook_tag_;
134 /// attribute (mostly, role)
135 mutable std::string docbook_caption_;
136 /// caption tag (mostly, either caption or title)
137 std::string docbook_attr_;
138 /// DocBook tag type (block, paragraph, inline)
139 mutable std::string docbook_tag_type_;