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"
27 // Initialization of the counter for the inset id's,
28 unsigned int InsetOld::inset_id = 0;
32 top_x(0), top_baseline(0), scx(0),
33 id_(inset_id++), owner_(0),
34 background_color_(LColor::inherit)
38 InsetOld::InsetOld(InsetOld const & in)
40 top_x(0), top_baseline(0), scx(0),
41 id_(in.id_), owner_(0),
42 name_(in.name_), background_color_(in.background_color_)
46 bool InsetOld::directWrite() const
52 InsetOld::EDITABLE InsetOld::editable() const
58 bool InsetOld::autoDelete() const
65 LyXFont const InsetOld::convertFont(LyXFont const & font) const
76 string const InsetOld::editMessage() const
78 return _("Opened inset");
82 LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
85 return owner()->getLyXText(bv, false);
91 void InsetOld::setBackgroundColor(LColor_color color)
93 background_color_ = color;
97 LColor_color InsetOld::backgroundColor() const
99 if (background_color_ == LColor::inherit) {
101 return owner()->backgroundColor();
103 return LColor::background;
105 return LColor::color(background_color_);
109 int InsetOld::id() const
114 void InsetOld::id(int id_arg)
119 void InsetOld::setFont(BufferView *, LyXFont const &, bool, bool)
123 bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
126 return owner()->forceDefaultParagraphs(inset);
130 int InsetOld::latexTextWidth(BufferView * bv) const
133 return (owner()->latexTextWidth(bv));
134 return bv->workWidth();
138 int InsetOld::ascent() const
144 int InsetOld::descent() const
150 int InsetOld::width() const
156 bool InsetOld::insetAllowed(InsetOld * in) const
158 return insetAllowed(in->lyxCode());
162 bool InsetOld::checkInsertChar(LyXFont &)
168 bool isEditableInset(InsetOld const * i)
170 return i && i->editable();
174 bool isHighlyEditableInset(InsetOld const * i)
176 return i && i->editable() == InsetOld::HIGHLY_EDITABLE;