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
34 TocItem(int par_id, int d, std::string const & s)
35 : id_(par_id), depth(d), str(s) {}
37 std::string const asString() const;
38 /// set cursor in LyXView to this TocItem
39 void goTo(LyXView & lv_) const;
40 /// the action corresponding to the goTo above
41 FuncRequest action() const;
42 /// Paragraph ID containing this item
51 typedef std::vector<TocItem> Toc;
53 typedef std::map<std::string, Toc> TocList;
56 TocList const getTocList(Buffer const &);
59 std::vector<std::string> const getTypes(Buffer const &);
62 void asciiTocList(std::string const &, Buffer const &, std::ostream &);
64 /** Given the cmdName of the TOC param, returns the type used
65 by ControlToc::getContents() */
66 std::string const getType(std::string const & cmdName);
69 bool operator==(TocItem const & a, TocItem const & b)
71 return a.id_ == b.id_ && a.str == b.str;
72 // No need to compare depth.
77 bool operator!=(TocItem const & a, TocItem const & b)
86 #endif // CONTROLTOC_H