X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetNomencl.cpp;h=ac61c7a0c5e9ae5cc1893e687013eadb22502921;hb=2c357c1d23b7b83839a9beb8225d4f1ae4f793b4;hp=850a670cc452d2f66d02366023af2ed1ce64e53a;hpb=897436efbb9bd641b61467d185a2dfae9839e575;p=lyx.git diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index 850a670cc4..ac61c7a0c5 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -16,16 +16,17 @@ #include "Buffer.h" #include "DispatchResult.h" #include "FuncRequest.h" -#include "gettext.h" +#include "support/gettext.h" #include "InsetIterator.h" #include "LaTeXFeatures.h" #include "MetricsInfo.h" #include "sgml.h" +#include "support/docstream.h" -namespace lyx { +using namespace std; -using std::string; +namespace lyx { InsetNomencl::InsetNomencl(InsetCommandParams const & p) @@ -34,6 +35,15 @@ InsetNomencl::InsetNomencl(InsetCommandParams const & p) {} +CommandInfo const * InsetNomencl::findInfo(string const & /* cmdName */) +{ + static const char * const paramnames[] = {"prefix", "symbol", "description", ""}; + static const bool isoptional[] = {true, false, false}; + static const CommandInfo info = {3, paramnames, isoptional}; + return &info; +} + + docstring const InsetNomencl::getScreenLabel(Buffer const &) const { return _("Nom"); @@ -70,17 +80,20 @@ void InsetNomencl::validate(LaTeXFeatures & features) const } -Inset::Code InsetNomencl::lyxCode() const -{ - return Inset::NOMENCL_CODE; -} - - InsetPrintNomencl::InsetPrintNomencl(InsetCommandParams const & p) : InsetCommand(p, string()) {} +CommandInfo const * InsetPrintNomencl::findInfo(string const & /* cmdName */) +{ + static const char * const paramnames[] = {"labelwidth", ""}; + static const bool isoptional[] = {true}; + static const CommandInfo info = {1, paramnames, isoptional}; + return &info; +} + + docstring const InsetPrintNomencl::getScreenLabel(Buffer const &) const { return _("Nomenclature"); @@ -93,10 +106,10 @@ int InsetPrintNomencl::docbook(Buffer const & buf, odocstream & os, os << "\n"; int newlines = 2; for (InsetIterator it = inset_iterator_begin(buf.inset()); it;) { - if (it->lyxCode() == Inset::NOMENCL_CODE) { + if (it->lyxCode() == NOMENCL_CODE) { newlines += static_cast(*it).docbookGlossary(os); ++it; - } else if(it->lyxCode() == Inset::NOTE_CODE && + } else if(it->lyxCode() == NOTE_CODE && static_cast(*it).params().type == InsetNoteParams::Note) { // Don't output anything nested in note insets size_t const depth = it.depth(); @@ -118,9 +131,9 @@ void InsetPrintNomencl::validate(LaTeXFeatures & features) const } -Inset::Code InsetPrintNomencl::lyxCode() const +InsetCode InsetPrintNomencl::lyxCode() const { - return Inset::NOMENCL_PRINT_CODE; + return NOMENCL_PRINT_CODE; }