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 &) const
51 InsetERT * result = new InsetERT;
52 result->inset.init(&inset);
54 result->collapsed = collapsed;
59 string const InsetERT::editMessage() const
61 return _("Opened ERT Inset");
65 bool InsetERT::insertInset(BufferView *, Inset *)
71 void InsetERT::setFont(BufferView *, LyXFont const &, bool, bool selectall)
73 // if selectall is activated then the fontchange was an outside general
74 // fontchange and this messages is not needed
76 WriteAlert(_("Impossible Operation!"),
77 _("Not permitted to change font-types inside ERT-insets!"),
82 void InsetERT::edit(BufferView * bv, int x, int y, unsigned int button)
84 InsetCollapsable::edit(bv, x, y, button);
86 LyXFont font(LyXFont::ALL_SANE);
87 font.setLatex (LyXFont::ON);
92 int InsetERT::latex(Buffer const *, std::ostream & os, bool /*fragile*/,
93 bool /*free_spc*/) const
95 Paragraph::size_type siz = inset.par->size();
96 for (Paragraph::size_type i = 0; i != siz; ++i) {
97 os << inset.par->getChar(i);
103 int InsetERT::ascii(Buffer const *,
104 std::ostream &, int /*linelen*/) const
110 int InsetERT::linuxdoc(Buffer const *, std::ostream &) const
116 int InsetERT::docBook(Buffer const *, std::ostream &) const