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"
20 /// The reference inset
21 class InsetRef : public InsetCommand {
25 std::string latex_name;
29 std::string short_gui_name;
31 static type_info types[];
33 static int getType(std::string const & name);
35 static std::string const & getName(int type);
38 InsetRef(Buffer * buffer, InsetCommandParams const &);
40 /// \name Public functions inherited from Inset class
43 bool isLabeled() const { return true; }
45 docstring toolTip(BufferView const &, int, int) const
48 bool hasSettings() const { return true; }
50 InsetCode lyxCode() const { return REF_CODE; }
52 DisplayType display() const { return Inline; }
54 int latex(odocstream &, OutputParams const &) const;
56 int plaintext(odocstream &, OutputParams const &) const;
58 int docbook(odocstream &, OutputParams const &) const;
60 docstring xhtml(XHTMLStream &, OutputParams const &) const;
61 /// the string that is passed to the TOC
62 void tocString(odocstream &) const;
64 void validate(LaTeXFeatures & features) const;
66 void updateBuffer(ParIterator const & it, UpdateType);
68 void addToToc(DocIterator const &);
70 bool forceLTR() const { return true; }
73 /// \name Static public methods obligated for InsetCommand derived classes
76 static ParamInfo const & findInfo(std::string const &);
78 static std::string defaultCommand() { return "ref"; }
80 static bool isCompatibleCommand(std::string const & s);
84 /// \name Private functions inherited from InsetCommand class
87 docstring screenLabel() const { return screen_label_; }
92 InsetRef(InsetRef const &);
95 /// \name Private functions inherited from Inset class
98 Inset * clone() const { return new InsetRef(*this); }
101 /// \return the label with things that need to be escaped escaped
102 docstring getEscapedLabel(OutputParams const &) const;
103 /// \return the command for a formatted reference to ref
104 /// \param label gets what follows the prefix, for refstyle
105 docstring getFormattedCmd(docstring const & ref, docstring & label) const;
108 mutable docstring screen_label_;
110 mutable docstring tooltip_;
116 #endif // INSET_REF_H