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>
23 * The class holds all all open buffers, and handles construction
24 * and deletions of new ones.
26 class BufferList : boost::noncopyable {
30 /// write all buffers, asking the user, returns false if cancelled
33 /// create a new buffer
34 Buffer * newBuffer(std::string const & s, bool ronly = false);
37 void release(Buffer * b);
39 /// Close all open buffers.
42 /// returns a vector with all the buffers filenames
43 std::vector<std::string> const getFileNames() const;
46 void updateIncludedTeXfiles(std::string const &, LatexRunParams const &);
48 /// emergency save for all buffers
49 void emergencyWriteAll();
51 /// close buffer. Returns false if cancelled by user
52 bool close(Buffer * buf, bool ask);
54 /// return true if no buffers loaded
57 /// return head of buffer list if any
60 /// returns true if the buffer exists already
61 bool exists(std::string const &) const;
63 /// returns true if the buffer is loaded
64 bool isLoaded(Buffer const * b) const;
66 /// returns a pointer to the buffer with the given name.
67 Buffer * getBuffer(std::string const &);
68 /// returns a pointer to the buffer with the given number.
69 Buffer * getBuffer(unsigned int);
71 /// reset current author for all buffers
72 void setCurrentAuthor(std::string const & name, std::string const & email);
75 /// ask to save a buffer on quit, returns false if should cancel
76 bool quitWriteBuffer(Buffer * buf);
78 typedef std::vector<Buffer *> BufferStorage;
80 /// storage of all buffers
83 /// save emergency file for the given buffer
84 void emergencyWrite(Buffer * buf);
87 #endif // BUFFERLIST_H