]> git.lyx.org Git - lyx.git/blob - src/insets/InsetERT.h
Fix GRAPHICS_EDIT of InsetGraphics
[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 "InsetCollapsable.h"
17 #include "MailInset.h"
18
19
20 namespace lyx {
21
22 /** A collapsable text inset for LaTeX insertions.
23
24   To write full ert (including styles and other insets) in a given
25   space.
26
27   Note that collapsed_ encompasses both the inline and collapsed button
28   versions of this inset.
29 */
30
31 class Language;
32
33 class InsetERT : public InsetCollapsable {
34 public:
35         ///
36         InsetERT(Buffer const &, CollapseStatus status = Open);
37         ///
38         ~InsetERT();
39 private:
40         ///
41         InsetCode lyxCode() const { return ERT_CODE; }
42         ///
43         docstring name() const { return from_ascii("ERT"); }
44         ///
45         void write(std::ostream & os) const;
46         ///
47         docstring editMessage() const;
48         ///
49         bool insetAllowed(InsetCode code) const;
50         ///
51         int latex(odocstream &, OutputParams const &) const;
52         ///
53         int plaintext(odocstream &, OutputParams const &) const;
54         ///
55         int docbook(odocstream &, OutputParams const &) const;
56         ///
57         void validate(LaTeXFeatures &) const {}
58         ///
59         void draw(PainterInfo & pi, int x, int y) const;
60         ///
61         bool showInsetDialog(BufferView *) const;
62         ///
63         virtual bool forceEmptyLayout(idx_type = 0) const { return true; }
64         ///
65         virtual bool allowParagraphCustomization(idx_type = 0) const { return false; }
66         /// should paragraph indendation be omitted in any case?
67         bool neverIndent() const { return true; }
68         ///
69         void doDispatch(Cursor & cur, FuncRequest & cmd);
70         ///
71         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
72         ///
73         Inset * clone() const { return new InsetERT(*this); }
74         ///
75         void setButtonLabel();
76         ///
77         bool allowSpellCheck() const { return false; }
78 };
79
80
81 class InsetERTMailer : public MailInset {
82 public:
83         ///
84         InsetERTMailer(InsetERT & inset);
85         ///
86         virtual Inset & inset() const { return inset_; }
87         ///
88         virtual std::string const & name() const { return name_; }
89         ///
90         virtual std::string const inset2string(Buffer const &) const;
91         ///
92         static void string2params(std::string const &,
93                 InsetCollapsable::CollapseStatus &);
94         ///
95         static std::string const params2string(InsetCollapsable::CollapseStatus);
96 private:
97         ///
98         static std::string const name_;
99         ///
100         InsetERT & inset_;
101 };
102
103
104 } // namespace lyx
105
106 #endif