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"
24 // Initialization of the counter for the inset id's,
25 unsigned int InsetOld::inset_id = 0;
29 top_x(0), top_baseline(0), scx(0),
30 id_(inset_id++), owner_(0),
31 background_color_(LColor::inherit)
35 InsetOld::InsetOld(InsetOld const & in)
37 top_x(0), top_baseline(0), scx(0),
38 id_(in.id_), owner_(0),
39 name_(in.name_), background_color_(in.background_color_)
43 bool InsetOld::directWrite() const
49 InsetOld::EDITABLE InsetOld::editable() const
55 bool InsetOld::autoDelete() const
62 LyXFont const InsetOld::convertFont(LyXFont const & font) const
73 string const InsetOld::editMessage() const
75 return _("Opened inset");
79 LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
82 return owner()->getLyXText(bv, false);
88 void InsetOld::setBackgroundColor(EnumLColor color)
90 background_color_ = color;
94 EnumLColor InsetOld::backgroundColor() const
96 if (background_color_ == LColor::inherit) {
98 return owner()->backgroundColor();
100 return LColor::background;
102 return LColor::color(background_color_);
106 int InsetOld::id() const
111 void InsetOld::id(int id_arg)
116 void InsetOld::setFont(BufferView *, LyXFont const &, bool, bool)
120 bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
123 return owner()->forceDefaultParagraphs(inset);
127 int InsetOld::latexTextWidth(BufferView * bv) const
130 return (owner()->latexTextWidth(bv));
131 return bv->workWidth();
135 int InsetOld::ascent() const
141 int InsetOld::descent() const
147 int InsetOld::width() const
153 bool InsetOld::insetAllowed(InsetOld * in) const
155 return insetAllowed(in->lyxCode());
159 bool InsetOld::checkInsertChar(LyXFont &)
165 bool isEditableInset(InsetOld const * i)
167 return i && i->editable();
171 bool isHighlyEditableInset(InsetOld const * i)
173 return i && i->editable() == InsetOld::HIGHLY_EDITABLE;