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.
6 * \author Lars Gullik Bjønnes
7 * \author Alfredo Braunstein
9 * Full author contact details are available in file CREDITS.
12 #ifndef BUFFER_FUNCS_H
13 #define BUFFER_FUNCS_H
15 #include "lyxlayout_ptr_fwd.h"
16 #include "support/docstring.h"
23 namespace support { class FileName; }
32 * Loads a LyX file \c filename into \c Buffer
33 * and \return success status.
35 bool loadLyXFile(Buffer *, support::FileName const & filename);
38 * Checks and loads a LyX file \param filename.
39 * \retval the newly created \c Buffer pointer if successful or 0.
40 * \retval 0 if the \c Buffer could not be created.
42 Buffer * checkAndLoadLyXFile(support::FileName const & filename);
44 /* Make a new file (buffer) with name \c filename based on a template
45 * named \c templatename
47 Buffer * newFile(std::string const & filename, std::string const & templatename,
48 bool isNamed = false);
50 ///return the format of the buffer on a string
51 std::string const bufferFormat(Buffer const & buffer);
53 /// Fill in the ErrorList with the TeXErrors
54 void bufferErrors(Buffer const &, TeXErrors const &, ErrorList &);
56 /// Count the number of words in the text between these two iterators
57 int countWords(DocIterator const & from, DocIterator const & to);
59 /// update labels at "iter".
61 A full updateLabels(Buffer const &) will be called if not possible.
63 void updateLabels(Buffer const & buf, ParIterator & it, bool childonly = false);
65 /// update labels between "from" and "to" if possible.
67 A full updateLabels(Buffer const &) will be called if not possible.
69 void updateLabels(Buffer const & buf,
70 ParIterator & from, ParIterator & to, bool childonly = false);
72 /// updates all counters
73 void updateLabels(Buffer const &, bool childonly = false);
76 void checkBufferStructure(Buffer &, ParIterator const &);
80 #endif // BUFFER_FUNCS_H