]> git.lyx.org Git - lyx.git/blob - src/insets/insetfloat.h
Rename ascii to plaintext and LatexRunParams to OutputParams.
[lyx.git] / src / insets / insetfloat.h
1 // -*- C++ -*-
2 /**
3  * \file insetfloat.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Vigna
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSETFLOAT_H
14 #define INSETFLOAT_H
15
16 #include "insetcollapsable.h"
17 #include "toc.h"
18
19
20 struct InsetFloatParams {
21         ///
22         InsetFloatParams() : wide(false) {}
23         ///
24         void write(std::ostream & os) const;
25         ///
26         void read(LyXLex & lex);
27         ///
28         std::string type;
29         ///
30         std::string placement;
31         ///
32         bool wide;
33 };
34
35
36 /** The float inset
37
38 */
39 class InsetFloat : public InsetCollapsable {
40 public:
41         ///
42         InsetFloat(BufferParams const &, std::string const &);
43         ///
44         InsetFloat(InsetFloat const &);
45         ///
46         ~InsetFloat();
47         ///
48         void write(Buffer const & buf, std::ostream & os) const;
49         ///
50         void read(Buffer const & buf, LyXLex & lex);
51         ///
52         void validate(LaTeXFeatures & features) const;
53         ///
54         virtual std::auto_ptr<InsetBase> clone() const;
55         ///
56         InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
57         ///
58         int latex(Buffer const &, std::ostream &,
59                   OutputParams const &) const;
60         ///
61         int linuxdoc(Buffer const &, std::ostream &,
62                      OutputParams const &) const;
63         ///
64         int docbook(Buffer const &, std::ostream &,
65                     OutputParams const &) const;
66         ///
67         std::string const editMessage() const;
68         ///
69         bool insetAllowed(InsetOld::Code) const;
70         /** returns true if, when outputing LaTeX, font changes should
71             be closed before generating this inset. This is needed for
72             insets that may contain several paragraphs */
73         bool noFontChange() const { return true; }
74         ///
75         void wide(bool w, BufferParams const &);
76         ///
77         void addToToc(lyx::toc::TocList &, Buffer const &) const;
78         ///
79         bool  showInsetDialog(BufferView *) const;
80         ///
81         InsetFloatParams const & params() const { return params_; }
82 protected:
83         virtual
84         DispatchResult
85         priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
86 private:
87         ///
88         InsetFloatParams params_;
89 };
90
91
92 #include "mailinset.h"
93
94
95 class InsetFloatMailer : public MailInset {
96 public:
97         ///
98         InsetFloatMailer(InsetFloat & inset);
99         ///
100         virtual InsetBase & inset() const { return inset_; }
101         ///
102         virtual std::string const & name() const { return name_; }
103         ///
104         virtual std::string const inset2string(Buffer const &) const;
105         ///
106         static void string2params(std::string const &, InsetFloatParams &);
107         ///
108         static std::string const params2string(InsetFloatParams const &);
109 private:
110         ///
111         static std::string const name_;
112         ///
113         InsetFloat & inset_;
114 };
115
116 #endif