2007-10-02 18:27:20 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file Delegates.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author André Pönitz
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DELEGATES_H
|
|
|
|
#define DELEGATES_H
|
|
|
|
|
2007-11-13 23:00:36 +00:00
|
|
|
#include "support/strfwd.h"
|
2007-10-02 18:27:20 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
class Buffer;
|
2008-09-30 09:50:54 +00:00
|
|
|
class DocIterator;
|
2007-10-02 18:27:20 +00:00
|
|
|
class Inset;
|
|
|
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class GuiBufferViewDelegate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~GuiBufferViewDelegate() {}
|
|
|
|
|
|
|
|
/// This function is called when some message shows up.
|
|
|
|
virtual void message(docstring const & msg) = 0;
|
|
|
|
|
|
|
|
/// This function is called when some inset dialogs needs to be shown.
|
2007-11-21 22:48:13 +00:00
|
|
|
/** \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?
|
|
|
|
*/
|
2007-11-18 00:39:15 +00:00
|
|
|
virtual void showDialog(std::string const & name,
|
|
|
|
std::string const & data, Inset * inset = 0) = 0;
|
2007-10-02 18:27:20 +00:00
|
|
|
|
2008-05-02 21:38:23 +00:00
|
|
|
/// This function is called when some dialogs needs to be reset.
|
2007-11-21 21:18:04 +00:00
|
|
|
/** \param name == "citation", "bibtex" etc; an identifier used
|
2008-05-02 21:38:23 +00:00
|
|
|
to reset the contents of a particular dialog with \param data.
|
2007-11-21 21:18:04 +00:00
|
|
|
See the comments to 'show', above.
|
|
|
|
*/
|
2007-10-02 18:27:20 +00:00
|
|
|
virtual void updateDialog(std::string const & name,
|
|
|
|
std::string const & data) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class GuiBufferDelegate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~GuiBufferDelegate() {}
|
|
|
|
/// This function is called when the buffer structure is changed.
|
|
|
|
virtual void structureChanged() = 0;
|
2008-09-30 09:50:54 +00:00
|
|
|
/// This function is called when the buffer structure has been updated.
|
|
|
|
virtual void updateTocItem(std::string const &, DocIterator const &) = 0;
|
2007-10-02 18:27:20 +00:00
|
|
|
/// This function is called when some parsing error shows up.
|
2009-06-21 12:26:41 +00:00
|
|
|
virtual void errors(std::string const &, bool from_master = false) = 0;
|
2007-10-02 18:27:20 +00:00
|
|
|
/// 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.
|
2007-10-23 21:41:17 +00:00
|
|
|
virtual void setBusy(bool) = 0;
|
2007-10-02 18:27:20 +00:00
|
|
|
/// Reset autosave timers for all users.
|
|
|
|
virtual void resetAutosaveTimers() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif
|