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.
18 #include "support/docstring.h"
25 /// This represents a single counter.
40 /// Returns the master counter of this counter
41 docstring const & master() const;
42 /// sets the master counter for this counter
43 void setMaster(docstring const & m);
47 /// contains master counter name; master counter is the counter
48 /// that, if stepped (incremented) zeroes this counter. E.g.
49 /// "subparagraph"'s master is "paragraph".
54 /// This is a class of (La)TeX type counters.
55 /// Every instantiation is an array of counters of type Counter.
58 /// Add a new counter to array.
59 void newCounter(docstring const & newc);
60 /// Add new counter having oldc as its master.
61 void newCounter(docstring const & newc,
62 docstring const & oldc);
64 bool hasCounter(docstring const & c) const;
66 void set(docstring const & ctr, int val);
68 void addto(docstring const & ctr, int val);
70 int value(docstring const & ctr) const;
71 /// Step (increment by one) counter named by arg, and
72 /// zeroes slave counter(s) for which it is the master.
73 /// NOTE sub-slaves not zeroed! That happens at slave's
74 /// first step 0->1. Seems to be sufficient.
75 void step(docstring const & ctr);
76 /// Reset all counters.
78 /// Reset counters matched by match string.
79 void reset(docstring const & match);
80 /// Copy counters whose name matches match from the &from to
81 /// the &to array of counters. Empty string matches all.
82 void copy(Counters & from, Counters & to,
83 docstring const & match = docstring());
84 /// A complete expanded label, like 2.1.4 for a subsubsection
85 /// according to the given format
86 docstring counterLabel(docstring const & format);
88 bool appendix() const { return appendix_; };
90 void appendix(bool a) { appendix_ = a; };
92 std::string const & current_float() const { return current_float_; }
94 void current_float(std::string const & f) { current_float_ = f; }
96 /// A counter label's single item, 1 for subsection number in
97 /// the 2.1.4 subsubsection number label.
98 docstring labelItem(docstring const & ctr,
99 docstring const & numbertype);
100 /// Maps counter (layout) names to actual counters.
101 typedef std::map<docstring, Counter> CounterList;
103 CounterList counterList;
107 std::string current_float_;