4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * \author Martin Vermeer
12 * Full author contact details are available in file CREDITS.
22 /// This represents a single counter.
37 /// Returns the master counter of this counter
38 std::string master() const;
39 /// sets the master counter for this counter
40 void setMaster(std::string const & m);
44 /// contains master counter name; master counter is the counter
45 /// that, if stepped (incremented) zeroes this counter. E.g.
46 /// "subparagraph"'s master is "paragraph".
51 /// This is a class of (La)TeX type counters.
52 /// Every instantiation is an array of counters of type Counter.
55 /// Add a new counter to array.
56 void newCounter(std::string const & newc);
57 /// Add new counter having oldc as its master.
58 void newCounter(std::string const & newc, std::string const & oldc);
60 void set(std::string const & ctr, int val);
62 void addto(std::string const & ctr, int val);
64 int value(std::string const & ctr) const;
65 /// Step (increment by one) counter named by arg, and
66 /// zeroes slave counter(s) for which it is the master.
67 /// NOTE sub-slaves not zeroed! That happens at slave's
68 /// first step 0->1. Seems to be sufficient.
69 void step(std::string const & ctr);
70 /// Reset all counters.
72 /// Reset counters matched by match string.
73 void reset(std::string const & match);
74 /// Copy counters whose name matches match from the &from to
75 /// the &to array of counters. Empty string matches all.
76 void copy(Counters & from, Counters & to, std::string const & match = std::string());
77 /// A complete expanded label, like 2.1.4 for a subsubsection
78 /// according to the given format
79 std::string counterLabel(std::string const & format);
80 /// A complete label, like 1.a for enumerations
81 std::string enumLabel(std::string const & ctr, std::string const & langtype = "latin");
83 /// A counter label's single item, 1 for subsection number in
84 /// the 2.1.4 subsubsection number label.
85 std::string labelItem(std::string const & ctr, std::string const & numbertype);
86 /// Maps counter (layout) names to actual counters.
87 typedef std::map<std::string, Counter> CounterList;
89 CounterList counterList;