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
23 #include "pariterator.h"
36 TocItem(int par_id, int d, std::string const & s)
37 : id_(par_id), depth(d), str(s) {}
39 std::string const asString() const;
40 /// set cursor in LyXView to this TocItem
41 void goTo(LyXView & lv_) const;
42 /// the action corresponding to the goTo above
43 FuncRequest action() const;
44 /// Paragraph ID containing this item
53 typedef std::vector<TocItem> Toc;
55 typedef std::map<std::string, Toc> TocList;
58 TocList const getTocList(Buffer const &);
61 std::vector<std::string> const getTypes(Buffer const &);
64 void asciiTocList(std::string const &, Buffer const &, std::ostream &);
66 /** Given the cmdName of the TOC param, returns the type used
67 by ControlToc::getContents() */
68 std::string const getType(std::string const & cmdName);
70 /** Returns the guiname from a given @c type
71 The localization of the names will be done in the frontends */
72 std::string const getGuiName(std::string const & type, Buffer const &);
75 bool operator==(TocItem const & a, TocItem const & b)
77 return a.id_ == b.id_ && a.str == b.str;
78 // No need to compare depth.
83 bool operator!=(TocItem const & a, TocItem const & b)
89 /// the type of outline operation
91 UP, // Move this header with text down
92 DOWN, // Move this header with text up
93 IN, // Make this header deeper
94 OUT // Make this header shallower
98 void Outline(OutlineOp, Buffer *, pit_type &);
104 #endif // CONTROLTOC_H