]> git.lyx.org Git - lyx.git/blob - src/buffer_funcs.h
8e555620445886f30f3374bebe215fa1caba738a
[lyx.git] / src / buffer_funcs.h
1 // -*- C++ -*-
2 /* \file buffer_funcs.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author Alfredo Braunstein
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef BUFFER_FUNCS_H
13 #define BUFFER_FUNCS_H
14
15 #include "lyxlayout_ptr_fwd.h"
16 #include "support/docstring.h"
17
18 #include <string>
19
20
21 namespace lyx {
22
23 namespace support { class FileName; }
24
25 class Buffer;
26 class DocIterator;
27 class ErrorList;
28 class TeXErrors;
29 class ParIterator;
30
31 /**
32  *  Loads a LyX file \c filename into \c Buffer
33  *  and \return success status.
34  */
35 bool loadLyXFile(Buffer *, support::FileName const & filename);
36
37 /* Make a new file (buffer) with name \c filename based on a template
38  * named \c templatename
39  */
40 Buffer * newFile(std::string const & filename, std::string const & templatename,
41                  bool isNamed = false);
42
43 ///return the format of the buffer on a string
44 std::string const bufferFormat(Buffer const & buffer);
45
46 /// Fill in the ErrorList with the TeXErrors
47 void bufferErrors(Buffer const &, TeXErrors const &, ErrorList &);
48
49 /// Count the number of words in the text between these two iterators
50 int countWords(DocIterator const & from, DocIterator const & to);
51
52 /// Expand the counters for the labelstring of \c layout
53 lyx::docstring expandLabel(Buffer const & buf,
54                            LyXLayout_ptr const & layout,
55                            bool appendix);
56
57
58 /// update labels at "iter".
59 /**
60 A full updateLabels(Buffer const &) will be called if not possible.
61 */
62 void updateLabels(Buffer const & buf, ParIterator & it, bool childonly = false);
63
64 /// update labels between "from" and "to" if possible.
65 /**
66 A full updateLabels(Buffer const &) will be called if not possible.
67 */
68 void updateLabels(Buffer const & buf,
69         ParIterator & from, ParIterator & to, bool childonly = false);
70
71 /// updates all counters
72 void updateLabels(Buffer const &, bool childonly = false);
73
74
75 } // namespace lyx
76
77 #endif // BUFFER_FUNCS_H