summaryrefslogtreecommitdiff
path: root/support/lametex/src/Counter.h
blob: f0ae40954c439d968121bc7d94b176114ab67cad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Counter.h
 *
 * LameTeX needs to keep track of a number of counters, just like LaTeX does,
 * for things like tables, footnotes, chapters and sections, and enumerations.
 * Since all counters need to be handled in much the same way, the Counter
 * derived class under the Parameters class has been defined.
 *
 * Copyright 1992 Jonathan Monsarrat. Permission given to freely distribute,
 * edit and use as long as this copyright statement remains intact.
 *
 */

class Counter : public Param {
 public:
   enum CounterType {   // The official LaTeX counters. All start at zero.
      Part,
      Chapter,
      Section,
      Subsection,
      Subsubsection,
      Paragraph,
      Subparagraph,
      Page,
      Equation,
      Figure,
      Table,
      Footnote,
      Mpfootnote,
      Description,
      Enum,
      Enumi,
      Enumii,
      Enumiii,
      Enumiv,
      Itemize,
      Item,
      LastType
   };

   Counter();
   Counter(Counter *);
   Param *copy();
   int set(int, float, char*);
   float get(int, char*);
   void postscript_set(int);
   void revert(Param *);
   void downcase_roman(int, char*);
   void upcase_roman(int, char*);
   void arabic(int, char*);
   void downcase_alpha(int, char*);
   void upcase_alpha(int, char*);
 private:
   int counters[LastType];
   void description();
};