]> git.lyx.org Git - features.git/blob - src/insets/InsetERT.h
Regenerate previews after zoom (#11919)
[features.git] / src / insets / InsetERT.h
1 // -*- C++ -*-
2 /**
3  * \file InsetERT.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 INSETERT_H
14 #define INSETERT_H
15
16 #include "InsetCollapsible.h"
17
18 namespace lyx {
19
20 /** A collapsible text inset for LaTeX insertions.
21
22   To write full ert (including styles and other insets) in a given
23   space.
24
25   Note that collapsed_ encompasses both the inline and collapsed button
26   versions of this inset.
27 */
28
29 class InsetERT : public InsetCollapsible {
30 public:
31         ///
32         InsetERT(Buffer *, CollapseStatus status = Open);
33         ///
34         InsetERT(InsetERT const & old);
35         ///
36         static CollapseStatus string2params(std::string const &);
37         ///
38         static std::string params2string(CollapseStatus);
39
40         std::string contextMenuName() const override
41                 { return "context-ert"; }
42 private:
43         ///
44         InsetCode lyxCode() const override { return ERT_CODE; }
45         ///
46         docstring layoutName() const override { return from_ascii("ERT"); }
47         ///
48         void write(std::ostream & os) const override;
49         ///
50         int plaintext(odocstringstream & ods, OutputParams const & op,
51                       size_t max_length = INT_MAX) const override;
52         ///
53         void docbook(XMLStream &, OutputParams const &) const override;
54         ///
55         docstring xhtml(XMLStream &, OutputParams const &) const override;
56         ///
57         void validate(LaTeXFeatures &) const override {}
58         /// should paragraph indentation be omitted in any case?
59         bool neverIndent() const override { return true; }
60         ///
61         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
62         ///
63         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
64         ///
65         Inset * clone() const override { return new InsetERT(*this); }
66         ///
67         docstring const buttonLabel(BufferView const & bv) const override;
68         ///
69         bool allowSpellCheck() const override { return false; }
70         ///
71         bool insetAllowed(InsetCode code) const override { return code == QUOTE_CODE; }
72 };
73
74
75 } // namespace lyx
76
77 #endif