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