]> git.lyx.org Git - lyx.git/blob - src/buffer_funcs.h
Avoid full metrics computation with Update:FitCursor
[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 <string>
16
17 namespace lyx {
18
19 namespace support { class FileName; }
20
21 class Buffer;
22
23 /**
24  *  Checks and loads a LyX file \param filename.
25  *  \retval the newly created \c Buffer pointer if successful or 0.
26  *  \retval 0 if the \c Buffer could not be created.
27  */
28 Buffer * checkAndLoadLyXFile(support::FileName const & filename,
29                 bool acceptDirty = false);
30
31 /** Make a new file (buffer) with name \c filename based on a template
32  *  named \c templatename
33  */
34 Buffer * newFile(std::string const & filename, std::string const & templatename,
35                  bool isNamed = false);
36
37 /** Make a new unnamed file (buffer) with prefix \c prefix
38  *  based on a template named \c templatename
39  */
40 Buffer * newUnnamedFile(support::FileName const & path,
41         std::string const & prefix, std::string const & templatename = "");
42
43 /// Load the file with name \c fname, and returns the buffer. If the
44 /// file was already loaded it just returns the associated buffer.
45 Buffer * loadIfNeeded(support::FileName const & fname);
46
47 } // namespace lyx
48
49 #endif // BUFFER_FUNCS_H