1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1998 The LyX Team.
8 *======================================================*/
13 #pragma implementation
20 #include "insets/insettext.h"
21 #include "support/LOstream.h"
22 #include "lyx_gui_misc.h"
26 InsetERT::InsetERT() : InsetCollapsable()
30 LyXFont font(LyXFont::ALL_SANE);
31 font.setLatex (LyXFont::ON);
33 labelfont = LyXFont(LyXFont::ALL_SANE);
36 labelfont.setColor(LColor::latex);
37 setAutoCollapse(false);
42 void InsetERT::write(Buffer const * buf, ostream & os) const
44 os << getInsetName() << "\n";
45 InsetCollapsable::write(buf, os);
49 Inset * InsetERT::clone(Buffer const &, bool same_id) const
51 InsetERT * result = new InsetERT;
52 result->inset.init(&inset, same_id);
54 result->collapsed = collapsed;
61 string const InsetERT::editMessage() const
63 return _("Opened ERT Inset");
67 bool InsetERT::insertInset(BufferView *, Inset *)
73 void InsetERT::setFont(BufferView *, LyXFont const &, bool, bool selectall)
75 // if selectall is activated then the fontchange was an outside general
76 // fontchange and this messages is not needed
78 WriteAlert(_("Impossible Operation!"),
79 _("Not permitted to change font-types inside ERT-insets!"),
84 void InsetERT::edit(BufferView * bv, int x, int y, unsigned int button)
86 InsetCollapsable::edit(bv, x, y, button);
88 LyXFont font(LyXFont::ALL_SANE);
89 font.setLatex (LyXFont::ON);
94 int InsetERT::latex(Buffer const *, std::ostream & os, bool /*fragile*/,
95 bool /*free_spc*/) const
97 Paragraph::size_type siz = inset.paragraph()->size();
98 for (Paragraph::size_type i = 0; i != siz; ++i) {
99 os << inset.paragraph()->getChar(i);
105 int InsetERT::ascii(Buffer const *,
106 std::ostream &, int /*linelen*/) const
112 int InsetERT::linuxdoc(Buffer const *, std::ostream &) const
118 int InsetERT::docBook(Buffer const *, std::ostream &) const