2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
11 * ====================================================== */
25 /// This represents a single counter.
40 /// Returns the master counter of this counter
41 string master() const;
42 /// sets the master counter for this counter
43 void setMaster(string const & m);
48 /// contains master counter name; master counter is the counter
49 /// that, if stepped (incremented) zeroes this counter. E.g.
50 /// "subparagraph"'s master is "paragraph".
55 /// This is a class of (La)TeX type counters.
56 /// Every instantiation is an array of counters of type Counter.
63 /// Add a new counter to array.
64 void newCounter(string const & newc);
65 /// Add new counter having oldc as its master.
66 void newCounter(string const & newc, string const & oldc);
68 void set(string const & ctr, int val);
70 void addto(string const & ctr, int val);
72 int value(string const & ctr) const;
73 /// Step (increment by one) counter named by arg, and
74 /// zeroes slave counter(s) for which it is the master.
75 /// NOTE sub-slaves not zeroed! That happens at slave's
76 /// first step 0->1. Seems to be sufficient.
77 void step(string const & ctr);
78 /// Reset counters matched by match string. Empty string matches
80 void reset(string const & match = string());
81 /// Copy counters whose name matches match from the &from to
82 /// the &to array of counters. Empty string matches all.
83 void copy(Counters & from, Counters & to, string const & match = string());
84 /// A numeric label's single item, like .1 for subsection number in
85 /// the 2.1.4 subsubsection number label. "first" indicates if this
86 /// is the first item to be displayed, usually chapter or section.
87 string labelItem(string const & ctr,
88 string const & labeltype,
89 string const & langtype = "latin",
91 /// A complete numeric label, like 2.1.4 for a subsubsection.
92 /// "head" indicates sequence number of first item to be
93 /// displayed, e.g. 0 for chapter, 1 for section.
94 string numberLabel(string const & ctr,
95 string const & labeltype,
96 string const & langtype = "latin",
98 /// Maps numbers to enumeration of sectioning counter name strings.
99 std::vector<string> enums;
100 std::vector<string> sects;
103 /// Maps counter (layout) names to actual counters.
104 typedef std::map<string, Counter> CounterList;
106 CounterList counterList;