2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1998 The LyX Team.
9 *======================================================
11 // The pristine updatable inset: Text
21 #include "insetcollapsable.h"
23 /** A collapsable text inset for LaTeX insertions.
25 To write full ert (including styles and other insets) in a given
28 class InsetERT : public InsetCollapsable {
33 InsetERT(InsetERT const &, bool same_id = false);
35 Inset * clone(Buffer const &, bool same_id = false) const;
37 InsetERT(string const & contents, bool collapsed);
39 Inset::Code lyxCode() const { return Inset::ERT_CODE; }
41 void read(Buffer const * buf, LyXLex & lex);
43 void write(Buffer const * buf, std::ostream & os) const;
45 string const editMessage() const;
47 bool insertInset(BufferView *, Inset *);
49 bool insetAllowed(Inset::Code) const { return false; }
51 void setFont(BufferView *, LyXFont const &,
52 bool toggleall = false, bool selectall = false);
54 void edit(BufferView *, int, int, unsigned int);
56 void edit(BufferView * bv, bool front = true);
58 void insetButtonRelease(BufferView * bv, int x, int y, int button);
60 int latex(Buffer const *, std::ostream &, bool fragile,
63 int ascii(Buffer const *,
64 std::ostream &, int linelen = 0) const;
66 int linuxdoc(Buffer const *, std::ostream &) const;
68 int docBook(Buffer const *, std::ostream &) const;
70 UpdatableInset::RESULT localDispatch(BufferView *, kb_action,
73 bool checkInsertChar(LyXFont &);
75 // this are needed here because of the label/inlined functionallity
77 bool needFullRow() const { return !collapsed_ && !inlined(); }
79 bool isOpen() const { return !collapsed_ || inlined(); }
81 bool inlined() const { return !inset.getAutoBreakRows(); }
83 void inlined(BufferView *, bool flag);
85 void draw(BufferView *, const LyXFont &, int , float &, bool) const;
91 string const get_new_label() const;
93 void setButtonLabel();
95 void set_latex_font(BufferView *);