X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FDelegates.h;h=b5844470e1827740b21cb7cc5ec7a0007eb3999f;hb=c0a1893008bd13650d470afff16f56720b65c87c;hp=02661c6b0021cd79b9c4978c268ef169f0bb9a02;hpb=f8836d8b1214104e5d3fe21d92de195c2aeacb8b;p=lyx.git diff --git a/src/frontends/Delegates.h b/src/frontends/Delegates.h index 02661c6b00..b5844470e1 100644 --- a/src/frontends/Delegates.h +++ b/src/frontends/Delegates.h @@ -12,16 +12,17 @@ #ifndef DELEGATES_H #define DELEGATES_H -#include "support/docstring.h" +#include "support/strfwd.h" namespace lyx { class Buffer; +class DocIterator; class Inset; namespace frontend { -class GuiBufferViewDelegate +class GuiBufferViewDelegate { public: virtual ~GuiBufferViewDelegate() {} @@ -29,19 +30,27 @@ public: /// This function is called when some message shows up. virtual void message(docstring const & msg) = 0; - /// This function is called when some dialog needs to be shown. - virtual void showDialog(std::string const & name) = 0; - - /// This function is called when some dialog needs to be shown with - /// some data. - virtual void showDialogWithData(std::string const & name, - std::string const & data) = 0; - /// This function is called when some inset dialogs needs to be shown. - virtual void showInsetDialog(std::string const & name, - std::string const & data, Inset * inset) = 0; + /** \param name == "bibtex", "citation" etc; an identifier used to + launch a particular dialog. + \param data is a string representation of the Inset contents. + It is often little more than the output from Inset::write. + It is passed to, and parsed by, the frontend dialog. + Several of these dialogs do not need any data. + \param inset ownership is _not_ passed to the frontend dialog. + It is stored internally and used by the kernel to ascertain + what to do with the FuncRequest dispatched from the frontend + dialog on 'Apply'; should it be used to create a new inset at + the current cursor position or modify an existing, 'open' inset? + */ + virtual void showDialog(std::string const & name, + std::string const & data, Inset * inset = 0) = 0; - /// This function is called when some dialogs needs to be updated. + /// This function is called when some dialogs needs to be reset. + /** \param name == "citation", "bibtex" etc; an identifier used + to reset the contents of a particular dialog with \param data. + See the comments to 'show', above. + */ virtual void updateDialog(std::string const & name, std::string const & data) = 0; }; @@ -53,16 +62,14 @@ public: virtual ~GuiBufferDelegate() {} /// This function is called when the buffer structure is changed. virtual void structureChanged() = 0; + /// This function is called when the buffer structure has been updated. + virtual void updateTocItem(std::string const &, DocIterator const &) = 0; /// This function is called when some parsing error shows up. - virtual void errors(std::string const &) = 0; + virtual void errors(std::string const &, bool from_master = false) = 0; /// This function is called when some message shows up. virtual void message(docstring const &) = 0; /// This function is called when the buffer busy status change. - virtual void busy(bool) = 0; - /// This function is called when the buffer readonly status change. - virtual void readonly(bool) = 0; - /// Update window titles of all users. - virtual void updateTitles() = 0; + virtual void setBusy(bool) = 0; /// Reset autosave timers for all users. virtual void resetAutosaveTimers() = 0; };