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.
12 * Nice functions and objects to handle TOCs
33 TocItem(int par_id, int d, std::string const & s)
34 : id_(par_id), depth(d), str(s) {}
36 std::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
40 FuncRequest action() const;
41 /// Paragraph ID containing this item
50 typedef std::vector<TocItem> Toc;
52 typedef std::map<std::string, Toc> TocList;
55 TocList const getTocList(Buffer const &);
58 std::vector<std::string> const getTypes(Buffer const &);
61 void asciiTocList(std::string const &, Buffer const &, std::ostream &);
63 /** Given the cmdName of the TOC param, returns the type used
64 by ControlToc::getContents() */
65 std::string const getType(std::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