]> git.lyx.org Git - lyx.git/blob - src/insets/InsetERT.h
Amend 6c3447c8: FindAdv: sometimes a space is added on some math symbols
[lyx.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         /// Do NOT force inset into LTR environment if surroundings are RTL
40         /// even though insetlayout has (and should have) forceltr true
41         bool forceLTR(OutputParams const &) const override { return false; }
42
43         std::string contextMenuName() const override
44                 { return "context-ert"; }
45 private:
46         ///
47         InsetCode lyxCode() const override { return ERT_CODE; }
48         ///
49         docstring layoutName() const override { return from_ascii("ERT"); }
50         ///
51         void write(std::ostream & os) const override;
52         ///
53         int plaintext(odocstringstream & ods, OutputParams const & op,
54                       size_t max_length = INT_MAX) const override;
55         ///
56         void docbook(XMLStream &, OutputParams const &) const override;
57         ///
58         docstring xhtml(XMLStream &, OutputParams const &) const override;
59         ///
60         void validate(LaTeXFeatures &) const override {}
61         /// should paragraph indentation be omitted in any case?
62         bool neverIndent() const override { return true; }
63         ///
64         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
65         ///
66         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
67         ///
68         Inset * clone() const override { return new InsetERT(*this); }
69         ///
70         docstring const buttonLabel(BufferView const & bv) const override;
71         ///
72         bool allowSpellCheck() const override { return false; }
73         ///
74         bool insetAllowed(InsetCode code) const override { return code == QUOTE_CODE; }
75 };
76
77
78 } // namespace lyx
79
80 #endif