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