2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2002 The LyX Team.
9 * ======================================================
12 * \author Angus Leeming <a.leeming@ic.ac.uk>
13 * \author Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
25 #include "support/LOstream.h"
35 /** Nice functions and objects to handle TOCs
42 TocItem(Paragraph const * p, int d, string const & s)
43 : par(p), depth(d), str(s) {}
45 string const asString() const;
46 /// set cursor in LyXView to this TocItem
47 void goTo(LyXView & lv_) const;
48 /// the action corresponding to the goTo above
51 Paragraph const * par;
59 typedef std::vector<TocItem> Toc;
61 typedef std::map<string, Toc> TocList;
64 TocList const getTocList(Buffer const *);
67 std::vector<string> const getTypes(Buffer const *);
70 void asciiTocList(string const &, Buffer const *, std::ostream &);
72 /** Given the cmdName of the TOC param, returns the type used
73 by ControlToc::getContents() */
74 string const getType(string const & cmdName);
78 bool operator==(TocItem const & a, TocItem const & b)
80 return a.par == b.par && a.str == b.str;
81 // No need to compare depth.
87 bool operator!=(TocItem const & a, TocItem const & b)
90 // No need to compare depth.
96 #endif // CONTROLTOC_H