]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.h
adjust
[lyx.git] / src / Buffer.h
index 7d18ab65e2870904b943a0f0750c0fbb137c75d9..37a2670265f32d6bcb83ee079d2d5ee2332c4b6d 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef BUFFER_H
 #define BUFFER_H
 
-#include "DocIterator.h"
+#include "insets/InsetCode.h"
 
 #include "support/FileName.h"
 #include "support/limited_stack.h"
@@ -20,9 +20,6 @@
 #include "support/docstring.h"
 #include "support/docstream.h"
 
-#include <boost/scoped_ptr.hpp>
-#include <boost/signal.hpp>
-
 #include <iosfwd>
 #include <string>
 #include <utility>
 namespace lyx {
 
 class BufferParams;
+class EmbeddedFiles;
 class ErrorItem;
 class ErrorList;
 class FuncRequest;
 class Inset;
-class InsetText;
 class Font;
 class Lexer;
 class LyXRC;
@@ -54,6 +51,10 @@ class TexRow;
 class TocBackend;
 class Undo;
 
+namespace frontend {
+class GuiBufferDelegate;
+class WorkAreaManager;
+}
 
 /** The buffer object.
  * This is the buffer object. It contains all the informations about
@@ -65,7 +66,7 @@ class Undo;
  * I am not sure if the class is complete or
  * minimal, probably not.
  * \author Lars Gullik Bjønnes
 */
+ */
 class Buffer {
 public:
        /// What type of log will \c getLogName() return?
@@ -140,27 +141,8 @@ public:
        /// do we have a paragraph with this id?
        bool hasParWithID(int id) const;
 
-       /// This signal is emitted when the buffer is changed.
-       boost::signal<void()> changed;
-       /// This signal is emitted when the buffer structure is changed.
-       boost::signal<void()> structureChanged;
-       /// This signal is emitted when an embedded file is changed
-       boost::signal<void()> embeddingChanged;
-       /// This signal is emitted when some parsing error shows up.
-       boost::signal<void(std::string)> errors;
-       /// This signal is emitted when some message shows up.
-       boost::signal<void(docstring)> message;
-       /// This signal is emitted when the buffer busy status change.
-       boost::signal<void(bool)> busy;
-       /// This signal is emitted when the buffer readonly status change.
-       boost::signal<void(bool)> readonly;
-       /// Update window titles of all users.
-       boost::signal<void()> updateTitles;
-       /// Reset autosave timers for all users.
-       boost::signal<void()> resetAutosaveTimers;
-       /// This signal is emitting if the buffer is being closed.
-       boost::signal<void(Buffer *)> closing;
-
+       ///
+       frontend::WorkAreaManager & workAreaManager() const;
 
        /** Save file.
            Takes care of auto-save files and backup file if requested.
@@ -236,7 +218,7 @@ public:
        void markClean() const;
 
        ///
-       void markBakClean();
+       void markBakClean() const;
 
        ///
        void markDepClean(std::string const & name);
@@ -384,9 +366,11 @@ public:
        ///
        void insertMacro(docstring const & name, MacroData const & data);
 
-       ///
+       /// Replace the inset contents for insets which InsetCode is equal
+       /// to the passed \p inset_code.
        void changeRefsIfUnique(docstring const & from, docstring const & to,
-               Inset::Code code);
+               InsetCode code);
+
 /// get source code (latex/docbook) for some paragraphs, or all paragraphs
 /// including preamble
        void getSourceCode(odocstream & os, pit_type par_begin, pit_type par_end, bool full_source);
@@ -406,6 +390,34 @@ public:
        EmbeddedFiles & embeddedFiles();
        EmbeddedFiles const & embeddedFiles() const;
        //@}
+       
+       /// This function is called when the buffer is changed.
+       void changed() const;
+       /// This function is called when the buffer structure is changed.
+       void structureChanged() const;
+       /// This function is called when an embedded file is changed
+       void embeddingChanged() const;
+       /// This function is called when some parsing error shows up.
+       void errors(std::string const & err) const;
+       /// This function is called when the buffer busy status change.
+       void busy(bool on) const;
+       /// This function is called when the buffer readonly status change.
+       void readonly(bool on) const;
+       /// Update window titles of all users.
+       void updateTitles() const;
+       /// Reset autosave timers for all users.
+       void resetAutosaveTimers() const;
+       ///
+       void message(docstring const & msg) const;
+
+       void setGuiDelegate(frontend::GuiBufferDelegate * gui);
+
+       ///
+       void autoSave() const;
+       ///
+       bool writeAs(std::string const & newname = std::string());
+       ///
+       bool menuWrite();
 
 private:
        /** Inserts a file into a document
@@ -417,11 +429,13 @@ private:
        /// Use the Pimpl idiom to hide the internals.
        class Impl;
        /// The pointer never changes although *pimpl_'s contents may.
-       boost::scoped_ptr<Impl> const pimpl_;
+       Impl * const pimpl_;
 
        /// A cache for the bibfiles (including bibfiles of loaded child
        /// documents), needed for appropriate update of natbib labels.
        mutable std::vector<support::FileName> bibfilesCache_;
+
+       frontend::GuiBufferDelegate * gui_;
 };