]> git.lyx.org Git - lyx.git/blob - src/Floating.h
Micro-optimization.
[lyx.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 <string>
16
17
18 namespace lyx {
19         
20 /** This is a "float layout" object. It contains the parameters for how to
21  *  handle the different kinds of floats, default ones and user created ones.
22  *  Objects of this class is stored in a container in FloatList. The different
23  *  InsetFloat(s) have a pointer/reference through the name of the Floating
24  *  so that it knows how the different floats should be handled.
25  */
26 class Floating {
27 public:
28         ///
29         Floating();
30         ///
31         Floating(std::string const & type, std::string const & placement,
32                  std::string const & ext, std::string const & within,
33                  std::string const & style, std::string const & name,
34                  std::string const & listName, std::string const & listCmd,
35                  std::string const & htmlType, std::string const & htmlClass, 
36                  std::string const & htmlStyle, bool builtin = false);
37         ///
38         std::string const & floattype() const { return floattype_; }
39         ///
40         std::string const & placement() const { return placement_; }
41         ///
42         std::string const & ext() const {return ext_; }
43         ///
44         std::string const & within() const { return within_; }
45         ///
46         std::string const & style() const { return style_; }
47         ///
48         std::string const & name() const { return name_; }
49         /// the title of a list of this kind of float
50         std::string const & listName() const { return listname_; }
51         /// the command used to generate that list. this has to be given
52         /// if needsFloatPkg() is false. note that this should not contain
53         /// the leading "\".
54         std::string const & listCommand() const { return listcommand_; }
55         ///
56         bool needsFloatPkg() const { return needsfloatpkg_; }
57         /// style information, for preamble
58         std::string const & htmlStyle() const { return html_style_; }
59         /// class, for css, defaults to "float-" + type()
60         std::string const & htmlAttrib() const;
61         /// tag type, defaults to "div"
62         std::string const & htmlTag() const;
63 private:
64         ///
65         std::string defaultCSSClass() const;
66         ///
67         std::string floattype_;
68         ///
69         std::string placement_;
70         ///
71         std::string ext_;
72         ///
73         std::string within_;
74         ///
75         std::string style_;
76         ///
77         std::string name_;
78         ///
79         std::string listname_;
80         ///
81         std::string listcommand_;
82         ///
83         bool needsfloatpkg_;
84         /// 
85         mutable std::string html_tag_;
86         /// 
87         mutable std::string html_attrib_;
88         ///
89         mutable std::string defaultcssclass_;
90         /// 
91         std::string html_style_;
92 };
93
94
95 } // namespace lyx
96
97 #endif