]> git.lyx.org Git - features.git/blob - src/Floating.h
Let floats decide for themselves what command is used to create a list
[features.git] / src / Floating.h
1 // -*- C++ -*-
2 /**
3  * \file Floating.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef FLOATING_H
13 #define FLOATING_H
14
15 #include "support/strfwd.h"
16
17 #include <string>
18
19
20 namespace lyx {
21         
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.
27  */
28 class Floating {
29 public:
30         ///
31         Floating();
32         ///
33         Floating(std::string const & type, std::string const & placement,
34                  std::string const & ext, std::string const & within,
35                  std::string const & style, std::string const & name,
36                  std::string const & listName, std::string const & htmlType,
37                  std::string const & htmlClass, std::string const & htmlStyle,
38                  bool builtin = false);
39         ///
40         std::string const & floattype() const { return floattype_; }
41         ///
42         std::string const & placement() const { return placement_; }
43         ///
44         std::string const & ext() const {return ext_; }
45         ///
46         std::string const & within() const { return within_; }
47         ///
48         std::string const & style() const { return style_; }
49         ///
50         std::string const & name() const { return name_; }
51         /// the title of a list of this kind of float
52         std::string const & listName() const { return listname_; }
53         /// the command used to generate that list, in LaTeX
54         /// if needsFloatPkg() is true, then this is
55         ///   \listof{floattype()}
56         /// otherwise it is hardcoded, at present.
57         docstring const & listCommand(std::string const & lang) const;
58         ///
59         bool needsFloatPkg() const { return needsfloatpkg_; }
60         /// style information, for preamble
61         std::string const & htmlStyle() const { return html_style_; }
62         /// class, for css, defaults to "float-" + type()
63         std::string const & htmlAttrib() const;
64         /// tag type, defaults to "div"
65         std::string const & htmlTag() const;
66 private:
67         ///
68         std::string defaultCSSClass() const;
69         ///
70         std::string floattype_;
71         ///
72         std::string placement_;
73         ///
74         std::string ext_;
75         ///
76         std::string within_;
77         ///
78         std::string style_;
79         ///
80         std::string name_;
81         ///
82         std::string listname_;
83         ///
84         mutable docstring listcommand_;
85         ///
86         bool needsfloatpkg_;
87         /// 
88         mutable std::string html_tag_;
89         /// 
90         mutable std::string html_attrib_;
91         ///
92         mutable std::string defaultcssclass_;
93         /// 
94         std::string html_style_;
95 };
96
97
98 } // namespace lyx
99
100 #endif