]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.h
Update it.po
[lyx.git] / src / Buffer.h
index 012f73bf67e97b9c174ce373d2cd27728a143a92..1b16e1abff7f3103cd49dda44973a0d2b75145f7 100644 (file)
@@ -21,6 +21,7 @@
 #include "support/SignalSlot.h"
 
 #include <list>
+#include <set>
 #include <string>
 #include <vector>
 
@@ -155,10 +156,6 @@ public:
        */
        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?
@@ -175,6 +172,9 @@ public:
 
        /// 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;
 
@@ -263,9 +263,16 @@ public:
        ///
        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();
 
@@ -305,8 +312,8 @@ public:
        /// \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;
@@ -423,6 +430,10 @@ public:
        /// 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,
@@ -509,8 +520,6 @@ public:
 
        /// return a list of all used branches (also in children)
        void getUsedBranches(std::list<docstring> &, bool const from_master = false) const;
-       /// rename all branches of \p oldname in the buffer to \p newname.
-       void renameBranches(docstring const & oldname, docstring const & newname);
 
        /// sets the buffer_ member for every inset in this buffer.
        // FIXME This really shouldn't be needed, but at the moment it's not
@@ -539,7 +548,8 @@ private:
        */
        void updateMacros(DocIterator & it,
                                     DocIterator & scope) const;
-
+       ///
+       void setLabel(ParIterator & it) const;
        ///
        void collectRelatives(BufferSet & bufs) const;
 
@@ -553,6 +563,11 @@ private:
        ReadStatus readFile(Lexer &, support::FileName const & filename,
                            bool fromString = false);
 
+       /** If we have branches that use the file suffix
+           feature, return the file name with suffix appended.
+       */
+       support::FileName exportFileName() const;
+
        /// Use the Pimpl idiom to hide the internals.
        class Impl;
        /// The pointer never changes although *pimpl_'s contents may.