3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
8 * \author Lars Gullik Bjønnes
9 * \author Matthias Ettrich
11 * Full author contact details are available in file CREDITS.
17 #include "updatableinset.h"
19 #include "BufferView.h"
23 // Initialization of the counter for the inset id's,
24 unsigned int InsetOld::inset_id = 0;
28 top_x(0), top_baseline(0), scx(0),
29 id_(inset_id++), owner_(0),
30 background_color_(LColor::inherit)
34 InsetOld::InsetOld(InsetOld const & in)
36 top_x(0), top_baseline(0), scx(0),
37 id_(in.id_), owner_(0),
38 name_(in.name_), background_color_(in.background_color_)
42 bool InsetOld::directWrite() const
48 InsetOld::EDITABLE InsetOld::editable() const
54 bool InsetOld::autoDelete() const
61 LyXFont const InsetOld::convertFont(LyXFont const & font) const
72 string const InsetOld::editMessage() const
74 return _("Opened inset");
78 LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
81 return owner()->getLyXText(bv, false);
87 void InsetOld::setBackgroundColor(EnumLColor color)
89 background_color_ = color;
93 EnumLColor InsetOld::backgroundColor() const
95 if (background_color_ == LColor::inherit) {
97 return owner()->backgroundColor();
99 return LColor::background;
101 return background_color_;
105 int InsetOld::id() const
110 void InsetOld::id(int id_arg)
115 void InsetOld::setFont(BufferView *, LyXFont const &, bool, bool)
119 bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
122 return owner()->forceDefaultParagraphs(inset);
126 int InsetOld::latexTextWidth(BufferView * bv) const
129 return (owner()->latexTextWidth(bv));
130 return bv->workWidth();
134 int InsetOld::ascent() const
140 int InsetOld::descent() const
146 int InsetOld::width() const
152 bool InsetOld::insetAllowed(InsetOld * in) const
154 return insetAllowed(in->lyxCode());
158 bool InsetOld::checkInsertChar(LyXFont &)
164 bool isEditableInset(InsetOld const * i)
166 return i && i->editable();
170 bool isHighlyEditableInset(InsetOld const * i)
172 return i && i->editable() == InsetOld::HIGHLY_EDITABLE;