1 /************************************************************************/
2 /*									*/
3 /*  Evaluate TOC fields.						*/
4 /*									*/
5 /************************************************************************/
6 
7 #   include	<docTocField.h>
8 #   include	<docBlockFrame.h>
9 #   include	<docListDepth.h>
10 
11 #   ifndef	DOC_CALCULATE_TOC_H
12 #   define	DOC_CALCULATE_TOC_H
13 
14 typedef struct TocEntry
15     {
16     int				teLevel;
17     const DocumentField *	teField;
18     DocumentSelection		teDsInside;
19     DocumentSelection		teDsAround;
20     int				tePart0;
21     int				tePart1;
22     const MemoryBuffer *	teMarkName;
23     int				teNumbered;
24     } TocEntry;
25 
26 /************************************************************************/
27 
28 typedef struct CalculateToc
29     {
30 				/**
31 				 *  The intermediate document holding the
32 				 *  table of contents. Finally we will
33 				 *  insert it in the document.
34 				 */
35     BufferDocument *		ctBdToc;
36 				/**
37 				 *  The document that we index and that will
38 				 *  recieve the table of contents.
39 				 */
40     BufferDocument *		ctBdDoc;
41 				/**
42 				 *  The section that will hold the table of
43 				 *  contents.
44 				 */
45     struct BufferItem *		ctSectNode;
46     DocumentField *		ctDfTocTo;
47     TocField			ctTocField;
48     BlockFrame			ctBlockFrame;
49     ParagraphProperties		ctRefPP;
50     TextAttribute		ctTextAttribute;
51     int				ctDefaultTextAttributeNumber;
52     const DocumentStyle *	ctLevelStyles[PPoutline_COUNT];
53     int				ctLevelAttributeNumbers[PPoutline_COUNT];
54 				/**
55 				 *  The numbers of the styles that are
56 				 *  listed in the table of contents.
57 				 */
58     IndexSet			ctStyleNumbers;
59 
60     TocEntry *			ctEntries;
61     int				ctEntryCount;
62     int				ctDepth;
63 
64     unsigned char *		ctStyleLevels;
65     int				ctStyleLevelCount;
66     } CalculateToc;
67 
68 /************************************************************************/
69 /*									*/
70 /*  Routine declarations.						*/
71 /*									*/
72 /************************************************************************/
73 
74 extern void docInitCalculateToc(	CalculateToc *	ct );
75 extern void docCleanCalculateToc(	CalculateToc *	ct );
76 
77 extern int docCollectTocInput(	CalculateToc *			ct );
78 
79 #   endif /*	DOC_CALCULATE_TOC_H	*/
80