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