#include "DispatchResult.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
+#include "InsetLayout.h"
#include "MetricsInfo.h"
#include "output_xhtml.h"
+#include "xml.h"
#include "Text.h"
#include "TextClass.h"
#include "TocBackend.h"
}
+InsetLayout const & Inset::getLayout() const
+{
+ if (!buffer_)
+ return DocumentClass::plainInsetLayout();
+ return buffer().params().documentClass().insetLayout(layoutName());
+}
+
+
+bool Inset::isPassThru() const
+{
+ return getLayout().isPassThru();
+}
+
+
bool Inset::isFreeSpacing() const
{
return getLayout().isFreeSpacing();
}
+FontInfo Inset::getFont() const
+{
+ return getLayout().font();
+}
+
+
+FontInfo Inset::getLabelfont() const
+{
+ return getLayout().labelfont();
+}
+
+
docstring Inset::toolTip(BufferView const &, int, int) const
{
return docstring();
void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
{
- if (buffer_ == 0) {
+ if (buffer_ == nullptr) {
lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
lyxerr << "LyX Code: " << lyxCode() << " name: "
<< insetName(lyxCode()) << std::endl;
bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
- FuncStatus & flag) const
+ FuncStatus & status) const
{
// LFUN_INSET_APPLY is sent from the dialogs when the data should
// be applied. This is either changed to LFUN_INSET_MODIFY (if the
// Allow modification of our data.
// This needs to be handled in the doDispatch method of our
// instantiatable children.
- flag.setEnabled(true);
+ status.setEnabled(true);
return true;
case LFUN_INSET_INSERT:
// Don't allow insertion of new insets.
// Every inset that wants to allow new insets from open
// dialogs needs to override this.
- flag.setEnabled(false);
+ status.setEnabled(false);
return true;
case LFUN_INSET_SETTINGS:
if (cmd.argument().empty() || cmd.getArg(0) == insetName(lyxCode())) {
bool const enable = hasSettings();
- flag.setEnabled(enable);
+ status.setEnabled(enable);
return true;
} else {
return false;
case LFUN_IN_MATHMACROTEMPLATE:
// By default we're not in a InsetMathMacroTemplate inset
- flag.setEnabled(false);
+ status.setEnabled(false);
return true;
case LFUN_IN_IPA:
// By default we're not in an IPA inset
- flag.setEnabled(false);
+ status.setEnabled(false);
return true;
default:
}
-Inset::idx_type Inset::index(row_type row, col_type col) const
+idx_type Inset::index(row_type row, col_type col) const
{
if (row != 0)
LYXERR0("illegal row: " << row);
}
-int Inset::docbook(odocstream &, OutputParams const &) const
+void Inset::docbook(XMLStream & xs, OutputParams const &) const
{
- return 0;
+ xs << "[[Inset: " << from_ascii(insetName(lyxCode())) << "]]";
}
-docstring Inset::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring Inset::xhtml(XMLStream & xs, OutputParams const &) const
{
xs << "[[Inset: " << from_ascii(insetName(lyxCode())) << "]]";
return docstring();
}
-InsetLayout const & Inset::getLayout() const
+bool Inset::undefined() const
{
- if (!buffer_)
- return DocumentClass::plainInsetLayout();
- return buffer().params().documentClass().insetLayout(layoutName());
+ docstring const & n = getLayout().name();
+ return n.empty() || n == DocumentClass::plainInsetLayout().name();
}
-bool Inset::undefined() const
+CtObject Inset::getCtObject(OutputParams const &) const
{
- docstring const & n = getLayout().name();
- return n.empty() || n == DocumentClass::plainInsetLayout().name();
+ return CtObject::Normal;
}
// are in the CutAndPaste stack. See InsetGraphics, RenderGraphics and
// RenderPreview.
if (!buffer_)
- return 0;
- return theApp() ? theApp()->updateInset(this) : 0;
+ return nullptr;
+ return theApp() ? theApp()->updateInset(this) : nullptr;
}