4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Richard Kimberly Heck
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_COUNTER_H
13 #define INSET_COUNTER_H
15 #include "InsetCommand.h"
21 class InsetCounter : public InsetCommand {
24 InsetCounter(Buffer * buffer, InsetCommandParams const &);
25 /// \name Public functions inherited from Inset class
28 bool isLabeled() const { return true; }
30 docstring toolTip(BufferView const &, int, int) const
33 bool hasSettings() const { return true; }
35 InsetCode lyxCode() const { return COUNTER_CODE; }
37 void latex(otexstream &, OutputParams const &) const;
39 int plaintext(odocstringstream & ods, OutputParams const & op,
40 size_t max_length = INT_MAX) const;
42 void docbook(odocstream &, OutputParams const &) const;
44 docstring xhtml(XMLStream &, OutputParams const &) const;
46 void toString(odocstream &) const;
48 void validate(LaTeXFeatures & features) const;
50 void updateBuffer(ParIterator const & it, UpdateType, bool const);
52 std::string contextMenuName() const;
55 /// \name Static public methods obligated for InsetCommand derived classes
58 static ParamInfo const & findInfo(std::string const &);
60 static std::string defaultCommand() { return "set"; }
62 static bool isCompatibleCommand(std::string const & s);
64 /// keys are commands, values are GUI strings
65 static const std::vector<std::pair<std::string, std::string>> counterTable;
66 static const std::map<std::string, std::string> valueTable;
70 InsetCounter(InsetCounter const &);
73 /// \name Private functions inherited from Inset class
76 Inset * clone() const { return new InsetCounter(*this); }
79 /// \name Private functions inherited from InsetCommand class
82 docstring screenLabel() const { return screen_label_; }
85 docstring lyxSaveCounter() const;
87 void trackCounters(std::string const & cmd) const;
89 mutable docstring screen_label_;
91 mutable docstring tooltip_;