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