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
19 namespace support { class FileName; }
27 * Returns true if the file is already loaded into a buffer.
29 bool checkIfLoaded(support::FileName const & fn);
32 * Checks and loads a LyX file \param filename.
33 * \retval the newly created \c Buffer pointer if successful or 0.
34 * \retval 0 if the \c Buffer could not be created.
36 Buffer * checkAndLoadLyXFile(support::FileName const & filename);
38 /** Make a new file (buffer) with name \c filename based on a template
39 * named \c templatename
41 Buffer * newFile(std::string const & filename, std::string const & templatename,
42 bool isNamed = false);
44 /// Count the number of words in the text between these two iterators
45 int countWords(DocIterator const & from, DocIterator const & to);
47 /// updates all counters
48 void updateLabels(Buffer const &, bool childonly = false);
51 void updateLabels(Buffer const &, ParIterator &);
54 void checkBufferStructure(Buffer &, ParIterator const &);
58 #endif // BUFFER_FUNCS_H