4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
15 #include "InsetCommand.h"
21 /// The reference inset
22 class InsetRef : public InsetCommand {
26 std::string latex_name;
30 std::string short_gui_name;
32 static type_info types[];
34 static int getType(std::string const & name);
36 static std::string const & getName(int type);
39 InsetRef(Buffer const & buffer, InsetCommandParams const &);
41 /// verify label and reference.
43 * Overloaded from Inset::initView.
47 docstring screenLabel() const;
49 EDITABLE editable() const { return IS_EDITABLE; }
51 InsetCode lyxCode() const { return REF_CODE; }
53 DisplayType display() const { return Inline; }
55 int latex(odocstream &, OutputParams const &) const;
57 int plaintext(odocstream &, OutputParams const &) const;
59 int docbook(odocstream &, OutputParams const &) const;
60 /// the string that is passed to the TOC
61 void textString(odocstream &) const;
63 void validate(LaTeXFeatures & features) const;
65 static ParamInfo const & findInfo(std::string const &);
67 static std::string defaultCommand() { return "ref"; };
69 static bool isCompatibleCommand(std::string const & s);
71 void updateLabels(ParIterator const & it);
73 void addToToc(ParConstIterator const &) const;
76 InsetRef(InsetRef const &);
78 void doDispatch(Cursor & cur, FuncRequest & cmd);
81 Inset * clone() const { return new InsetRef(*this); }
85 mutable docstring screen_label_;