3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "insetbase.h"
15 #include "dispatchresult.h"
20 DispatchResult InsetBase::dispatch(LCursor & cur, FuncRequest const & cmd)
22 return priv_dispatch(cur, cmd);
26 DispatchResult InsetBase::priv_dispatch(LCursor &, FuncRequest const &)
28 return DispatchResult(false);
32 void InsetBase::edit(LCursor &, bool)
34 lyxerr << "InsetBase: edit left/right" << std::endl;
38 void InsetBase::edit(LCursor & cur, int, int)
40 lyxerr << "InsetBase: edit xy" << std::endl;
45 InsetBase::idx_type InsetBase::index(row_type row, col_type col) const
48 lyxerr << "illegal row: " << row << std::endl;
50 lyxerr << "illegal col: " << col << std::endl;
55 bool InsetBase::idxBetween(idx_type idx, idx_type from, idx_type to) const
57 return from <= idx && idx <= to;
61 bool InsetBase::idxUpDown(LCursor &, bool) const
67 bool InsetBase::idxUpDown2(LCursor &, bool) const
73 void InsetBase::getScreenPos(idx_type, pos_type, int & x, int & y) const
75 lyxerr << "InsetBase::getScreenPos() called directly!" << std::endl;
80 int InsetBase::plaintext(Buffer const &,
81 std::ostream &, OutputParams const &) const
87 int InsetBase::linuxdoc(Buffer const &,
88 std::ostream &, OutputParams const &) const
94 int InsetBase::docbook(Buffer const &,
95 std::ostream &, OutputParams const &) const
101 bool InsetBase::directWrite() const
107 InsetBase::EDITABLE InsetBase::editable() const
113 bool InsetBase::autoDelete() const
119 std::string const InsetBase::editMessage() const
121 return _("Opened inset");
125 bool InsetBase::insetAllowed(InsetBase * inset) const
127 return insetAllowed(inset->lyxCode());
131 std::string const & InsetBase::getInsetName() const
133 static std::string const name = "unknown";
138 int InsetBase::getCell(int x, int y) const
140 for (int i = 0, n = numParagraphs(); i < n; ++i) {
141 LyXText * text = getText(i);
142 //lyxerr << "### text: " << text << " i: " << i
143 // << " xo: " << text->xo_ << "..." << text->xo_ + text->width
144 // << " yo: " << text->yo_
145 // << " yo: " << text->yo_ - text->ascent() << "..."
146 // << text->yo_ + text->descent()
149 && x <= text->xo_ + text->width
151 && y <= text->yo_ + text->height)
153 lyxerr << "### found text # " << i << std::endl;
161 void InsetBase::markErased()
164 /////////////////////////////////////////
166 bool isEditableInset(InsetBase const * i)
168 return i && i->editable();
172 bool isHighlyEditableInset(InsetBase const * i)
174 return i && i->editable() == InsetBase::HIGHLY_EDITABLE;