]> git.lyx.org Git - lyx.git/blob - src/Floating.h
Enable OK/Apply buttons when resetting to class defaults.
[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() : usesfloatpkg_(false), ispredefined_(false),
30             allowswide_(true), allowssideways_(true) {}
31         ///
32         Floating(std::string const & type, std::string const & placement,
33                  std::string const & ext, std::string const & within,
34                  std::string const & style, std::string const & name,
35                  std::string const & listName, std::string const & listCmd,
36                  std::string const & refPrefix, std::string const & allowedplacement,
37                  std::string const & htmlType, std::string const & htmlClass,
38                  std::string const & htmlStyle, bool usesfloat, bool isprefined,
39                  bool allowswide, bool allowssideways);
40         ///
41         std::string const & floattype() const { return floattype_; }
42         ///
43         std::string const & placement() const { return placement_; }
44         ///
45         std::string const & ext() const {return ext_; }
46         ///
47         std::string const & within() const { return within_; }
48         ///
49         std::string const & style() const { return style_; }
50         ///
51         std::string const & name() const { return name_; }
52         /// the title of a list of this kind of float
53         std::string const & listName() const { return listname_; }
54         /// the command used to generate that list. this has to be given
55         /// if usesFloatPkg() is false, unless this float uses the same
56         /// auxfile as another defined previously. this should not contain
57         /// the leading "\".
58         std::string const & listCommand() const { return listcommand_; }
59         /// prefix to use for formatted references to such floats
60         std::string const & refPrefix() const { return refprefix_; }
61         /// allowed placement options
62         std::string const & allowedPlacement() const { return allowedplacement_; }
63         ///
64         bool usesFloatPkg() const { return usesfloatpkg_; }
65         ///
66         bool isPredefined() const { return ispredefined_; }
67         ///
68         bool allowsWide() const { return allowswide_; }
69         ///
70         bool allowsSideways() const { return allowssideways_; }
71         /// style information, for preamble
72         std::string const & htmlStyle() const { return html_style_; }
73         /// class, for css, defaults to "float-" + type()
74         std::string const & htmlAttrib() const;
75         /// tag type, defaults to "div"
76         std::string const & htmlTag() const;
77 private:
78         ///
79         std::string defaultCSSClass() const;
80         ///
81         std::string floattype_;
82         ///
83         std::string placement_;
84         ///
85         std::string ext_;
86         ///
87         std::string within_;
88         ///
89         std::string style_;
90         ///
91         std::string name_;
92         ///
93         std::string listname_;
94         ///
95         std::string listcommand_;
96         ///
97         std::string refprefix_;
98         ///
99         std::string allowedplacement_;
100         ///
101         bool usesfloatpkg_;
102         ///
103         bool ispredefined_;
104         ///
105         bool  allowswide_;
106         ///
107         bool  allowssideways_;
108         /// 
109         mutable std::string html_tag_;
110         /// 
111         mutable std::string html_attrib_;
112         ///
113         mutable std::string defaultcssclass_;
114         /// 
115         std::string html_style_;
116 };
117
118
119 } // namespace lyx
120
121 #endif