X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.h;h=f932a565cef68516a1ee7e39662750bdcf827ff3;hb=1c362c80b22012d66472da713ffa0cf3d71815e7;hp=61f6c4ae09cf451ac91fec342a4deb1b03cf6613;hpb=b5153b3d2689abffebb2f4c97b3fb781dadf0c3c;p=lyx.git diff --git a/src/Buffer.h b/src/Buffer.h index 61f6c4ae09..f932a565ce 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -16,21 +16,23 @@ #include "support/strfwd.h" #include "support/types.h" +#include "support/SignalSlot.h" -#include #include #include namespace lyx { +class BiblioInfo; class BufferParams; -class EmbeddedFileList; class DocIterator; class ErrorItem; class ErrorList; class FuncRequest; class Inset; +class InsetRef; +class InsetLabel; class Font; class Format; class Lexer; @@ -40,6 +42,8 @@ class LyXVC; class LaTeXFeatures; class Language; class MacroData; +class MacroNameSet; +class MacroSet; class OutputParams; class Paragraph; class ParConstIterator; @@ -57,6 +61,7 @@ class WorkAreaManager; namespace support { class FileName; +class FileNameList; } /** The buffer object. @@ -143,7 +148,7 @@ public: pit_type &, pos_type &, Font const &, docstring const &, bool); /// - ParIterator getParFromID(int id) const; + DocIterator getParFromID(int id) const; /// do we have a paragraph with this id? bool hasParWithID(int id) const; @@ -274,6 +279,9 @@ public: */ Buffer const * masterBuffer() const; + /// \return true if \p child is a child of this \c Buffer. + bool isChild(Buffer * child) const; + /// Is buffer read-only? bool isReadonly() const; @@ -301,9 +309,16 @@ public: /// Update the cache with all bibfiles in use (including bibfiles /// of loaded child documents). void updateBibfilesCache() const; + /// + void invalidateBibinfoCache(); /// Return the cache with all bibfiles in use (including bibfiles /// of loaded child documents). - EmbeddedFileList const & getBibfilesCache() const; + support::FileNameList const & getBibfilesCache() const; + /// \return the bibliography information for this buffer's master, + /// or just for it, if it isn't a child. + BiblioInfo const & masterBibInfo() const; + /// \return the bibliography information for this buffer ONLY. + BiblioInfo const & localBibInfo() const; /// void getLabelList(std::vector &) const; @@ -365,13 +380,10 @@ public: /// Iterate through the whole buffer and try to resolve macros void updateMacroInstances() const; - typedef std::set MacroNameSet; - /// List macro names of this buffer. the parent and the children + /// List macro names of this buffer, the parent and the children void listMacroNames(MacroNameSet & macros) const; - /// Write out all macros somewhere defined in the parent, - /// its parents and its children, which are visible at the beginning - /// of this buffer - void writeParentMacros(odocstream & os) const; + /// Collect macros of the parent and its children in front of this buffer. + void listParentMacros(MacroSet & macros, LaTeXFeatures & features) const; /// Return macro defined before pos (or in the master buffer) MacroData const * getMacro(docstring const & name, DocIterator const & pos, bool global = true) const; @@ -402,15 +414,10 @@ public: /// method is const because modifying this backend does not touch /// the document contents. TocBackend & tocBackend() const; - - //@{ - EmbeddedFileList & embeddedFiles(); - EmbeddedFileList const & embeddedFiles() const; - bool embedded() const; - //@} + /// Undo & undo(); - + /// This function is called when the buffer is changed. void changed() const; /// This function is called when the buffer structure is changed. @@ -432,10 +439,6 @@ public: /// void autoSave() const; - /// - void loadChildDocuments() const; - /// - void resetChildDocuments(bool close_them) const; /// return the format of the buffer on a string std::string bufferFormat() const; @@ -452,29 +455,23 @@ public: /// std::vector exportableFormats(bool only_viewable) const; + /// + typedef std::vector > References; + References & references(docstring const & label); + References const & references(docstring const & label) const; + void clearReferenceCache() const; + void setInsetLabel(docstring const & label, InsetLabel const * il); + InsetLabel const * insetLabel(docstring const & label) const; + private: /// search for macro in local (buffer) table or in children MacroData const * getBufferMacro(docstring const & name, DocIterator const & pos) const; - /** Update macro table in the whole text inset - \param it at the start of the text inset) - */ - void updateInsetMacros(DocIterator & it, - DocIterator & scope) const; - /** Update macro table for paragraphs until \c lastpit + /** Update macro table starting with position of it \param it in some text inset - \param lastpit last processed paragraph */ - void updateEnvironmentMacros(DocIterator & it, - pit_type lastpit, + void updateMacros(DocIterator & it, DocIterator & scope) const; - /** Update macro table for one paragraph block with - same layout and depth, until \c lastpit - \param it in some text inset - \param lastpit last processed paragraph - */ - void updateBlockMacros(DocIterator & it, - DocIterator & scope) const; /// bool readFileHelper(support::FileName const & s); @@ -492,6 +489,17 @@ private: Impl * const d; frontend::GuiBufferDelegate * gui_; + + /// This function is called when the buffer structure is changed. + Signal structureChanged_; + /// This function is called when some parsing error shows up. + //Signal errors(std::string const &) = 0; + /// This function is called when some message shows up. + //Signal message(docstring const &) = 0; + /// This function is called when the buffer busy status change. + //Signal setBusy(bool) = 0; + /// Reset autosave timers for all users. + Signal resetAutosaveTimers_; };