4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
16 #include "support/LOstream.h"
26 /** Nice functions and objects to handle TOCs
33 TocItem(int par_id, int d, string const & s)
34 : id_(par_id), depth(d), str(s) {}
36 string const asString() const;
37 /// set cursor in LyXView to this TocItem
38 void goTo(LyXView & lv_) const;
39 /// the action corresponding to the goTo above
41 /// Paragraph ID containing this item
50 typedef std::vector<TocItem> Toc;
52 typedef std::map<string, Toc> TocList;
55 TocList const getTocList(Buffer const *);
58 std::vector<string> const getTypes(Buffer const *);
61 void asciiTocList(string const &, Buffer const *, std::ostream &);
63 /** Given the cmdName of the TOC param, returns the type used
64 by ControlToc::getContents() */
65 string const getType(string const & cmdName);
68 bool operator==(TocItem const & a, TocItem const & b)
70 return a.id_ == b.id_ && a.str == b.str;
71 // No need to compare depth.
76 bool operator!=(TocItem const & a, TocItem const & b)
85 #endif // CONTROLTOC_H