]> git.lyx.org Git - lyx.git/blob - src/toc.h
750b841467535a9d3ad0ece00f3da88ee773df4e
[lyx.git] / src / toc.h
1 // -*- C++ -*-
2 /**
3  * \file toc.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jean-Marc Lasgouttes
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  *
12  * Nice functions and objects to handle TOCs
13  */
14
15 #ifndef TOC_H
16 #define TOC_H
17
18 #include "TocBackend.h"
19
20 class LCursor;
21
22 namespace lyx {
23 namespace toc {
24
25 typedef TocBackend::Item TocItem;
26 typedef TocBackend::Toc::const_iterator TocIterator;
27 typedef TocBackend::Toc Toc;
28 typedef TocBackend::TocList TocList;
29
30 ///
31 void updateToc(Buffer const &);
32
33 ///
34 TocList const & getTocList(Buffer const &);
35
36 ///
37 Toc const & getToc(Buffer const & buf, std::string const & type);
38
39 ///
40 std::vector<std::string> const & getTypes(Buffer const &);
41
42 /// Return the first TocItem before the cursor
43 TocIterator const getCurrentTocItem(Buffer const &, LCursor const &,
44                                                                           std::string const & type);
45
46 ///
47 void asciiTocList(std::string const &, Buffer const &, lyx::odocstream &);
48
49 /** Given the cmdName of the TOC param, returns the type used
50     by ControlToc::getContents() */
51 std::string const getType(std::string const & cmdName);
52
53 /** Returns the guiname from a given @c type
54     The localization of the names will be done in the frontends */
55 std::string const getGuiName(std::string const & type, Buffer const &);
56
57 /// the type of outline operation
58 enum OutlineOp {
59         Up, // Move this header with text down
60         Down,   // Move this header with text up
61         In, // Make this header deeper
62         Out // Make this header shallower
63 };
64
65
66 void outline(OutlineOp, LCursor &);
67
68
69 } // namespace toc
70 } // namespace lyx
71
72 #endif // CONTROLTOC_H