#include "support/SignalSlot.h"
#include <list>
+#include <set>
#include <string>
#include <vector>
*/
bool readDocument(Lexer &);
- ///
- void insertStringAsLines(ParagraphList & plist,
- pit_type &, pos_type &,
- Font const &, docstring const &, bool);
///
DocIterator getParFromID(int id) const;
/// do we have a paragraph with this id?
/// Write document to stream. Returns \c false if unsuccesful.
bool write(std::ostream &) const;
+ /// save emergency file
+ /// \return a status message towards the user.
+ docstring emergencyWrite();
/// Write file. Returns \c false if unsuccesful.
bool writeFile(support::FileName const &) const;
- /// Loads LyX file \c filename into buffer, * and \return success
+ /// Loads LyX file \c filename into buffer, * and return success
bool loadLyXFile(support::FileName const & s);
/// Fill in the ErrorList with the TeXErrors
///
void setUnnamed(bool flag = true);
- ///
+ /// Whether or not a filename has been assigned to this buffer
bool isUnnamed() const;
+ /// Whether or not this buffer is internal.
+ ///
+ /// An internal buffer does not contain a real document, but some auxiliary text segment.
+ /// It is not associated with a filename, it is never saved, thus it does not need to be
+ /// automatically saved, nor it needs to trigger any "do you want to save ?" question.
+ bool isInternal() const;
+
/// Mark this buffer as dirty.
void markDirty();
/// \return true if \p child is a child of this \c Buffer.
bool isChild(Buffer * child) const;
- /// return a vector with all children and grandchildren
- std::vector<Buffer *> getChildren() const;
+ /// return a vector with all children (and grandchildren)
+ std::vector<Buffer *> getChildren(bool grand_children = true) const;
/// Is buffer read-only?
bool isReadonly() const;
/// Return macro defined before the inclusion of the child
MacroData const * getMacro(docstring const & name, Buffer const & child, bool global = true) const;
+ /// Collect user macro names at loading time
+ typedef std::set<docstring> UserMacroSet;
+ UserMacroSet usermacros;
+
/// Replace the inset contents for insets which InsetCode is equal
/// to the passed \p inset_code.
void changeRefsIfUnique(docstring const & from, docstring const & to,
*/
void updateMacros(DocIterator & it,
DocIterator & scope) const;
-
+ ///
+ void setLabel(ParIterator & it) const;
///
void collectRelatives(BufferSet & bufs) const;