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>
21 #include "support/LOstream.h"
31 /** Nice functions and objects to handle TOCs
38 TocItem(int par_id, int d, string const & s)
39 : id_(par_id), depth(d), str(s) {}
41 string const asString() const;
42 /// set cursor in LyXView to this TocItem
43 void goTo(LyXView & lv_) const;
44 /// the action corresponding to the goTo above
46 /// Paragraph ID containing this item
55 typedef std::vector<TocItem> Toc;
57 typedef std::map<string, Toc> TocList;
60 TocList const getTocList(Buffer const *);
63 std::vector<string> const getTypes(Buffer const *);
66 void asciiTocList(string const &, Buffer const *, std::ostream &);
68 /** Given the cmdName of the TOC param, returns the type used
69 by ControlToc::getContents() */
70 string const getType(string const & cmdName);
73 bool operator==(TocItem const & a, TocItem const & b)
75 return a.id_ == b.id_ && a.str == b.str;
76 // No need to compare depth.
81 bool operator!=(TocItem const & a, TocItem const & b)
89 #endif // CONTROLTOC_H