]> git.lyx.org Git - lyx.git/blob - src/insets/InsetERT.h
requires is a keyword in C++2a
[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 Language;
30
31 class InsetERT : public InsetCollapsible {
32 public:
33         ///
34         InsetERT(Buffer *, CollapseStatus status = Open);
35         ///
36         InsetERT(InsetERT const & old);
37         ///
38         static CollapseStatus string2params(std::string const &);
39         ///
40         static std::string params2string(CollapseStatus);
41
42         std::string contextMenuName() const
43                 { return "context-ert"; }
44 private:
45         ///
46         InsetCode lyxCode() const { return ERT_CODE; }
47         ///
48         docstring layoutName() const { return from_ascii("ERT"); }
49         ///
50         void write(std::ostream & os) const;
51         ///
52         int plaintext(odocstringstream & ods, OutputParams const & op,
53                       size_t max_length = INT_MAX) const;
54         ///
55         int docbook(odocstream &, OutputParams const &) const;
56         ///
57         docstring xhtml(XHTMLStream &, OutputParams const &) const;
58         ///
59         void validate(LaTeXFeatures &) const {}
60         /// should paragraph indendation be omitted in any case?
61         bool neverIndent() const { return true; }
62         ///
63         void doDispatch(Cursor & cur, FuncRequest & cmd);
64         ///
65         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
66         ///
67         Inset * clone() const { return new InsetERT(*this); }
68         ///
69         docstring const buttonLabel(BufferView const & bv) const;
70         ///
71         bool allowSpellCheck() const { return false; }
72         ///
73         bool insetAllowed(InsetCode code) const { return code == QUOTE_CODE; }
74 };
75
76
77 } // namespace lyx
78
79 #endif