]> git.lyx.org Git - lyx.git/blob - src/buffer_funcs.h
eb2b3d4a684c8963942a190213b14761b48d693f
[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 class Buffer;
22 class DocIterator;
23 class ErrorList;
24 class TeXErrors;
25 class ParIterator;
26
27 /**
28  *  Loads a LyX file \c filename into \c Buffer
29  *  and \return success status.
30  */
31 bool loadLyXFile(Buffer *, std::string const & filename);
32
33 /* Make a new file (buffer) with name \c filename based on a template
34  * named \c templatename
35  */
36 Buffer * newFile(std::string const & filename, std::string const & templatename,
37                  bool isNamed = false);
38
39 ///return the format of the buffer on a string
40 std::string const bufferFormat(Buffer const & buffer);
41
42 /// Fill in the ErrorList with the TeXErrors
43 void bufferErrors(Buffer const &, TeXErrors const &, ErrorList &);
44
45 /// Count the number of words in the text between these two iterators
46 int countWords(DocIterator const & from, DocIterator const & to);
47
48 /// Expand the counters for the labelstring of \c layout
49 lyx::docstring expandLabel(Buffer const & buf,
50                            LyXLayout_ptr const & layout,
51                            bool appendix);
52
53
54 /// update labels at "iter".
55 /**
56 A full updateLabels(Buffer const &) will be called if not possible.
57 */
58 void updateLabels(Buffer const & buf, ParIterator & it);
59
60 /// update labels between "from" and "to" if possible.
61 /**
62 A full updateLabels(Buffer const &) will be called if not possible.
63 */
64 void updateLabels(Buffer const & buf,
65         ParIterator & from, ParIterator & to);
66
67 /// updates all counters
68 void updateLabels(Buffer const &);
69
70 #endif // BUFFER_FUNCS_H