]> git.lyx.org Git - lyx.git/blob - src/buffer_funcs.h
Fixed some lines that were too long. It compiled afterwards.
[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 namespace support { class FileName; }
24
25 class Buffer;
26 class DocIterator;
27 class ErrorList;
28 class TeXErrors;
29 class ParIterator;
30
31
32 /** 
33  * Returns true if the file is already loaded into a buffer.
34  */
35 bool checkIfLoaded(support::FileName const & fn);
36
37 /**
38  *  Loads a LyX file \c filename into \c Buffer
39  *  and \return success status.
40  */
41 bool loadLyXFile(Buffer *, support::FileName const & filename);
42
43 /**
44  *  Checks and loads a LyX file \param filename.
45  *  \retval the newly created \c Buffer pointer if successful or 0.
46  *  \retval 0 if the \c Buffer could not be created.
47  */
48 Buffer * checkAndLoadLyXFile(support::FileName const & filename);
49
50 /** Make a new file (buffer) with name \c filename based on a template
51  *  named \c templatename
52  */
53 Buffer * newFile(std::string const & filename, std::string const & templatename,
54                  bool isNamed = false);
55
56 ///return the format of the buffer on a string
57 std::string const bufferFormat(Buffer const & buffer);
58
59 /// Fill in the ErrorList with the TeXErrors
60 void bufferErrors(Buffer const &, TeXErrors const &, ErrorList &);
61
62 /// Count the number of words in the text between these two iterators
63 int countWords(DocIterator const & from, DocIterator const & to);
64
65 /// updates all counters
66 void updateLabels(Buffer const &, bool childonly = false);
67
68 ///
69 void checkBufferStructure(Buffer &, ParIterator const &);
70
71 } // namespace lyx
72
73 #endif // BUFFER_FUNCS_H