]> git.lyx.org Git - lyx.git/blob - src/insets/insetert.h
convert graphics for .tex export, fixes bug 1231
[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
17 #include "insetcollapsable.h"
18
19 /** A collapsable text inset for LaTeX insertions.
20
21   To write full ert (including styles and other insets) in a given
22   space.
23
24   Note that collapsed_ encompasses both the inline and collapsed button
25   versions of this inset.
26 */
27
28 class Language;
29
30 class InsetERT : public InsetCollapsable {
31 public:
32         ///
33         InsetERT(BufferParams const &, CollapseStatus status = Open);
34         ///
35         InsetERT(InsetERT const &);
36         ///
37         virtual std::auto_ptr<InsetBase> clone() const;
38         ///
39         InsetERT(BufferParams const &,
40                  Language const *, std::string const & contents, CollapseStatus status);
41         ///
42         ~InsetERT();
43         ///
44         InsetOld::Code lyxCode() const { return InsetOld::ERT_CODE; }
45         ///
46         void write(Buffer const & buf, std::ostream & os) const;
47         ///
48         std::string const editMessage() const;
49         ///
50         bool insetAllowed(InsetOld::Code code) const;
51         ///
52         int latex(Buffer const &, std::ostream &,
53                   OutputParams const &) const;
54         ///
55         int plaintext(Buffer const &, std::ostream &,
56                   OutputParams const & runparams) const;
57         ///
58         int linuxdoc(Buffer const &, std::ostream &,
59                      OutputParams const &) const;
60         ///
61         int docbook(Buffer const &, std::ostream &,
62                     OutputParams const & runparams) const;
63         ///
64         void validate(LaTeXFeatures &) const {}
65         ///
66         void metrics(MetricsInfo &, Dimension &) const;
67         ///
68         void draw(PainterInfo & pi, int x, int y) const;
69         ///
70         bool showInsetDialog(BufferView *) const;
71         ///
72         void getDrawFont(LyXFont &) const;
73         ///
74         bool forceDefaultParagraphs(InsetBase const *) const { return true; }
75 protected:
76         ///
77         virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd);
78 private:
79         ///
80         void init();
81         ///
82         void setButtonLabel();
83         ///
84         bool allowSpellCheck() const { return false; }
85 };
86
87
88 #include "mailinset.h"
89
90 class InsetERTMailer : public MailInset {
91 public:
92         ///
93         InsetERTMailer(InsetERT & inset);
94         ///
95         virtual InsetBase & inset() const { return inset_; }
96         ///
97         virtual std::string const & name() const { return name_; }
98         ///
99         virtual std::string const inset2string(Buffer const &) const;
100         ///
101         static void string2params(std::string const &,
102                 InsetCollapsable::CollapseStatus &);
103         ///
104         static std::string const params2string(InsetCollapsable::CollapseStatus);
105 private:
106         ///
107         static std::string const name_;
108         ///
109         InsetERT & inset_;
110 };
111
112 #endif