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 lyx::docstring const & master() const;
42 /// sets the master counter for this counter
43 void setMaster(lyx::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".
50 lyx::docstring master_;
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(lyx::docstring const & newc);
60 /// Add new counter having oldc as its master.
61 void newCounter(lyx::docstring const & newc,
62 lyx::docstring const & oldc);
64 void set(lyx::docstring const & ctr, int val);
66 void addto(lyx::docstring const & ctr, int val);
68 int value(lyx::docstring const & ctr) const;
69 /// Step (increment by one) counter named by arg, and
70 /// zeroes slave counter(s) for which it is the master.
71 /// NOTE sub-slaves not zeroed! That happens at slave's
72 /// first step 0->1. Seems to be sufficient.
73 void step(lyx::docstring const & ctr);
74 /// Reset all counters.
76 /// Reset counters matched by match string.
77 void reset(lyx::docstring const & match);
78 /// Copy counters whose name matches match from the &from to
79 /// the &to array of counters. Empty string matches all.
80 void copy(Counters & from, Counters & to,
81 lyx::docstring const & match = lyx::docstring());
82 /// A complete expanded label, like 2.1.4 for a subsubsection
83 /// according to the given format
84 lyx::docstring counterLabel(lyx::docstring const & format);
86 /// A counter label's single item, 1 for subsection number in
87 /// the 2.1.4 subsubsection number label.
88 lyx::docstring labelItem(lyx::docstring const & ctr,
89 lyx::docstring const & numbertype);
90 /// Maps counter (layout) names to actual counters.
91 typedef std::map<lyx::docstring, Counter> CounterList;
93 CounterList counterList;