4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
15 #include <boost/utility.hpp>
24 * The class holds all all open buffers, and handles construction
25 * and deletions of new ones.
27 class BufferList : boost::noncopyable {
31 /// write all buffers, asking the user, returns false if cancelled
34 /// create a new buffer
35 Buffer * newBuffer(std::string const & s, bool ronly = false);
38 void release(Buffer * b);
40 /// Close all open buffers.
43 /// returns a vector with all the buffers filenames
44 std::vector<std::string> const getFileNames() const;
47 void updateIncludedTeXfiles(std::string const &, LatexRunParams const &);
49 /// emergency save for all buffers
50 void emergencyWriteAll();
52 /// close buffer. Returns false if cancelled by user
53 bool close(Buffer * buf, bool ask);
55 /// return true if no buffers loaded
58 /// return head of buffer list if any
61 /// returns true if the buffer exists already
62 bool exists(std::string const &) const;
64 /// returns true if the buffer is loaded
65 bool isLoaded(Buffer const * b) const;
67 /// returns a pointer to the buffer with the given name.
68 Buffer * getBuffer(std::string const &);
69 /// returns a pointer to the buffer with the given number.
70 Buffer * getBuffer(unsigned int);
72 /// reset current author for all buffers
73 void setCurrentAuthor(std::string const & name, std::string const & email);
76 /// ask to save a buffer on quit, returns false if should cancel
77 bool quitWriteBuffer(Buffer * buf);
79 typedef std::vector<Buffer *> BufferStorage;
81 /// storage of all buffers
84 /// save emergency file for the given buffer
85 void emergencyWrite(Buffer * buf);
88 #endif // BUFFERLIST_H