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>
23 #include "support/LOstream.h"
33 /** Nice functions and objects to handle TOCs
40 TocItem(Paragraph * p, int d, string const & s)
41 : par(p), depth(d), str(s) {}
43 string const asString() const;
44 /// set cursor in LyXView to this TocItem
45 void goTo(LyXView & lv_) const;
46 /// the action corresponding to the goTo above
57 typedef std::vector<TocItem> Toc;
59 typedef std::map<string, Toc> TocList;
62 TocList const getTocList(Buffer const *);
65 std::vector<string> const getTypes(Buffer const *);
68 void asciiTocList(string const &, Buffer const *, ostream &);
70 /** Given the cmdName of the TOC param, returns the type used
71 by ControlToc::getContents() */
72 string const getType(string const & cmdName);
76 bool operator==(TocItem const & a, TocItem const & b)
78 return a.par == b.par && a.str == b.str;
79 // No need to compare depth.
85 bool operator!=(TocItem const & a, TocItem const & b)
88 // No need to compare depth.
94 #endif // CONTROLTOC_H