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.
17 #include <boost/utility.hpp>
25 * The class holds all all open buffers, and handles construction
26 * and deletions of new ones.
28 class BufferList : boost::noncopyable {
32 /// write all buffers, asking the user, returns false if cancelled
35 /// create a new buffer
36 Buffer * newBuffer(string const & s, bool ronly = false);
39 void release(Buffer * b);
41 /// Close all open buffers.
44 /// returns a vector with all the buffers filenames
45 std::vector<string> const getFileNames() const;
48 void updateIncludedTeXfiles(string const &, LatexRunParams const &);
50 /// emergency save for all buffers
51 void emergencyWriteAll();
53 /// close buffer. Returns false if cancelled by user
54 bool close(Buffer * buf, bool ask);
56 /// return true if no buffers loaded
59 /// return head of buffer list if any
62 /// returns true if the buffer exists already
63 bool exists(string const &) const;
65 /// returns true if the buffer is loaded
66 bool isLoaded(Buffer const * b) const;
68 /// returns a pointer to the buffer with the given name.
69 Buffer * getBuffer(string const &);
70 /// returns a pointer to the buffer with the given number.
71 Buffer * getBuffer(unsigned int);
73 /// reset current author for all buffers
74 void setCurrentAuthor(string const & name, string const & email);
77 /// ask to save a buffer on quit, returns false if should cancel
78 bool quitWriteBuffer(Buffer * buf);
80 typedef std::vector<Buffer *> BufferStorage;
82 /// storage of all buffers
85 /// save emergency file for the given buffer
86 void emergencyWrite(Buffer * buf);
89 #endif // BUFFERLIST_H